added mp3 functionality
fixed bug where last move on correct square didn't register
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user