diff --git a/manager.go b/manager.go index 1c722a8..8bcb83b 100644 --- a/manager.go +++ b/manager.go @@ -47,18 +47,16 @@ func NewManager() Manager { } } -// ebitengine update proxy -// manages scene transition and exists, then calls scene's update method +// ebitengine update proxy on behalf of current scene func (m *Manager) Update() error { if m.currentScene == nil { return nil } - //call the current scene's update method return m.currentScene.Update() - } +// shutdown application func (m *Manager) Quit() { os.Exit(0) } @@ -114,10 +112,12 @@ func (m *Manager) SetCurrentScene(sceneId uint) { m.currentScene = m.scenes[sceneId] } +// handle scene transition func (m *Manager) TransitionScene() { m.SetCurrentScene(m.nextSceneId) } +// set new sceneId as the successor func (m *Manager) SetNextScene(sceneId uint) { m.nextSceneId = sceneId }