-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollideable.cpp
More file actions
62 lines (57 loc) · 929 Bytes
/
Copy pathCollideable.cpp
File metadata and controls
62 lines (57 loc) · 929 Bytes
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
#include "Collideable.h"
Collideable::Collideable()
{
x = 0;
y = 0;
w = 0;
h = 0;
maxSpeed = 0;
animationIndex = 0;
vecAnimationIndex = 0;
}
Collideable::~Collideable()
{
delete collisionBox;
}
// Update Function for x,w,h,w. Note that it is default argumented into
// x = x, y = y, w = w, h = h;
void Collideable::update(float x, float y, float w, float h)
{
this->x = x;
this->y = y;
this->w = w;
this->h = h;
if(collisionBox)
{
collisionBox->update(x,y,w,h);
}
//cout << "update to: x,y,w,h: " << x << ", " << y << ", " << w << ", " << h << endl;
}
float Collideable::getX()
{
return x;
}
float Collideable::getY()
{
return y;
}
float Collideable::getW()
{
return w;
}
float Collideable::getH()
{
return h;
}
float Collideable::getSpeed()
{
return maxSpeed;
}
void Collideable::setAnim(vector<Animation *> * toAdd)
{
anim = toAdd;
}
vector<Animation *> * Collideable::getAnim()
{
return anim;
}