File: game.h

package info (click to toggle)
epiphany 0.7.0+0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 7,532 kB
  • sloc: cpp: 6,404; ansic: 141; makefile: 78; sh: 7
file content (127 lines) | stat: -rw-r--r-- 2,342 bytes parent folder | download | duplicates (6)
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
119
120
121
122
123
124
125
126
127
/***************************************************************************
                          game.h  -  description
                             -------------------
    begin                : Tue Aug 28 2001
    copyright            : (C) 2001 by Giuseppe D'Aqu�
    email                : kumber@tiscalinet.it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License, Version 2, as published by  *
 *   the Free Software Foundation.                                   *
 *                                                                         *
 ***************************************************************************/

#include "dephine.h"


#include "fonts/font_manager.h"

#include "game_timer.h"




#ifndef GAME_H
#define GAME_H
class Menu;
class Level;



class Game
{

private:


	Game_Timer m_time;
	
	Level* m_level;
	
	Font_Handle m_game_font;
	
	Font_Handle m_time_font;
	
	Font_Handle m_credits_font;
	
	bool m_frame_limiter_enabled;

	Epiconfig* m_config;
	
	Uint32 m_unsolved_level;
	
	Uint32 m_max_num_of_levels;
	
	char m_ini_path[255];
	
	Uint32 m_frame_skip;

	
	Uint32 find_levels_in_dir();

public:

	
	void init();
	
	void go();
	
	bool main_loop();
	
	Level* get_current_level(){return m_level;}
	
	~Game();
	
	void get_keys();
	
	//carica gli sprites e li immagazzina in m_sprites
	void load_fonts();
	
	void load_config();
	
	void load_surfaces();
	
	void play_level(const char *);
	
	void move_all();
	
	void draw(Uint32 frame_number, bool update_only=false);
	
	void draw_score();
	
	void show_credits();
	
	void show_loading();
	
	void save_last_level(Uint32 last_level);
	
	bool is_frame_limiter_enabled(){return m_frame_limiter_enabled;}
	
	void set_frame_limiter_enabled(bool enable){m_frame_limiter_enabled = enable;}
	
	Uint32 get_frame_skip(){return m_frame_skip;}
	
	void set_frame_skip(Uint32 frame_skip){m_frame_skip = frame_skip;}
	

	// begin Singleton stuff

private:

	static Game* _instance;

protected:

	Game(){};

public:

	static Game* instance();

};

#endif //GAME_H