OnUpdate
method and add a Select
statement with the gameMode
as a parameter.Method OnUpdate:Int() Select gameMode
gmPlay
, update the engine with the deltaTime
divided by 60
as a speed parameter.Case gmPlay eng.Update(Float(UpdateGameTime())/60.0)
layerGame
layer.eng.CollisionCheck(layerGame)
UpdateInfoText()
gmMenu
or gmGameOver
.Case gmMenu, gmGameOver
If the P key was hit, then start a new game.
If KeyHit(KEY_P) Then StartNewGame() Endif
If the H key was hit, then show the high score list.
If KeyHit(KEY_H) Then ShowScoreList() Endif
gmScoreList
.Case gmScoreList
If the P key was hit, start a new game.
If KeyHit(KEY_P) Then StartNewGame() Endif
Select
statement.End Return 0 End