-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjosephS.h
138 lines (113 loc) · 2.69 KB
/
josephS.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef joseph_h
#define joseph_h
#include <GL/glx.h>
#include "fonts.h"
#include <stdlib.h>
#include <vector>
#include <iostream>
#include <stdio.h>
#include "amberZ.h"
#include "Image.h"
#define numEnemyImages 5
using namespace std;
typedef float Vec[3];
class JoeyGlobal{
public:
float gameXresolution;
float gameYresolution;
GLuint textureArray[numEnemyImages];
float * shibaXPtr;
float * shibaYPtr;
static JoeyGlobal *instance;
static JoeyGlobal *getInstance(){
if(!instance){
instance = new JoeyGlobal;
}
return instance;
}
JoeyGlobal(){
gameXresolution = 1366;
gameYresolution = 766;
}
};
void enemyGetResolution(float, float);
class ScatterShot{
public:
float position[2];
float sideLength;
float xDirection;
float yDirection;
void drawShot();
ScatterShot();
};
class Enemy{
public:
float shibaX;
float shibaY;
float position[2];
float velocity[2];
float sideLength;
float speed;
int health;
GLuint textureUsed;
Image* imageUsed;
int imageIndex;
bool splitter = false;
SpriteTimer timer;
void splitterSpawn(float, float);
void spawn(float, float);
float getShibaXListener();
float getShibaYListener();
void setShibaXListener(float);
void setShibaYListener(float);
void drawEnemy();
void updatePosition(float, float, int);
void takeDamage(int);
void setTexture();
void scatterShot();
Enemy();
};
class EnemyControl{
public:
vector<Enemy> enemies;
void shibaCollision(int);
void createEnemy(int, float, float);
void destroyEnemy(int);
void renderEnemies();
void updateAllPosition(float, float);
void cleanupEnemies();
bool bulletHitEnemy(float, float);
void primeSpawner(int, float, float);
void createSplitEnemy(float, float);
//EnemyControl();
};
class Lives{
public:
int currentLives;
void setLives(int);
int getLives();
void changeLives(int);
void livesTextDisplay();
Lives();
};
class Score{
public:
float currentScore;
void setScore(float);
float getScore();
void changeScore(float);
float calculateScore(float);
void textScoreDisplay();
Score();
};
extern Lives numLivesLeft;
extern Score scoreObject;
extern EnemyControl enemyController;
extern vector<ScatterShot> scatterShotObject;
extern Image enemyImages[numEnemyImages];
void getTexturesFunction(GLuint);
void renderScatterShot();
void makeShots(float, float);
void cleanUpShots();
extern void josephS(float, float, GLuint);
#endif