Compare commits
3 commits
57e57f3037
...
53ac3840ba
| Author | SHA1 | Date | |
|---|---|---|---|
| 53ac3840ba | |||
| 1b187d7412 | |||
| cb6e66bc45 |
3 changed files with 16 additions and 5 deletions
7
.editorconfig
Normal file
7
.editorconfig
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
root = true
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
[*.go]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
@ -55,7 +55,9 @@ func (sm *Manager) Stop(id SoundID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sm Manager) IsPlaying(id SoundID) bool {
|
func (sm Manager) IsPlaying(id SoundID) bool {
|
||||||
return rl.IsSoundPlaying(*sm.library.Get(id))
|
return slices.ContainsFunc(sm.active, func(e audio) bool {
|
||||||
|
return e.id == id
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pause all active sounds
|
// Pause all active sounds
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,14 @@ func (GameOver) Exit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (GameOver GameOver) Update(fsm state.Transitioner, delta float32) {
|
func (GameOver GameOver) Update(fsm state.Transitioner, delta float32) {
|
||||||
|
if !audio.IsPlaying(assets.SFX_GAME_OVER) {
|
||||||
if rl.IsKeyPressed(rl.KeyEnter) {
|
if rl.IsKeyPressed(rl.KeyEnter) {
|
||||||
fsm.Switch("gameplay")
|
fsm.Switch("gameplay")
|
||||||
} else if rl.IsKeyPressed(rl.KeyQ) {
|
} else if rl.IsKeyPressed(rl.KeyQ) {
|
||||||
fsm.Switch("menu")
|
fsm.Switch("menu")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (GameOver *GameOver) Render() {
|
func (GameOver *GameOver) Render() {
|
||||||
render.Begin(rl.Black)
|
render.Begin(rl.Black)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue