nsnake
Classic snake game for the terminal
|
#include <GameStateMainMenu.hpp>
Public Member Functions | |
void | load (int stack=0) |
Where every state initializes it's resources. | |
int | unload () |
Gets called when we're leaving this menu. | |
GameState::StateCode | update () |
Called every frame, where states calculate everything that can change. | |
void | draw () |
Called every frame, where states draw stuff on screen. | |
![]() |
Friends | |
class | LayoutMainMenu |
Additional Inherited Members | |
![]() | |
enum | StateCode { QUIT , CONTINUE , MAIN_MENU , GAME_START , GAME_OVER } |
All possible transitions between states. More... | |
The Main Menu.
Definition at line 12 of file GameStateMainMenu.hpp.
GameStateMainMenu::GameStateMainMenu | ( | ) |
Definition at line 57 of file GameStateMainMenu.cpp.
|
inlinevirtual |
Definition at line 18 of file GameStateMainMenu.hpp.
|
virtual |
Called every frame, where states draw stuff on screen.
Implements GameState.
Definition at line 320 of file GameStateMainMenu.cpp.
|
virtual |
Where every state initializes it's resources.
The stack is the previous state's returned value from unload(), allowing a state to communicate with the next one.
Implements GameState.
Definition at line 71 of file GameStateMainMenu.cpp.
|
virtual |
Gets called when we're leaving this menu.
It saves all the menu settings (for example, game speed, board size, and such)
Implements GameState.
Definition at line 86 of file GameStateMainMenu.cpp.
|
virtual |
Called every frame, where states calculate everything that can change.
The returned value will be checked by the StateManager to see if we must change the current state - if so, which one should we go next.
Implements GameState.
Definition at line 101 of file GameStateMainMenu.cpp.
|
friend |
Definition at line 14 of file GameStateMainMenu.hpp.