/
BossEntity.h
60 lines (47 loc) · 1.2 KB
/
BossEntity.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
52
53
54
55
56
57
58
59
#ifndef BOSSENTITY_H
#define BOSSENTITY_H
#include "Core/Image.h"
#include "Core/SceneNode.h"
#include "EntityDef.h"
#include "EntityFactory.h"
class EntityFactory;
class BossEntity : public SceneNode
{
private:
static const int ENTITY_SPEED = 5;
static const int ENTITY_WIDTH = 512;
static const int ENTITY_HEIGHT = 256;
static const int STATE_DYING = 0;
static const int STATE_MOVING = 1;
static const int STATE_ATTACKING = 2;
static const int STATE_PANIC = 3;
static const int LIFEBAR_WIDTH = 300;
static const int LIFEBAR_HEIGHT = 54;
static const int LIFEBAR_X = 710;
static const int LIFEBAR_Y = 10;
EntityFactory* factory;
Image* image;
Rectangle* camera;
bool active;
int yVel;
int state;
int attackCounter;
int health;
int maxHp;
int panicCounter;
int deathCounter;
bool dead;
void updateDying();
void updateMoving();
void updateAttacking();
void updatePanic();
public:
BossEntity(Image* i, Rectangle* c, EntityFactory* f, int x, int y);
~BossEntity();
void update();
void draw(Rectangle* view, Graphics* g);
void damage(int d);
int getHealth();
bool isDead();
};
#endif