-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemy.h
41 lines (32 loc) · 845 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
#ifndef PGEBULLETHELL_ENEMY_H
#define PGEBULLETHELL_ENEMY_H
#include "olcPixelGameEngine.h"
#include "Bullet.h"
#include <list>
#include <string>
class Game;
class Enemy {
public:
Enemy(Game* game, olc::vf2d position, std::string spriteLocation);
public:
void Update(float fElapsedTime);
olc::vf2d GetPosition();
protected:
virtual void Movement(float fElapsedTime) = 0;
virtual void Firing(float fElapsedTime) = 0;
protected:
Game* game;
float speed = 200.0f;
float bulletCooldown = 0.0f;
float bulletTriggerTime = 0.3f;
std::array<float, 4> moveData { 0 };
public:
olc::Sprite* spr = nullptr;
std::list<Bullet> bullets;
olc::vf2d position = { 20.0f, 20.0f };
float radius;
float health = 3.0f;
bool isDead = false;
int value = 100;
};
#endif //PGEBULLETHELL_ENEMY_H