added stop timer to add a delay after level end
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"openquell/components"
|
||||
. "openquell/components"
|
||||
"openquell/config"
|
||||
. "openquell/config"
|
||||
"openquell/observers"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
@@ -70,10 +71,11 @@ func (system *CollectibleSystem) Update() {
|
||||
}
|
||||
|
||||
if numcollectibles == 0 {
|
||||
// winner, winner, chicken dinner!
|
||||
game := observers.GetGameObserver(system.World)
|
||||
game.Score++
|
||||
game.CurrentLevel++
|
||||
// winner, winner, chicken dinner!
|
||||
timer := observers.GetGameObserver(system.World).StopTimer
|
||||
if !timer.Running {
|
||||
timer.Start(LEVEL_END_WAIT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user