added mp3 functionality

fixed bug where last move on correct square didn't register
This commit is contained in:
MrDonuts
2023-11-28 21:11:07 -05:00
parent 7af60685db
commit 6cf4a0143d
7 changed files with 48 additions and 5 deletions

View File

@@ -49,9 +49,7 @@ func (s *PlayLevelState) Update() {
}
geom.MainPlayer.Update()
if geom.CurrentEnergy == 0 {
SM.Transition("game over")
}
if geom.GameGrid.ColouredSquaresRemaining() == 0 {
//go to next level
newRowSize := min(rand.Intn(5+geom.CurrentLevel)+2, geom.MaxGridDimension)
@@ -60,6 +58,12 @@ func (s *PlayLevelState) Update() {
SM.Transition("load")
assets.SFXLibrary["newLevel"].Rewind()
assets.SFXLibrary["newLevel"].Play()
return
}
if geom.CurrentEnergy == 0 {
SM.Transition("game over")
return
}
}