The OnLayerUpdate
method has the layer as a parameter.
1. Check if the layer is equal to
g.layerGame
.Method OnLayerUpdate:Int(layer:ftLayer) If layer = g.layerGame Then
2. Check if
g.lifes
are equal to or below0
.If g.lifes <= 0 Then 'GameOVER
3. Set
gameMode
tog.gmGameOver
.g.gameMode = g.gmGameOver
4. Activate the layer
g.layerTitle
.g.layerTitle.SetActive(True)
5. Add
g.score
to the high score list of the engine.g.eng.scoreList.AddScore(g.score,"---")
6. Deactivate the player object.
g.player.SetActive(False)
7. Remove all particle objects and all remaining comets using their ID values.
g.layerFX.RemoveAllObjects() layer.RemoveAllObjectsByID(g.grpComet)
8. Save the high score list via
g.SaveHighScore
. ThenReturn
from the method.g.SaveHighScore() Return 0 Endif
9. Check if all comets are destroyed and
g.gameMode
still equalsg.gmPlay
.'All comets destroyed-> next level If g.cometCount <= 0 And g.gameMode = g.gmPlay Then
10. Activate...