-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPoints.cpp
53 lines (43 loc) · 1.28 KB
/
CPoints.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
#include <unistd.h>
#include "CPoints.h"
#include "CAreaScoring.h"
CPoints::CPoints()
{
ID = ++CEntity::EntityCounter;
Type = 5;
FollowPath = false;
LoopPath = false;
LifeSpan = 1000;
Flags = POINTS_FLAGS;
NumberOfFrames = POINTS_ANIMATION_NUM_FRAMES;
Collision_Width = POINTS_COLLISION_WIDTH;
Collision_Height = POINTS_COLLISION_HEIGHT;
Collision_X = POINTS_COLLISION_X;
Collision_Y = POINTS_COLLISION_Y;
MaxSpeedX = POINTS_MAXSPEED_X;
MaxSpeedY = POINTS_MAXSPEED_Y;
SetInitialSpeed(0, -25, 0 , 0);
}
CPoints::CPoints(CPoints* temp)
{
temp->Flags = POINTS_FLAGS;
temp->NumberOfFrames = POINTS_ANIMATION_NUM_FRAMES;
temp->Collision_Width = POINTS_COLLISION_WIDTH;
temp->Collision_Height = POINTS_COLLISION_HEIGHT;
temp->Collision_X = POINTS_COLLISION_X;
temp->Collision_Y = POINTS_COLLISION_Y;
temp->MaxSpeedX = POINTS_MAXSPEED_X;
temp->MaxSpeedY = POINTS_MAXSPEED_Y;
PopulateData(temp);
}
bool CPoints::Load(char* File, int Width, int Height, int NumberOfFrames)
{
if(CEntity::Load(File, Width, Height, NumberOfFrames) == false) return false;
return true;
}
void CPoints::Tidy()
{
if (SEntity)
SDL_FreeSurface(SEntity);
SEntity = NULL;
}