mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-17 04:30:57 +01:00
nope, it's a hopeless mess
This commit is contained in:
@@ -48,8 +48,10 @@ func (game *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func (game *Game) Update() error {
|
||||
currentscene := game.GetCurrentScene()
|
||||
|
||||
for _, scene := range game.Scenes {
|
||||
if scene.IsPrimary() {
|
||||
if scene.IsPrimary() || scene == currentscene {
|
||||
if quit := scene.Update(); quit != nil {
|
||||
return quit
|
||||
}
|
||||
@@ -57,12 +59,11 @@ func (game *Game) Update() error {
|
||||
}
|
||||
}
|
||||
|
||||
scene := game.GetCurrentScene()
|
||||
next := scene.GetNext()
|
||||
next := currentscene.GetNext()
|
||||
|
||||
if next != game.CurrentScene {
|
||||
game.Scenes[next].SetPrevious(game.CurrentScene)
|
||||
scene.ResetNext()
|
||||
currentscene.ResetNext()
|
||||
game.CurrentScene = next
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user