-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShortRange.cpp
More file actions
74 lines (62 loc) · 1.91 KB
/
ShortRange.cpp
File metadata and controls
74 lines (62 loc) · 1.91 KB
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
70
71
72
73
74
#include "ShortRange.h"
//=============================================================================
ShortRange::ShortRange()
{
damage = 0;
range = 0;
speed = 0;
}
//=============================================================================
bool ShortRange::OnLoad(char* File, int Width, int Height, int MaxFrames)
{
if(CEntity::OnLoad(File, Width, Height, MaxFrames) == false)
{
return false;
}
return true;
}
//-----------------------------------------------------------------------------
void ShortRange::OnLoop()
{
CEntity::OnLoop(X, Y);
}
//-----------------------------------------------------------------------------
void ShortRange::OnRender(SDL_Surface* Surf_Display)
{
if(Surf_Entity == NULL || Surf_Display == NULL) return;
if (IsJumping == true)
{
CSurface::OnDraw(Surf_Display, Surf_Entity, X - CCamera::CameraControl.GetX(), Y - CCamera::CameraControl.GetY() + 2, CurrentFrameCol * Width, (CurrentFrameRow + 5) * Height, Width, Height);
}
else
{
CSurface::OnDraw(Surf_Display, Surf_Entity, X - CCamera::CameraControl.GetX(), Y - CCamera::CameraControl.GetY() + 2, CurrentFrameCol * Width, (CurrentFrameRow + Anim_Control.GetCurrentFrame() + 6) * Height, Width, Height);
}
}
//------------------------------------------------------------------------------
void ShortRange::OnCleanup()
{
CEntity::OnCleanup();
}
//------------------------------------------------------------------------------
void ShortRange::OnAnimate()
{
if(SpeedX != 0)
{
Anim_Control.MaxFrames = 13;
}
else
{
Anim_Control.MaxFrames = 0;
}
CEntity::OnAnimate();
}
//------------------------------------------------------------------------------
bool ShortRange::OnCollision(CEntity* Entity)
{
return true;
}
//=============================================================================
void ShortRange::DoDamage()
{
}