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. More... | |
int | unload () |
Gets called when we're leaving this menu. More... | |
GameState::StateCode | update () |
Called every frame, where states calculate everything that can change. More... | |
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.
|
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.