mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-17 20:41:03 +01:00
another try, but fails as well + added todos
This commit is contained in:
24
game.go
24
game.go
@@ -53,22 +53,26 @@ func (game *Game) Update() error {
|
||||
scene := game.GetCurrentScene()
|
||||
scene.Update()
|
||||
|
||||
next := scene.GetNext()
|
||||
|
||||
if next != game.CurrentScene {
|
||||
// make sure we stay on the selected scene
|
||||
scene.ResetNext()
|
||||
|
||||
// finally switch
|
||||
game.CurrentScene = next
|
||||
}
|
||||
|
||||
fmt.Printf("Clear Screen: %t\n", ebiten.IsScreenClearedEveryFrame())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (game *Game) Draw(screen *ebiten.Image) {
|
||||
var nextscene Scene
|
||||
scene := game.GetCurrentScene()
|
||||
|
||||
next := scene.GetNext()
|
||||
if next != game.CurrentScene {
|
||||
scene.ResetNext()
|
||||
game.CurrentScene = next
|
||||
nextscene = game.GetCurrentScene()
|
||||
ebiten.SetScreenClearedEveryFrame(nextscene.Clearscreen())
|
||||
}
|
||||
|
||||
scene.Draw(screen)
|
||||
|
||||
if nextscene != nil {
|
||||
nextscene.Draw(screen)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user