Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
10.4 Call the GameReset method when the ENTER key is pressed
Method OnUpdate()
Local time_delta:Float = Float(engine.CalcDeltaTime())/60.0
If (player.box.GetText() = "DESTROYED" And play_scene.isActive)
play_scene.SetActive(False)
game_over_scene.SetActive(True)
' Manage the visibility of the game over scene
game_over_scene.SetVisible(True)
game_over_scene.SetAlpha(1.0)
' Reset the game if the player hits ENTER during game over
Else If (game_over_scene.isActive)
If (KeyDown(KEY_ENTER))
ResetGame()
End
Else
If ((Millisecs() - Self.last_enemy_time) > Self.next_enemy_interval)
CreateEnemy()
Self.last_enemy_time = Millisecs()
End
' ........
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment