OnLayerUpdate
method in the engine
class.Method OnLayerUpdate:Int(layer:ftLayer)
g.gmPlay
.If g.gameMode = g.gmPlay Then
Millisecs
value. If yes, that means the game time ran out and you must show the 'game over' screen.If g.endTime <= Millisecs() Then g.ShowGameOver()
g.eng.scoreList.AddScore(g.score,"---") g.SaveHighScore()
Endif Endif Return 0 End End
Because we now act on the fact that the time ran out, we can finally play the full game. If everything builds well, you could see this:
Again, there are things that were left out of the game. For example, an option screen, or a way to remove gems, sounds, effects, and other things, too. Also, you could add some bonus gems that give you extra time. You see, the possibilities are many. Have fun digging through the code, and create YOUR version of Treasure Chest.
18.224.68.28