-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenemy.h
47 lines (38 loc) · 882 Bytes
/
enemy.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
#ifndef ENEMY_H
#define ENEMY_H
#include "core.h"
#define IMG_ENEMY_PREFIX "media/images/enemy"
#define IMG_ENEMY_SUFFIX ".png"
#define ENEMY_SPEED 1
#define ENEMY_EXPLOSION 10
#define ENEMY_LAYER 1
#define ENEMY_POINTS 10
class Enemy : public IDrawable, public IUpdatable
{
public:
Enemy(Application *application, int type, int life, int left, int top, int move);
~Enemy();
static void deleteAll();
static bool checkCollisionDamage(int damage, int left, int top, int width, int height);
void update();
void draw();
//void shoot();
bool collide(int left, int top, int width, int height);
void damage(int damage);
void explode();
protected:
private:
static std::set<Enemy*> enemies;
Application *application;
Screen *screen;
Aircraft *aircraft;
HUD *hud;
Image *image;
int left;
int top;
int move;
int width;
int height;
int life;
};
#endif // ENEMY_H