-
Notifications
You must be signed in to change notification settings - Fork 3
/
game.hxx
80 lines (76 loc) · 2.47 KB
/
game.hxx
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
/*
* Copyright (C) 2011, 2012 Alexander Berntsen <alexander@plaimi.net>
* Copyright (C) 2011, 2012 Stian Ellingsen <stian@plaimi.net>
*
* This file is part of Limbs Off.
*
* Limbs Off is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Limbs Off is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Limbs Off. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GAME_H_
#define GAME_H_
#include "graphics/game_graphics_gl.hxx"
#include "physics/game_physics.hxx"
#include "player.hxx"
#include "screen_element.hxx"
class Game : public EventHandler {
public:
/** Initialise the game. */
Game(Screen* screen);
~Game();
/** Handle input. */
bool handle(const SDL_Event& event);
/** Create objects. */
void conceive();
/** Main game loop. */
void update(phys_t dt);
void updateCamera(GLfloat dt);
void draw();
private:
/** Max player characters. */
static const int MAX_PC;
/** Max planets. */
static const int MAX_PLAN;
/** Number of players. */
static const int NUM_PLAYERS;
/** Planet colour. */
static const float COL_PLANET[];
/** Planet gravity "mass". */
static const phys_t GM;
/** Orbit radius. */
static const phys_t R;
/** Orbit speed. */
static const phys_t S;
/** Planet radius. */
static const phys_t PR;
std::vector<AstroBody*> planets_;
BackgroundModifier* backgroundModifier_;
Camera* camera_;
std::vector<Character*> characters_;
std::vector<CharacterGraphic*> characterGraphics_;
ColorModifier* planetColour_;
GameUniverse* universe_;
GLuint tex_;
GraphicFixture* planetFixture_;
std::vector<Label*> massIndicatorLabels_;
std::vector<MassIndicator*> massIndicators_;
std::vector<MassIndicatorGraphic*> massIndicatorGfx_;
Circle<phys_t>* planetCircle_;
std::vector<Player*> players_;
std::vector<PositionModifier*> massIndicatorPosMods_;
Screen* screen_;
StackGraphic* scene_, * foreground_;
Sprite* backgroundSprite_;
TestDisk* planetDisk_;
};
#endif /* GAME_H_ */