Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
SM_EndGame.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <iostream>
5 #include <fstream>
6 #include <vector>
7 #include "../S_State.h"
8 #include "../S_StateManager.h"
9 #include "../../Core/C_Texture.h"
10 #include "../../Core/C_Audio.h"
11 #include "../../Core/C_Music.h"
12 #include "../../Core/C_Text.h"
13 #include "../../UI/UI_Button.h"
14 #include "SM_MainMenu.h"
15 
20 class SM_EndGame : public S_State
21 {
22 public:
32 
36  ~SM_EndGame();
37 
42  bool input();
43 
48  void update(float dt);
49 
53  void draw();
54 
55 private:
65  std::vector<std::string> scores;
78  //The Y position of the Buttons
79  float buttonYPos[1];
80  //A boolean for if the scores file needs to be updated.
82 
86  void loadScores();
87 
92  void compareScores(int score);
93 
97  void writeScores();
98 };
bool input()
Handles the State input.
Definition: SM_EndGame.cpp:80
std::vector< std::string > scores
A std::vector of the loaded scores.
Definition: SM_EndGame.h:65
Creates a Button object that inherits Entity.
Definition: UI_Button.h:11
float * universalSpeed
A pointer for the universal speed of the menu.
Definition: SM_EndGame.h:63
C_Vec2 coinDim
The dimensions of the coin image.
Definition: SM_EndGame.h:77
C_Vec2 dimensions
The screen dimensions.
Definition: S_State.h:53
Creates a Text Texture for use with a renderer using the Text formating.
Definition: C_Text.h:13
SM_EndGame(S_StateManager *stateManager, SDL_Renderer *renderer, C_Vec2 dimensions, C_Music *backgroundMusic, int score)
Constructs the State object.
Definition: SM_EndGame.cpp:3
Contains State functions and data to be inherited by all other states.
Definition: S_State.h:14
C_Texture * coin
The Coin Image.
Definition: SM_EndGame.h:73
~SM_EndGame()
Destructs the State object.
Definition: SM_EndGame.cpp:68
Contains the Vec2 structure with functions and overloaded operators.
Definition: C_Vec2.h:7
S_StateManager * stateManager
A pointer to the state manager.
Definition: S_State.h:49
C_Text * scoreText
The Score text.
Definition: SM_EndGame.h:75
C_Texture * gameOver
The Game Over Image.
Definition: SM_EndGame.h:71
void draw()
A function to draw the State to the screen.
Definition: SM_EndGame.cpp:133
UI_Button * retryButton
The retry Button.
Definition: SM_EndGame.h:67
C_Music * backgroundMusic
The background music.
Definition: SM_EndGame.h:57
A State that contains and runs the End Game Menu.
Definition: SM_EndGame.h:20
C_Texture * buttonBackground
The Button Background Image.
Definition: SM_EndGame.h:61
void update(float dt)
A function to update the State.
Definition: SM_EndGame.cpp:124
Handles music using SDL_Mixer.
Definition: C_Music.h:12
Handles the functions for all State objects.
Definition: S_StateManager.h:11
void writeScores()
A function to write out the scores.
Definition: SM_EndGame.cpp:211
UI_Button * exitButton
The Exit Button.
Definition: SM_EndGame.h:69
bool updateScores
Definition: SM_EndGame.h:81
SDL_Renderer * renderer
A pointer to the renderer.
Definition: S_State.h:51
float buttonYPos[1]
Definition: SM_EndGame.h:79
Creates a Texture for use with a renderer.
Definition: C_Texture.h:13
void loadScores()
A function to load in the scores.
Definition: SM_EndGame.cpp:161
void compareScores(int score)
A function to compare the scores.
Definition: SM_EndGame.cpp:188
C_Texture * background
The Background Image.
Definition: SM_EndGame.h:59