-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameEngine.hpp
139 lines (125 loc) · 2.88 KB
/
GameEngine.hpp
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
128
129
130
131
132
133
134
135
136
137
138
139
#pragma once
// gdl
#include <Game.hh>
#include <SdlContext.hh>
#include <SDL_keycode.h>
#include <BasicShader.hh>
// stl
#include <vector>
#include <iostream>
#include <sstream>
// ours
#include "AObject.hpp"
#include "Texture.hh"
#include "Geometry.hh"
#include "Background.hpp"
#include "Button.hpp"
#include "Character.hpp"
#include "Exception.hpp"
#include "Camera.hpp"
#include "Sound.hpp"
#include "Cube.hpp"
#include "Player.hpp"
#include "Ground.hpp"
#include "Block.hpp"
#include "Bomb.hpp"
#include "Explosion.hpp"
#include "Bonus.hpp"
#include "GameMap.hh"
#include "number.hpp"
#include "Arrow.hpp"
#include "Slide.hpp"
#include "SaveInterface.hpp"
#include "Save.hpp"
class GameEngine : public gdl::Game
{
private:
gdl::SdlContext _context;
gdl::Clock _clock;
gdl::Input _input;
gdl::BasicShader _shader;
gdl::Texture _texture;
std::vector<Bonus *> _bonus;
AObject * _wall;
AObject * _ground;
AObject * _block;
AObject * _bomb;
AObject * _explosion;
std::vector<Player*> _players;
GameMap *_map;
int _winX;
int _winY;
glm::mat4 _projection;
glm::mat4 _transformation;
Camera *_cam;
Sound *_sound;
int _height;
int _width;
std::deque<Bomb *> _dynamicObjects;
bool _splitScreen;
int _total;
typedef bool(GameEngine::*setting)();
setting tab[6];
std::vector<AObject*> _objects;
std::vector<AObject*> _tmp;
std::vector<int> _positionHome;
int stat;
std::string mode;
int pos;
int nb;
double old_time;
int _id;
std::list<char> _saveTitle;
public:
GameEngine();
~GameEngine();
public:
bool initialize();
bool update();
void draw();
void drawFullScreen();
void drawFullMap();
void drawSplitScreen();
bool createHomeMenu();
void clearVector();
void createSound();
bool startGame();
// Pause
void mainMenu();
bool saveGame();
bool loadMode();
// Slide images
std::vector<std::string> createPlayerSettingSlide();
std::vector<std::string> createModeSettingSlide();
std::vector<std::string> createRoundSettingSlide();
std::vector<std::string> createMapSettingSlide();
std::vector<std::string> createHomeSlide();
std::vector<std::string> createPauseSlide();
std::vector<std::string> createWinnerSlide();
std::map<int, std::string> createAlphabetSlide();
std::vector<std::string> createPredefinedSlide();
std::vector<std::string> createCustomSlide();
std::map<int, std::string> createNumbersSlide();
std::vector<std::string> createScoreSlide();
// Setting
bool createModeSetting();
bool createPlayerSetting();
bool createMapModeSetting();
bool createPredefinedSetting();
bool createPause();
bool loadSetting();
bool createCustomSetting();
bool createLoad();
// winner
bool loadWinner();
bool loadWinner2();
// mode
bool HomeMode();
bool SettingMode();
bool PauseMode();
bool OverMode();
bool PlayMode();
bool SaveMode();
bool CustomMode();
bool ScoreMode();
};