-
Notifications
You must be signed in to change notification settings - Fork 1
/
MenuEffect1.cpp
69 lines (58 loc) · 1.36 KB
/
MenuEffect1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "MenuEffect1.h"
#include "ResourceHandler.h"
namespace RTG
{
float CreateRandNum()
{
return 0.2f + 0.8f * rand() / RAND_MAX;
}
MenuEffect1::MenuEffect1( int sprite,
MAPIL::Vector3 < float > pos,
double speed,
double angle,
int index ) : Effect3D(),
m_Counter( 0 ),
m_Pos( pos ),
m_Speed( speed ),
m_Angle( angle ),
m_Index( index ),
m_PSprite( sprite ),
//m_Color( MAPIL::ColorARGB < float > ( 1.0f, 1.0f, 1.0f, 1.0f ) )
m_Color( MAPIL::ColorARGB < float > ( 1.0f, CreateRandNum(), CreateRandNum(), CreateRandNum() ) )
{
}
MenuEffect1::~MenuEffect1()
{
m_Counter = 0;
m_Speed = 0.0;
m_Angle = 0;
}
void MenuEffect1::Draw()
{
}
bool MenuEffect1::Move()
{
m_Pos.m_X += static_cast < float > ( m_Speed * cos( m_Angle ) );
m_Pos.m_Y += static_cast < float > ( m_Speed * sin( m_Angle ) );
++m_Counter;
if( m_Pos.m_X > 660.0 ){
return false;
}
if( m_Pos.m_X < -20.0 ){
return false;
}
if( m_Pos.m_Y < -20.0 ){
return false;
}
if( m_Pos.m_Y > 500.0 ){
return false;
}
MAPIL::UpdatePointSprite( m_PSprite, m_Index, m_Pos, 1.0f,
MAPIL::GetColorARGBValue( m_Color.m_A, m_Color.m_R, m_Color.m_G, m_Color.m_B ) );
return true;
}
int MenuEffect1::GetIndex() const
{
return m_Index;
}
}