-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
118 lines (97 loc) · 2.98 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
///////////////////////////////////////////////////////////////////////////////
// File: game.h
//
// Original Author: Roby Atadero (RA)
//
// Creation Date: April 29th, 2007
//
// Last Edited: April 29th, 2007 - Implementation
//
// Purpose: Header for the Game class that holds the information
// for a game and how to control it.
///////////////////////////////////////////////////////////////////////////////
#ifndef __GAME_H__
#define __GAME_H__
#include "window.h"
#include "input.h"
#include "point.h"
#include "mathfunctions.h"
#include "resourcemgr.h"
#include "snotch.h"
#include "ai.h"
#include "enemy.h"
#include "menu.h"
#include "object.h"
#include "barrel.h"
#include "levelobjects.h"
#include "healthbar.h"
#include "livesbar.h"
#include "currentstatenode.h"
#include "animationmgr.h"
#include "ingamebutton.h"
#include "door.h"
#include "abilities.h"
#include "background.h"
#include <vector>
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include "cursor.h"
#include "startmenu.h"
#include "actionbar.h"
#include "trigger.h"
#include "triggerable.h"
#define QUIT_SIGNAL_RECEIVED false
//Define all image identifiers here so that it is much easier to
//understand what image is being used in the game class.
class Game
{
private:
Window* window; //Window that handles all the windowing
//inputs, framerate counting, etc.
bool gameover; //Whether or not the game is now over
Input* input;
ResourceMgr* resourceMgr;
Snotch* snotch;
StartMenu* startMenu;
Menu* pauseMenu;
Abilities* abilities;
vector<Object*> objects;
vector<Barrel*> barrels;
vector<AI*> enemies;
HealthBar healthBar;
LivesBar livesBar;
AnimationMgr* animationMgr;
CurrentStateNode* testAnimationId;
Cursor* cursor;
InGameButton* button;
Trigger trigger;
Background bg;
ActionBar* actionbar;
double fpsTime;
void checkAbilitiesOnAllEntities();
void updateEnemies();
void checkTriggers();
void updateGameObjects();
void updateUI();
void levelDetectionChecks();
void updateCoordinateSystem();
void drawLevel();
void drawEnemies();
void drawUI();
void drawGameObjects();
void calcFrameRate();
void handleLogic();
void renderGame();
void checkInput();
void addObject(string, int, int, int, Point);
void blowBarrel();
LevelObjects currentLevel;
bool showMouseCoords;
bool wasFired;
public:
Game();
~Game();
void init();
void play();
};
#endif