-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
118 lines (90 loc) · 2.81 KB
/
Game.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*******************************************************************************
CommanderTux
Penguin In Space
Released under the GNU Public License
2005 by Andr� Schnabel ([email protected])
*******************************************************************************/
// Game.h
#ifndef GAME_H
#define GAME_H
#include "State.h"
#include "Worldmap.h"
#include "Level.h"
#include "Sprite.h"
#include "Load.h"
class CMenu;
struct STextMSG
{
bool visible;
int remaining;
};
class CGame : public CState
{
public:
CGame( SFramework_Setup *setup );
virtual ~CGame();
virtual void Input();
virtual void Update();
virtual void Draw();
//void NextLevel();
void ChangeLevel( const char *filename );
void SetCurLevel( int value ) { m_cur_level = value; }
bool GetAllDone() { return m_all_done; }
void SetAllDone( bool value ) { m_all_done = value; }
void LoadWorldmapSurfaces( bool first_time=false );
void UnloadWorldmapSurfaces();
private:
SFramework_Setup *m_setup; // because we need to edit the original
// and not the copy from the framework
bool m_all_done;
SReleased m_released;
SDL_Texture *m_load_background, *m_load_circle;
CMenu *m_menu, *m_settings_menu;
STextMSG m_credits;
SDL_Texture *m_me, *m_dogs;
bool m_worldmap_surfaces_loaded;
SDL_Texture *m_world_surface, *m_world_player_surfaces[2][NUM_W_P_IMAGES];
CWorldmap *m_worldmap;
CLevel *m_level;
int m_cur_level;
int m_scroll_x, m_scroll_y;
#ifndef NO_SOUND
Mix_Music *m_songs[NUM_SONGS];
#endif
};
// Changes here should also be made in the
// menu image file. Look at: Defines.h
#define SEL_NEW_GAME 0
#define SEL_DUEL 1
#define SEL_SETTINGS 2
#define SEL_EDITOR 3
#define SEL_CREDITS 4
#define SEL_EXIT 5
// Changes here are interesting for the settings menu image file!
#define SEL_FULLSCREEN 0
#define SEL_WINDOWED 1
#define CREDITS_TIME 100
class CMenu
{
public:
CMenu( const char *img_name,
const char *head_name,
bool settings_menu );
~CMenu();
void Draw();
void ChangeSelection( int selection );
int GetSelection();
void SetVisible( bool value ) { m_visible = value; }
bool GetVisible() { return m_visible; }
private:
bool m_settings_menu;
SDL_Texture *m_image, *m_head_surf;
CAnim_Sprite *m_head_spr;
bool m_head_move_eye;
int m_selection;
bool m_visible;
#ifndef NO_SOUND
Mix_Chunk *m_sel_sound;
#endif
};
#endif