Class for storing and managing all game data and states. Game is implemented as a Singleton and also uses the State pattern along with ScreenState subclasses.
More...
#include <Game.hpp>
Class for storing and managing all game data and states. Game is implemented as a Singleton and also uses the State pattern along with ScreenState subclasses.
◆ gameState
Internal states of the game.
Enumerator |
---|
s_uninitialized | |
s_menu | |
s_options | |
s_levelSelect | |
s_characterSelect | |
s_level | |
s_quit | |
◆ Game() [1/2]
Inaccessible - Game is a Singleton.
◆ ~Game()
virtual pk::Game::~Game |
( |
| ) |
|
|
virtual |
◆ Game() [2/2]
pk::Game::Game |
( |
Game const & |
| ) |
|
|
delete |
Inaccessible - Game is a Singleton.
◆ characterSelect()
static void pk::Game::characterSelect |
( |
| ) |
|
|
static |
Run the CharacterSelect state.
◆ getInstance()
static Game & pk::Game::getInstance |
( |
| ) |
|
|
static |
Retrieve the Singleton Game object.
◆ getLevelScreenState()
static ScreenState *const pk::Game::getLevelScreenState |
( |
| ) |
|
|
inlinestatic |
◆ getMenuScreenState()
static ScreenState *const pk::Game::getMenuScreenState |
( |
| ) |
|
|
inlinestatic |
◆ getMusicVolume()
static int pk::Game::getMusicVolume |
( |
| ) |
|
|
inlinestatic |
Get the global setting for music volume.
◆ getScalingFactor()
static glm::vec2 pk::Game::getScalingFactor |
( |
| ) |
|
|
inlinestatic |
Get the scaling factor according to the user's currently selected screen resolution relative to 800 x 600. Useful for scaling content with screen resolution.
- Returns
- glm::vec2 - a vector of floats.
◆ getSoundEffectVolume()
static int pk::Game::getSoundEffectVolume |
( |
| ) |
|
|
inlinestatic |
Get the global setting for sound effect volume.
◆ getWindow()
static Window *const pk::Game::getWindow |
( |
| ) |
|
|
inlinestatic |
Retrieve the SDL window from the Game object.
◆ init()
static void pk::Game::init |
( |
| ) |
|
|
static |
Initialization routine for Game ScreenStates.
◆ isRunning()
static bool pk::Game::isRunning |
( |
| ) |
|
|
inlinestatic |
Check if the Game is running.
- Returns
- bool
◆ level()
static void pk::Game::level |
( |
| ) |
|
|
static |
◆ levelSelect()
static void pk::Game::levelSelect |
( |
| ) |
|
|
static |
Run the LevelSelect state.
◆ menu()
static void pk::Game::menu |
( |
| ) |
|
|
static |
◆ operator=()
void pk::Game::operator= |
( |
Game const & |
| ) |
|
|
delete |
Inaccessible - Game is a Singleton.
◆ options()
static void pk::Game::options |
( |
| ) |
|
|
static |
◆ run()
static void pk::Game::run |
( |
| ) |
|
|
static |
Runs the game - call to get everything going.
◆ setMusicVolume()
static void pk::Game::setMusicVolume |
( |
int |
v | ) |
|
|
inlinestatic |
Set the global music volume.
- Parameters
-
int | v - integer specifying the music volume. |
◆ setScalingFactor()
static void pk::Game::setScalingFactor |
( |
glm::vec2 |
f | ) |
|
|
inlinestatic |
Set the global scaling factor for drawing.
- Parameters
-
glm::vec2 | f - a scaling factor specified as a glm::vec2 of floats. |
◆ setScreenState()
static void pk::Game::setScreenState |
( |
ScreenState *const |
state | ) |
|
|
inlinestatic |
◆ setSoundEffectVolume()
static void pk::Game::setSoundEffectVolume |
( |
int |
v | ) |
|
|
inlinestatic |
Set the global sound effect volume.
- Parameters
-
int | v - integer specifying the music volume. |
◆ m_characterSelect
CharacterSelect state instance.
◆ m_gameState
Uint32 pk::Game::m_gameState |
|
staticprivate |
Game object state (not screen state...but related).
◆ m_level
◆ m_levelSelect
LevelSelect state instance.
◆ m_levelSelected
Uint32 pk::Game::m_levelSelected |
|
staticprivate |
The current level selected by the player.
◆ m_menu
Main menu state instance.
◆ m_musicVolume
int pk::Game::m_musicVolume |
|
staticprivate |
The current setting for music volume.
◆ m_options
Options menu state instance.
◆ m_running
Check if Game is running.
◆ m_scalingFactor
glm::vec2 pk::Game::m_scalingFactor |
|
staticprivate |
The scaling factor according to the current resolution relative to 800 x 600.
◆ m_soundEffectVolume
int pk::Game::m_soundEffectVolume |
|
staticprivate |
The current setting for sound effect volume.
◆ m_state
◆ m_window
Window object for context and rendering.
The documentation for this class was generated from the following file: