feat(gameover): only allow the user to switch state after the gameover sound has been played.
This commit is contained in:
parent
1b187d7412
commit
53ac3840ba
1 changed files with 6 additions and 4 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue