Dauphine  0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
Public Member Functions | Private Types | Private Attributes | List of all members
GStateMenu Class Reference

The state for the initial menu screen. More...

#include <GStateMenu.h>

Public Member Functions

 GStateMenu ()
 The constructor. More...
 
virtual ~GStateMenu ()
 The destructor.
 
virtual void load ()
 Loads the level. More...
 
virtual void update (const double dt_)
 Updates the objects within the StateGame. More...
 
virtual void unload ()
 Unloads everything that was loaded. More...
 
virtual void render ()
 Renders the state. More...
 
void handleSelectorMenu ()
 
- Public Member Functions inherited from StateGame
virtual ~StateGame ()
 The destructor.
 
void addEntity (Entity *const entity)
 Adds an entity to the vector.
 
void cleanEntities ()
 Deletes all the entities inside the vector.
 

Private Types

enum  Selection : uint8_t {
  NEWGAME = 0, CONTINUE, OPTIONS, CREDITS,
  TOTAL
}
 

Private Attributes

SpritemenuImage
 The image shown on the menu. More...
 
SpritemenuSelector
 The selector shown on the menu. More...
 
double passedTime
 The time already elapsed since the beggining of the menu. More...
 
int currentSelection
 
int selectorXPositionLeft [Selection::TOTAL]
 The X position of the left selector. More...
 
int selectorYPositionLeft [Selection::TOTAL]
 The Y position of the left selector. More...
 
int selectorXPositionRight [Selection::TOTAL]
 The X position of the left selector. More...
 
int selectorYPositionRight [Selection::TOTAL]
 The Y position of the left selector. More...
 

Additional Inherited Members

- Protected Attributes inherited from StateGame
std::vector< Entity * > entities
 List of all the entities in the state. More...
 

Detailed Description

The state for the initial menu screen.

Game state that will contain the main menu.

Constructor & Destructor Documentation

GStateMenu::GStateMenu ( )

The constructor.

Initializes all the attributes.

Member Function Documentation

void GStateMenu::load ( )
virtual

Loads the level.

From the menu.lua script, loads all the necessary objects.

Implements StateGame.

void GStateMenu::render ( )
virtual

Renders the state.

Always renders on 0,0 position.

See Also
Sprite::render

Implements StateGame.

void GStateMenu::unload ( )
virtual

Unloads everything that was loaded.

See Also
GStateMenu::load

Implements StateGame.

void GStateMenu::update ( const double  dt_)
virtual

Updates the objects within the StateGame.

Parameters
dt_: Delta time. Time elapsed between one frame and the other.

Implements StateGame.

Member Data Documentation

Sprite* GStateMenu::menuImage
private

The image shown on the menu.

Sprite* GStateMenu::menuSelector
private

The selector shown on the menu.

double GStateMenu::passedTime
private

The time already elapsed since the beggining of the menu.

int GStateMenu::selectorXPositionLeft[Selection::TOTAL]
private

The X position of the left selector.

int GStateMenu::selectorXPositionRight[Selection::TOTAL]
private

The X position of the left selector.

int GStateMenu::selectorYPositionLeft[Selection::TOTAL]
private

The Y position of the left selector.

int GStateMenu::selectorYPositionRight[Selection::TOTAL]
private

The Y position of the left selector.


The documentation for this class was generated from the following files: