-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameManager.h
79 lines (74 loc) · 2.13 KB
/
GameManager.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
#pragma once
#include "MapLoader.h"
//#include "PlayerActor.h" // We know about this through CheckPointManager
#include "IController.h"
#include "SoundManager.h"
#include "CheckPointManager.h"
#include "LevelPanGhost.h"
#include "RaceTimer.h"
#include "RaceGate.h"
#include <string>
#define MAP_BLOCK_SIZE 0.535f
#define CONTROLLERS 4
//#define CONTROLLERS 4 //this will be 4 when we have arrow keys and controllers
class GameManager
{
private:
dxManager* dx; // pointer to the dxManager
PlayerActor* player1;
PlayerActor* player2;
SimpleSprite* selector;
SimpleSprite* menuScreen;
SimpleSprite* instructScreen;
SimpleSprite* timesScreen;
SimpleSprite* lobbyScreen;
SoundManager soundManager;
MapLoader* loader;
CheckPointManager* checkpointManager;
RaceTimer* raceTimer;
GameState gameState; // uses enum defined in dxManager
MenuSelector currentMenuSelection;
int numActors;
int numTraps;
int numOfPlayers;
IController** controllers;
int WinningPlayerNum; // The Player who wins the game
float winningTime;
Checkpoint* finishPoint; // the point you need to reach to finish the game
LevelPanGhost* panGhost;
RaceGate* gate;
string winnerName;
int letterCounter; // used for when the winner enters their name
char** instructTips;
int numOfInstructPages;
SimpleSprite** instructPics;
bool controllersSelected;
int numControllersSelected;
void InitalizeGame();
void InitalizeMenu();
void StartOverview();
void BeginGame();
void FixScaling(float adjustX, float adjustY);
void CheckMenuKeyPresses();
void EnterNameText(WPARAM wparam);
void RecordBestTimes();
void ReadBestTimes();
void InitalizeInstructMenu();
public:
GameManager(dxManager* dMan);
~GameManager(void);
GameState GetGameState();
dxManager* getDXRef();
Checkpoint* GetLeftmostCheckpoint();
Checkpoint* GetFinalCheckpoint();
void ChangeMenuSelection(int val);
PlayerActor* GetPlayer(int);
MenuSelector GetMenuSelect();
void KeyDown(WPARAM);
void KeyUp(WPARAM);
void GameLoop(float time);
void MenuItemSelected();
void TogglePauseGame();
void BackToMenu();
void CleanUp(void);
};