func Set(key GameSceneKey, scene GameScene)
Set registers a GameScene with the given key.
func Switch(key GameSceneKey)
Switch changes the current scene to the scene with the given key.
func SwitchWith ¶
func SwitchWith(key GameSceneKey, withFunc func(GameScene))
SwitchWith changes the current scene to the scene with the given key. It also recieves a function which allows you to access the new scene.
GameScene is the interface that all the game scene should implement.
Draw is the function where rendering takes place.
Update is the function where game logic updates. It is invoked before Draw.
Start is the function called every time you switch to the scene.
Stop is the function called every time you exit the scene.