Documentation ¶
Overview ¶
Package scene stores definitions for interacting with game loop scenes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type End ¶
End is a function returning the next scene and a SceneResult of input settings for the next scene.
type Loop ¶
type Loop func() bool
Loop is a function that returns whether or not the current scene should continue to loop.
type Map ¶
type Map struct { CurrentScene string // contains filtered or unexported fields }
A Map lets scenes be accessed via associated names.
func (*Map) Add ¶
Add adds a scene with the given name and functions to the scene map. It serves as a helper for not constructing a scene directly.
func (*Map) AddScene ¶
AddScene takes a scene struct, checks that its assigned name does not conflict with an existing name in the map, and then adds it to the map. If a conflict occurs, the scene will not be overwritten. Todo: this could change, with a function argument specifying whether or not the scene should overwrite.
func (*Map) Get ¶
Get returns the scene associated with the given name, if it exists. If it does not exist, it returns a zero value and false.
func (*Map) GetCurrent ¶
GetCurrent returns the current scene, as defined by map.CurrentScene
type Result ¶
type Result struct { NextSceneInput interface{} Transition }
A Result is a set of options for what should be passed into the next scene and how the next scene should be transitioned to.
type Scene ¶
A Scene is a set of functions defining what needs to happen when a scene starts, loops, and ends.