blob: 3070ef7ca35ae4477bec30e16e0653ccd79f6dc8 (
plain)
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
|
#include <iostream>
#include "Creature.h"
Creature::Creature() {
xVel = 0;
yVel = GRAVITY;
}
int Creature::getXVel() {
return xVel;
}
int Creature::getYVel() {
return yVel;
}
void Creature::setXVel(int xVel) {
this->xVel = xVel;
}
void Creature::setYVel(int yVel) {
this->yVel = yVel;
}
void Creature::incXVel(int xVel) {
this->xVel += xVel;
}
void Creature::incYVel(int yVel) {
this->yVel += yVel;
}
int Creature::getHealth() {
return health;
}
void Creature::setHealth(int h) {
health = h;
}
void Creature::orient() {
if (xVel < 0)
clipNo = ORIENT_LEFT;
else if (xVel > 0)
clipNo = ORIENT_RIGHT;
else if (yVel < 0)
clipNo = ORIENT_BACK;
else
clipNo = ORIENT_FRONT;
}
|