-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenemy.h
40 lines (32 loc) · 842 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
/*
* enemy.h
*
* Created on: 2013-07-28
* Author: Liam
*/
#ifndef ENEMY_H_
#define ENEMY_H_
#include "entity.h"
#include "entitycreator.h"
#define ENEMY_PATROL_SPEED 15
typedef class Enemy : public Entity {
public:
Enemy();
Enemy(vec2d pos, int width, int height, int patroldist);
virtual void update(float dt);
virtual ~Enemy() {}
void resize(const int &w, const int &h);
virtual bool write(std::ofstream &file);
virtual bool read(std::ifstream &file);
protected:
int m_patroldist;
vec2d m_home;
} Enemy_s;
typedef class _EnemyCreator: public EntityCreator {
public:
virtual ~_EnemyCreator() {}
virtual Entity *create() const {return new Enemy;}
virtual Entity *create(const vec2d &pos, const vec2d &size, const int &properties) const;
} Enemy_Creator;
extern Enemy_Creator EnemyCreator;
#endif /* ENEMY_H_ */