-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlocations.h
47 lines (43 loc) · 928 Bytes
/
locations.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
class Game;
class Location{//base class for all game locations
protected:
Game* parent;
public:
Location(Game*);
virtual ~Location();
virtual void event(SDL_Event *) = 0;//processing an event
virtual void draw() = 0;//do something and blit on the screen
};
class Menu:public Location{//start menu location
protected:
Button *playbtn, *exitbtn;
SDL_Surface *background;
public:
Menu(Game*);
virtual ~Menu();
void event(SDL_Event *);
void draw();
};
class GameLoc:public Location{
protected:
Hero *hero;
Enemies *enemies;
float acc;
char keypress[4];
bool run;
public:
GameLoc(Game*);
virtual ~GameLoc();
void event(SDL_Event *);
void draw();
};
class EndLoc:public Location{
protected:
Button *playbtn, *exitbtn;
SDL_Surface *background;
public:
EndLoc(Game*);
virtual ~EndLoc();
void event(SDL_Event *);
void draw();
};