forked from afavaro/SPACEBATS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelManager.h
More file actions
62 lines (42 loc) · 1.11 KB
/
LevelManager.h
File metadata and controls
62 lines (42 loc) · 1.11 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
58
59
60
61
62
#ifndef LEVEL_MANAGER_H
#define LEVEL_MANAGER_H
class BodyEmitter;
#include <vector>
#include "Level.h"
#include "InputListener.h"
#include "Framework.h"
#include "BodyEmitter.h"
using namespace std;
const int WIN_OFFSET = -2;
const int LOSE_OFFSET = -1;
/*
* This class implements a LevelManager, which manages the different Levels of the game.
* The LevelManager works by reading in levels from files contained in the levels/ directory.
* Each level is named by a text file with the level number, 1,2...etc.
*/
class LevelManager : public InputListener {
public:
LevelManager(int numLevels);
~LevelManager();
Level* getLevel(int i);
Level* current();
void renderSplash();
bool shouldShowSplashScreen();
void setSplash(bool s);
void setBodyEmitter(BodyEmitter* b);
void handleEvent(sf::Event &event, const sf::Input &input);
bool last();
bool gameOver();
void setGameOver(bool over);
void setWon(bool won);
void nextLevel();
int currentLevel;
private:
bool over;
bool won;
BodyEmitter* emitter;
bool splashOn;
vector<Level*> levels;
int numLevels;
};
#endif // level manager