struct Menu
Overview
A special scene that provides some basic game controls to the user such as starting a new game or opening a saved game.
The menu description introduces the player to your game. The starting_scene is where players will go first when starting a new game.
Defined in:
engine/menu.crConstructors
- .new(description : String, starting_scene : Scene.class)
-
.new
Provides a default initializer to make the compiler happy.
Instance Method Summary
-
#commands(state : State) : Array(Command)
Returns an ordered list of commands available to the user.
-
#persist_scene_state(state : State) : State
Overrides the normal behavior so that navigating to the menu does not interupt the user's current
Scende
location. -
#render(state : State)
Render the scene description.
Instance methods inherited from struct Scene
commands(state : State) : Array(Command)
commands,
initialize
initialize,
persist_scene_state(state : State) : State
persist_scene_state,
render(state : State)
render,
run(state : State) : Tuple(Scene, State) | Nil
run
Constructor methods inherited from struct Scene
new
new
Constructor Detail
Provides a default initializer to make the compiler happy.
Since elsewhere we are initializing instances of Scene.class
without any arguments,
the compile expects all instances of Scene
to be initialized with no arguments.
Instance Method Detail
Returns an ordered list of commands available to the user.
These commands will be displayed after the scene description produced in #render
Overrides the normal behavior so that navigating to the menu does not interupt the user's current Scende
location.