-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboss.h
65 lines (50 loc) · 1.28 KB
/
boss.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
#pragma once
#include "entity.h"
#include "player.h"
class Boss : public ModelEntity {
public:
Boss(glm::vec3 pos, Player* player);
~Boss();
void update(GLfloat delta) override;
void render();
void onCollision(Tag tag, Entity* other) override;
void addBox(AABB box, glm::vec3 color);
void playerHitSwitch();
bool isVulnerable();
float getHealthPercentage();
private:
Transform* body;
Transform* larm;
Transform* rarm;
Transform lgun;
Transform rgun;
Transform* leye;
Transform* reye;
Transform* mouth;
Transform* lmouth;
Transform* rmouth;
Transform* lbrow;
Transform* rbrow;
Player* player;
int phase = 0;
const float maxHealth = 1000.0f;
float health = maxHealth;
glm::vec3 startPosition;
glm::vec3 targetPosition;
glm::quat targRot;
glm::quat currRot;
float vulnerableTimer = -1.0f;
const float shotsPerSecond = 1.0f;
int shotCount = 0;
float shotTimer = 0.0f;
bool launchHomingVolley = false;
bool shootRight = true;
float bossDyingTime = 5.0f;
int switchIndex = -1;
int switchesHit = 0;
glm::vec3 oldSwitchColor;
std::vector<int> boxIndices;
std::vector<AABB> boxAABBs;
std::vector<glm::mat4> boxModels;
std::vector<glm::vec3> boxColors;
};