summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/game.h b/src/game.h new file mode 100644 index 0000000..69224dc --- /dev/null +++ b/src/game.h
@@ -0,0 +1,43 @@
1#ifndef GAME_H
2#define GAME_H
3
4#include "components.h"
5
6const int TILE_WIDTH = 8;
7const int TILE_HEIGHT = 8;
8const int GAME_WIDTH = 320;
9const int GAME_HEIGHT = 200;
10const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH;
11const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT;
12
13const int FRAMES_PER_SECOND = 60;
14const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND;
15
16class Game {
17 public:
18 static Game& getInstance()
19 {
20 static Game instance;
21
22 return instance;
23 }
24
25 ~Game();
26 void execute();
27 void loadMap(Map* map);
28 void input(int key, int action);
29
30 bool shouldQuit = false;
31 private:
32 Game();
33 Game(Game const&);
34 void operator=(Game const&);
35
36 GLFWwindow* window;
37 World* world;
38 World* nextWorld;
39 Map* m;
40 Map* m2;
41};
42
43#endif