-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcuzer.h
More file actions
51 lines (42 loc) · 1.17 KB
/
cuzer.h
File metadata and controls
51 lines (42 loc) · 1.17 KB
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 _CUZER_H_
#define _CUZER_H_
#include <memory>
#include "object.h"
#include "sdl_compat.h"
#include "ai.h"
class PhysicsWorld;
enum class CuzerSize {
SMALL, // 1 HP, smaller radius
MEDIUM, // 2 HP, medium radius
LARGE // 3 HP, larger radius
};
class Cuzer : public Object {
public:
Cuzer();
Cuzer(float x, float y, CuzerSize size);
~Cuzer() {}
void update(float shipX, float shipY);
void draw(void);
void initPhysics(PhysicsWorld& world) override;
void syncFromPhysics() override;
void setPhysicsWorld(PhysicsWorld* world) { physicsWorldPtr = world; }
bool isDestroyed() const { return destroyed; }
void destroy() { destroyed = true; }
bool takeHit(); // Returns true if destroyed (HP reaches 0)
CuzerSize getSize() const { return size; }
float getRadius() const { return radius; }
GameColor getColor() const { return baseColor; }
Point vel;
float angle;
float angularVel;
bool destroyed;
private:
CuzerSize size;
float radius;
int hitPoints;
int maxHitPoints;
GameColor baseColor;
PhysicsWorld* physicsWorldPtr = nullptr;
std::unique_ptr<NpcAi> ai;
};
#endif