-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflyingenemy.h
106 lines (66 loc) · 1.83 KB
/
flyingenemy.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* File: flyingenemy.h
* Author: 2019202344
*
* Created on 6 de Dezembro de 2019, 18:22
*/
#ifndef FLYINGENEMY_H
#define FLYINGENEMY_H
#include <random>
#include "wfobj.h"
#include "airplanemovement.h"
#include "projectile.h"
#include "teleportable.h"
#include "propeller.h"
#include "minimapitem.h"
#include "wings.h"
class flying_enemy_t :
public obstacle_t, public teleportable_t, public mini_map_item_t {
private:
static std::default_random_engine sRandomMovement;
static wf_object_t* sEnemyModel;
static wf_object_t* sWingModel;
static vector3f sCannonOffset;
float radius;
airplane_movement_t* controller = NULL;
bool dead = false;
float initialVelocity;
time_t accumulatedTime = 0;
int behaviour = 0;
float horizontal = 0;
propeller_t* propeller = NULL;
point3f initialPosition;
wing_t wing;
public:
flying_enemy_t(point3f position, float radius);
void reset() {
dead = false;
controller->reset();
controller->setPosition(initialPosition);
accumulatedTime = 0;
behaviour = 0;
propeller->reset();
}
void setInitialVelocity(float initialVelocity);
void update(int millis);
void clipZ(float z);
void transformAndDraw();
static void init(wf_object_loader_t& loader);
point3f getPosition() const override;
float getRadius() const override;
void kill();
bool isDead() const {
return dead;
}
const char* getName() const override;
vector3f getVelocity() const override;
void setPosition(const point3f& p) override;
vector3f getCannonExit();
bool isAlive() const override {
return !dead;
}
void drawMapElement(circle_blueprint_t* blueprint) const override;
private:
void drawWing(float r);
};
#endif /* FLYINGENEMY_H */