-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtowerContexts.h
More file actions
57 lines (52 loc) · 1.43 KB
/
towerContexts.h
File metadata and controls
57 lines (52 loc) · 1.43 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
52
53
54
55
56
57
#ifndef TOWER_DEFENSE_GAME_CONTEXTS
#define TOWER_DEFENSE_GAME_CONTEXTS
#include"context.h"
#include"towerEntities.h"
#include"towerScripts.h"
#include"gameLevel.h"
#include"camera.h"
#include<vector>
#include<queue>
const std::string BACKGROUND_FILENAME = "data/pumpkin.png";
class MainMenu : public OuterContext {
public:
MainMenu(PlayerConfiguration*,Background* menuBg = new NullBackground());
MainMenu(const MainMenu& original);
MainMenu& operator=(const MainMenu& rhs);
virtual void frameStep (double deltaTime);
virtual void eventStep (ALLEGRO_EVENT* event);
virtual void drawStep ();
virtual void outerControl();
virtual Context* copy ();
protected:
std::unique_ptr<Background> bg;
bool initialized;
};
class DefenseLevel : public OuterContext {
public:
DefenseLevel(PlayerConfiguration*,std::string mapName);
~DefenseLevel();
virtual void frameStep (double deltaTime);
virtual void eventStep (ALLEGRO_EVENT* event);
virtual void drawStep ();
virtual void outerControl();
virtual Context* copy ();
protected:
struct Spawner {
double spawnRate;
double spawnTime;
float x;
float y;
std::queue<unsigned int> monsters;
};
std::vector<Spawner> spawners;
std::vector<Entity> entities;
std::vector<BaseEntity> bases;
std::vector<Vector2> goals;
ResourceManager::GameLevelWrapper level;
float mouseFollowX;
float mouseFollowY;
EdgeFollowCamera cam;
PathRouter pathRouter;
};
#endif