Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
gameState.h
1 #pragma once
2 #ifndef GAMESTATE_H
3 #define GAMESTATE_H
4 
5 #include <time.h>
6 #include "state.h"
7 #include "stateManager.h"
8 #include "texture.h"
9 #include "background.h"
10 #include "player.h"
11 #include "gem.h"
12 #include "block.h"
13 #include "mapLoader.h"
14 #include "collision.h"
15 #include "enemy.h"
16 #include "audio.h"
17 #include "animation.h"
18 
23 class GameState : public State
24 {
25 private:
26  /*Animations*/
27  Animation * halfSecond;
28  Animation * quarterSecond;
29  /*audio*/
30  Audio * music;
31  Audio * gemPickup;
32  Audio * lifeLost;
33  /*spritesheets*/
34  Texture * backgrounds;
35  Texture * spritesheet;
36  Texture * numbers;
37  Texture * gameKeys;
38  /*entities*/
39  Background * background;
40  Player * player;
41  MapLoader * map;
42  /*collision*/
43  Collision * collision;
44  /*input commands*/
45  bool cmdJump, cmdLeft, cmdRight;
46  /*is the player in the middle of the screen*/
47  bool centered;
48 
49 public:
56  GameState(StateManager *, SDL_Renderer *);
57 
62  ~GameState();
63 
69  bool HandleSDLEvents();
70 
76  void Update(float deltaTime);
77 
82  void Draw();
83 
88  void displayScore();
89 
96  void updateScene(float, bool);
97 };
98 #endif
Creates a Animation object to handle the animations.
Definition: animation.h:10
void Update(float deltaTime)
Definition: gameState.cpp:178
void displayScore()
Definition: gameState.cpp:430
~GameState()
Definition: gameState.cpp:56
Creates a State object. Creates a State object to be inherited. Made using information from http://bl...
Definition: state.h:17
GameState(StateManager *, SDL_Renderer *)
Definition: gameState.cpp:9
Creates a GameState object. Creates a GameState object that inherits State.
Definition: gameState.h:23
Creates a State manager object. Creates a State manager object to be inherited. Made using informatio...
Definition: stateManager.h:13
void Draw()
Definition: gameState.cpp:381
Creates a Background object that inherits Entity. Creates a Background object with a velocity...
Definition: background.h:13
void updateScene(float, bool)
Definition: gameState.cpp:445
bool HandleSDLEvents()
Definition: gameState.cpp:80
Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used...
Definition: texture.h:13
a class to load in a map text file
Definition: mapLoader.h:16
Creates an Collision object. The Collision object is for use with detecting Collision. Used help from http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/ in the type 2 section.
Definition: collision.h:15
Creates a Player object that inherits Creature which in turn inherits Entity.
Definition: player.h:10
Creates a Audio object to handle the SDL_Mixer. Done using help from http://www.lazyfoo.net/tutorials/SDL/21_sound_effects_and_music/index.php.
Definition: audio.h:13