added stop timer to add a delay after level end

This commit is contained in:
2024-02-13 18:15:52 +01:00
parent 5a288035b3
commit c9f8783521
6 changed files with 48 additions and 19 deletions

View File

@@ -1,6 +1,8 @@
package observers
import (
"openquell/components"
"github.com/mlange-42/arche/ecs"
"github.com/mlange-42/arche/generic"
)
@@ -8,11 +10,14 @@ import (
// Used for global game state
type GameObserver struct {
CurrentLevel, Width, Height, Cellsize, Score int
StopTimer *components.Timer
Lost bool // set to true if player is struck or something, by default: win!
}
func NewGameObserver(world *ecs.World, startlevel, width, height, cellsize int) *GameObserver {
observer := &GameObserver{
CurrentLevel: startlevel,
StopTimer: &components.Timer{},
Width: width,
Height: height,
Cellsize: cellsize,