|
Arcade Shooter
|
Base class for all games. Provides graphics initialization, game loop, and rendering code. Inherit from this class when creating your own game. More...
#include <Game.h>
Public Member Functions | |
| virtual int | Run () |
| Runs the game instance. More... | |
| virtual std::string | GetName () const =0 |
| Gets the name of the game. More... | |
| virtual ResourceManager * | GetResourceManager () const |
| Gets a pointer to the ResourceManager, for loading and managing resources. More... | |
| virtual ScreenManager * | GetScreenManager () const |
| Gets a pointer to the ScreenManager, for managing game screens. More... | |
| virtual ParticleManager * | GetParticleManager () const |
| Gets a pointer to the ParticleManager, for managing particle effects. More... | |
| virtual SpriteBatch * | GetSpriteBatch () const |
| Gets a pointer to the SpriteBatch, for rendering. More... | |
| virtual void | LoadContent (ResourceManager *pResourceManager) |
| Called when resources need to be loaded. More... | |
| virtual void | UnloadContent () |
| Called when resources need to be unloaded. Override this method to unload any game-specific resources. | |
| virtual void | Update (const GameTime *pGameTime) |
| Called when the game has determined that game logic needs to be processed. More... | |
| virtual void | Draw (SpriteBatch *pSpriteBatch) |
| Called when the game determines it is time to draw a frame. More... | |
| virtual void | Quit () |
| Quits the game. | |
Static Public Member Functions | |
| static int | GetScreenWidth () |
| Gets the screen width in pixels. More... | |
| static int | GetScreenHeight () |
| Gets the screen width in pixels. More... | |
| static Vector2 | GetScreenCenter () |
| Gets the screen size in pixels. More... | |
Protected Member Functions | |
| virtual void | SetResourceDirectory (const std::string &path) |
| Sets the location of the directory where the game's resources are stored. More... | |
| virtual void | SetTargetFramesPerSecond (int const frames) |
| Sets the target frame rate for the game. More... | |
| virtual void | SetFrameCounterFont (Font *pFont) |
| Sets the font for the frame counter. More... | |
| virtual void | InitializeScreenManager () |
| Initializes the game's ScreenManager. | |
| virtual void | InitializeParticleManager () |
| Initializes the game's ParticleManager. | |
| virtual void | DisplayFrameRate () |
| Displays the game's current frame rate. | |
| virtual void | SetFullScreen (bool isFullScreen) |
| Sets the game to display in fullscreen mode. | |
| virtual void | SetOpenGLFlag () |
| Sets the OpenGL flag, which forces OpenGL rendering. | |
| virtual void | ResetGameTime () |
| Resets the game's timing values. | |
Static Protected Member Functions | |
| static void | SetScreenResolution (int width, int height) |
| Sets the screen resolution. More... | |
| static void | SetWindowTitle (std::string title) |
| Sets the title of the game window. More... | |
Base class for all games. Provides graphics initialization, game loop, and rendering code. Inherit from this class when creating your own game.
|
virtual |
Called when the game determines it is time to draw a frame.
| pSpriteBatch | The game's sprite batch, used for rendering. |
|
pure virtual |
|
inlinevirtual |
Gets a pointer to the ParticleManager, for managing particle effects.
|
inlinevirtual |
Gets a pointer to the ResourceManager, for loading and managing resources.
|
inlinestatic |
Gets the screen size in pixels.
|
inlinestatic |
Gets the screen width in pixels.
|
inlinevirtual |
Gets a pointer to the ScreenManager, for managing game screens.
|
inlinestatic |
Gets the screen width in pixels.
|
inlinevirtual |
Gets a pointer to the SpriteBatch, for rendering.
|
inlinevirtual |
Called when resources need to be loaded.
| pResourceManager | The game's resource manager, used for loading and managing game resources. |
|
virtual |
Runs the game instance.
|
inlineprotectedvirtual |
Sets the font for the frame counter.
| pFont | A pointer to the font. |
|
inlineprotectedvirtual |
Sets the location of the directory where the game's resources are stored.
| path | The relative path to the resource directory. |
|
inlinestaticprotected |
Sets the screen resolution.
| width | The width of the screen in pixels. |
| height | The height of the screen in pixels. |
|
protectedvirtual |
Sets the target frame rate for the game.
| frames | The target number of frames per second. |
|
inlinestaticprotected |
Sets the title of the game window.
| title | The window title. |
|
virtual |
Called when the game has determined that game logic needs to be processed.
| pGameTime | Timing values including time since last update. |
1.8.13