-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hero.h
51 lines (39 loc) · 1 KB
/
Hero.h
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
#ifndef __HERO_H__
#define __HERO_H__
// game engine includes
#include "MapObject.h"
#include "EventKeyboard.h"
#include "EventCollision.h"
#include "Power.h"
#include "Weapon.h"
// constant defined type
#define HERO_TYPE "hero"
class Hero : public MapObject {
private:
PowerUp power;
int power_countdown = 0;
// countdowns for moving
int move_countdown = 0;
int move_slowdown = 0;
int lives = 3;
df::Position initialPosition;
Direction wep_direction;
public:
// constructor
Hero(df::Position pos);
// event handler
int eventHandler(df::Event *p_e);
// takes a input from keyboard and moves according to the keys
int keyboardInput(const df::EventKeyboard *p_e);
// if collision event then go to this function
int eventCollision(const df::EventCollision *p_e);
void activatePower();
// moves the hero by that delta
void move(int dx, int dy);
// get current powerUp of hero
Power getPower() const;
// set current powerUp of hero
void setPower(Power new_power);
void resetPosition();
};
#endif