forked from afavaro/SPACEBATS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel.h
More file actions
86 lines (63 loc) · 1.17 KB
/
Level.h
File metadata and controls
86 lines (63 loc) · 1.17 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef LEVEL_H
#define LEVEL_H
/* This class represents a level. A level can be read in from a text file. The text file
* for the level is of the following form.
*
* BACKGROUND IMAGE FILE PATH
* NUM MODELS
* LIST OF MODELS TO USE (MODEL #)
* NUM GATES
* LIST OF GATE TIME, GATE NUM
*
*
* EXAMPLE
*
* models/space2.jpg
* 2 // 2 models
* 4 //use model # 4
* 0 //use model # 0
* 4 // 4 landmarks
* 10 0
* 25 0
* 40 0
* 55 0
*
*/
#include "Framework.h"
#include "Shader.h"
#include "Body.h"
#include <queue>
using namespace std;
struct Landmark{
float time;
BodyType type;
void print(){
printf("T: %f : %d\n", time, type);
}
};
class Level{
public:
Level(int level);
~Level();
void print();
sf::Image* getSplash();
void renderBackground();
BodyType firstLandmark();
bool shouldEmitLandmark(float timeElapsed);
bool hasBG();
static Shader* bgShader;
static void loadShaders();
vector<BodyType> levelTypes;
int number();
float speed;
bool hasGates;
int count;
float endTime;
private:
int level;
string splashFile, bgFile;
vector<Landmark> landmarks;
sf::Image* background;
sf::Image* splashImage;
};
#endif // level.h