Skip to content

Instantly share code, notes, and snippets.

@codetravis
Created January 2, 2017 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codetravis/003b852ff7983508a3dd44f26d0b08e4 to your computer and use it in GitHub Desktop.
Save codetravis/003b852ff7983508a3dd44f26d0b08e4 to your computer and use it in GitHub Desktop.
10.2 Create a game reset method
' Game class
' Method to Reset the game
Method ResetGame()
game_over_scene.SetActive(False)
game_over_scene.SetVisible(False)
play_scene.SetActive(True)
play_scene.SetAlpha(1.0)
Self.player.box.Remove()
CreatePlayer()
For Local enemy:Character = Eachin Self.enemies
enemy.box.Remove()
Self.enemies.RemoveFirst(enemy)
End
For Local projectile:Projectile = Eachin Self.projectiles
projectile.box.Remove()
Self.projectiles.RemoveFirst(projectile)
End
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment