Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Game.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <iostream>
5 #include <unordered_map>
6 #include <vector>
7 #include <time.h>
8 #include "Utilities.h"
9 #include "State.h"
10 #include "StateManager.h"
11 #include "Audio.h"
12 #include "Camera.h"
13 #include "Entity.h"
14 #include "GameUI.h"
15 #include "LoadingScreen.h"
16 #include "Ring.h"
17 #include "Player.h"
18 #include "Ground.h"
19 #include "HelpUI.h"
20 #include "ParticleEffect.h"
21 
22 
24 #define NUM_OF_TARGETS 30
25 
30 class Game : public State
31 {
32 private:
34  std::unordered_map<std::string, Object*> objects;
35  /*The loaded Shader files*/
36  std::unordered_map<std::string, Shader*> shaders;
44  std::vector<Ring*> targetRings;
58  float height;
62  float score;
68  float timeSinceEnd;
70  bool ended;
71 
75  void loadingScreen();
76 
80  void resetGame();
81 
82 public:
91 
95  ~Game();
96 
101  bool input();
102 
107  void update(float dt);
108 
112  void draw();
113 };
bool ended
Definition: Game.h:70
~Game()
Definition: Game.cpp:118
Creates a Ground object that inherits Entity.
Definition: Ground.h:16
Creates a ParticleEffect object that handles Particle objects.
Definition: ParticleEffect.h:22
Creates a State object. Creates a State object to be inherited. DISCLAMER - This is a modified versio...
Definition: State.h:16
void loadingScreen()
Definition: Game.cpp:360
ParticleEffect * reachedEndEffect
Definition: Game.h:66
std::unordered_map< std::string, Shader * > shaders
Definition: Game.h:36
Camera * camera
Definition: Game.h:54
void resetGame()
Definition: Game.cpp:387
void update(float dt)
Definition: Game.cpp:195
Creates a StateManager object. Creates a StateManager object to be inherited. DISCLAMER - This is my ...
Definition: StateManager.h:13
std::unordered_map< std::string, Object * > objects
Definition: Game.h:34
Player * player
Definition: Game.h:46
StateManager * stateManager
Definition: State.h:20
float score
Definition: Game.h:62
Creates an Camera object.
Definition: Camera.h:14
Ground * house
Definition: Game.h:50
int initialLoops
Definition: Game.h:64
Ground * ground
Definition: Game.h:52
float timeSinceEnd
Definition: Game.h:68
SDL_Window * window
Definition: State.h:22
Audio * ringMissed
Definition: Game.h:42
int screenHeight
Definition: State.h:26
Game(StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
Definition: Game.cpp:9
bool input()
Definition: Game.cpp:151
float height
Definition: Game.h:58
Creates an Game object that inherits State and runs the Game.
Definition: Game.h:30
std::vector< Ring * > targetRings
Definition: Game.h:44
Ground * chapel
Definition: Game.h:48
void draw()
Definition: Game.cpp:329
A class for the 2D GameUI that inherits UI.
Definition: GameUI.h:14
int screenWidth
Definition: State.h:24
Creates a Player object that inherits Entity.
Definition: Player.h:22
Audio * ringPassed
Definition: Game.h:40
Creates a Audio object to handle the SDL_Mixer.
Definition: Audio.h:12
GameUI * userInterface
Definition: Game.h:56
Audio * music
Definition: Game.h:38