-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel.h
49 lines (40 loc) · 877 Bytes
/
level.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
#ifndef LEVEL_H
#define LEVEL_H
#include "object.h"
#include <vector>
using std::string;
using std::vector;
enum class LevelEventType
{
LEVENT_STARTLEVEL,
LEVENT_SPEEDCHANGE,
LEVENT_SPAWNENEMY,
LEVENT_SETBLINK,
LEVENT_ENDLEVEL
};
class LevelEvent
{
public:
int event_line;
LevelEventType event_type;
int value;
bool has_child;
LevelEvent(int new_line, LevelEventType new_type, int new_value, bool new_has_child);
};
class Level : public Object
{
protected:
int line = 0;
int scroll_speed = 4;
vector <LevelEvent *> events;
public:
void InterpretEvent();
void LoadLevelFile(char level_path[]);
Level (Game *Pgame, char level_path[]) : Object(Pgame, (char *) "level.png", true, 0, -720)
{
type = ObjectType::OBJ_LEVEL;
this->LoadLevelFile(level_path);
}
void Tick();
};
#endif // LEVEL_H