Polygon Dash
|
Main game application. More...
Public Member Functions | |
this (string title, uint fps) | |
The width of the game window. | |
~this () | |
Cleanup the game when destroyed. | |
void | PushScene (SceneType scene_type, string level) |
Add a new scene to the list of scenes. | |
void | PopScene () |
Pop the last scene in the listt off. | |
void | LoadScene () |
Load the current scene data into the game. | |
SceneNode | CreateMenuScene () |
Create a SceneNode for the main menu. | |
SceneNode | CreateDefaultLevelsMenuScene () |
Create a SceneNode for the level selector menu. | |
SceneNode | CreateLevelScene (string level) |
Create a SceneNode for a game level. | |
void | Input () |
Read and store keyboard and mouse input. | |
void | Update () |
Update the state of all GameObject components (both IComponent and ComponentScript objects). | |
void | CheckClickables () |
Check all clickable objects for click events. | |
void | UpdateGameIsRunning () |
Check whether the game should continue running. | |
void | UngroundPlayer () |
Marks the player as free falling. | |
void | CheckForLanding () |
Checks whether the player will land on an object due to gravity, and restricts its motion if so. | |
void | UpdateCollisions () |
Checks whether the player hit any enemy objects. | |
void | Render () |
Render all GameObject entities. | |
void | AdvanceFrame () |
Take one frame's worth of actions. | |
void | RunLoop () |
Run the game. | |
Public Attributes | |
SDL_Window * | mWindow = null |
The SDL window. | |
SDL_Renderer * | mRenderer = null |
The SDL renderer. | |
bool | mGameIsRunning = true |
Whether the game is running. | |
string | currentLevelName |
The name of the current level. | |
uint | max_frame_duration |
The maximum time available until the next frame must render. | |
SDL_Rect * | mCamera = null |
The camera placement and size. | |
SceneNode[] | scenes |
SceneNode | root |
All available scenes in the game. | |
SceneNode | startButtonNode |
The root of the current scene tree. | |
SceneNode | playerNode |
A pointer to the start button scene tree node if it exists in the current scene. | |
SceneNode | collidableNode |
A pointer to the player GameObject node if it exists in the current scene. | |
SceneNode | finishLineNode |
A pointer to the collection of collidable GameObjects if it exists in the current scene. | |
SceneNode | attemptNode |
A pointer to the finidh line GameObject node if it exists in the current scene. | |
AudioManager | audioManager |
A pointer to the attempt label node if it exists in the current scene. | |
string | currentScene |
The name of the current scene. | |
int | WINDOW_HEIGHT = 480 |
int | WINDOW_WIDTH = 640 |
The height of the game window. | |
Main game application.
Contains the game loop and scene structures.
|
inline |
The width of the game window.
Initialize a new game.
title | the title of the game window. |
fps | the maximum FPS allowed for the game. |
|
inline |
Take one frame's worth of actions.
Calling this function runs the game loop once.
|
inline |
Checks whether the player will land on an object due to gravity, and restricts its motion if so.
If the player will not hit the ground, take no action. Otherwise, ensure the player will not pass through.
|
inline |
|
inline |
|
inline |
|
inline |
Read and store keyboard and mouse input.
This input can be accessed by IComponent and ComponentScript objects.
|
inline |
|
inline |
Pop the last scene in the listt off.
|
inline |
Add a new scene to the list of scenes.
scene_type | the type of scene to add. |
level | the name of the scene being added. |
|
inline |
Run the game.
This is the entry point into the game. This function runs the game loop on repeat.
|
inline |
Marks the player as free falling.
|
inline |
Update the state of all GameObject components (both IComponent and ComponentScript objects).
|
inline |
Checks whether the player hit any enemy objects.
|
inline |
Check whether the game should continue running.
Updates mGameIsRunning appropriately.
AudioManager GameApplication::audioManager |
A pointer to the attempt label node if it exists in the current scene.
The AudioManager for the game.