Repository navigation
Expand file tree
/
Copy pathbaseUnit.cpp
More file actions
92 lines (69 loc) · 1.4 KB
/
Copy pathbaseUnit.cpp
File metadata and controls
92 lines (69 loc) · 1.4 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "baseUnit.h";
#include <iostream>;
#include "Project_Constants.h";
baseUnit::baseUnit() {
hp = 100;
alive = true;
active = false;
tId = 1;
atkCheck = false;
}
baseUnit::baseUnit(uint32_t player_) {
player = 1;
hp = 100;
}
baseUnit::~baseUnit(){
std::cout << "baseUnit destroyed\n";
}
void baseUnit::movePosX(int32_t moveX) {
//nop
posX += moveX;
if ( moveX >0 ) {
curState = unitState(right);
unitSprite = &(sprites->at(curState));
}
else {
curState = unitState(left);
unitSprite = &(sprites->at(curState));
}
//unitSprite.setPosition(posX, posY);
}
void baseUnit::movePosY(int32_t moveY) {
//nop
posY += moveY;
//unitSprite.setPosition(posX, posY);
}
void baseUnit::moveVelX(int32_t moveX) {
velX = moveX;
}
void baseUnit::moveVelY(int32_t moveY) {
velY = moveY;
}
bool baseUnit::isValMove(uint32_t destX, uint32_t destY){
// a potential utility function
return true;
}
void baseUnit::updateTiming(std::chrono::milliseconds deltaTime) {
//NOP
}
void baseUnit::updateBehavior(){
//NOP
}
void baseUnit::updateDefHitBox(){
//NOP
}
void baseUnit::updateOffHitBox(){
//NOP
}
void baseUnit::setCeiling(double ceiling_) {
minHeight = ceiling_;
}
void baseUnit::setFloor(double floor_) {
maxHeight = floor_;
}
/*
//temporary sprite - redefine with better software architecture.
void baseUnit::defineGridSprite(const sf::Texture * image) {
gridSprite = image;
}
*/