Comment updates. Sue me.

This commit is contained in:
2023-08-23 02:05:32 -04:00
parent 67e9399ad2
commit fbfe87137e

View File

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