-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
57 lines (48 loc) · 1.13 KB
/
Game.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
#ifndef PGEBULLETHELL_GAME_H
#define PGEBULLETHELL_GAME_H
#include "olcPixelGameEngine.h"
#include "StarMap.h"
#include "Player.h"
#include "Enemy.h"
#include "UI.h"
#include <list>
class Game : public olc::PixelGameEngine
{
public:
Game();
public:
bool OnUserCreate() override;
bool OnUserUpdate(float fElapsedTime) override;
protected:
void TitleScreen(float fElapsedTime);
void PrimaryLoop(float fElapsedTime);
void GameOver(float fElapsedTime);
void GenerateEnemies();
void ProcessEnemies(float fElapsedTime);
void ProcessPlayerCollision();
void ProcessEnemyCollision();
public:
float GetPlayerHealth();
protected:
struct enemyDef {
olc::vf2d pos;
std::string spriteLocation;
int type;
float startTime;
bool loaded = false;
};
protected:
int phase = 0;
StarMap starmap;
Player player;
UI ui;
std::list<Enemy*> enemies;
std::list<Bullet> fragments;
public:
float scrollSpeed = 60.0f;
float time = 0.0f;
std::vector<enemyDef> eDefs;
int score = 0;
float interactionDelay = 0;
};
#endif //PGEBULLETHELL_GAME_H