1
0
Fork 0

feat(gameover): only allow the user to switch state after the gameover sound has been played.

This commit is contained in:
Henrik Hautakoski 2025-09-26 12:09:25 +02:00
parent 1b187d7412
commit 53ac3840ba

View file

@ -19,10 +19,12 @@ func (GameOver) Exit() {
}
func (GameOver GameOver) Update(fsm state.Transitioner, delta float32) {
if rl.IsKeyPressed(rl.KeyEnter) {
fsm.Switch("gameplay")
} else if rl.IsKeyPressed(rl.KeyQ) {
fsm.Switch("menu")
if !audio.IsPlaying(assets.SFX_GAME_OVER) {
if rl.IsKeyPressed(rl.KeyEnter) {
fsm.Switch("gameplay")
} else if rl.IsKeyPressed(rl.KeyQ) {
fsm.Switch("menu")
}
}
}