Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
Created February 16, 2018 19:32
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 LarsBergqvist/dfd45ec5374e7468e66e8210e2b782c2 to your computer and use it in GitHub Desktop.
Save LarsBergqvist/dfd45ec5374e7468e66e8210e2b782c2 to your computer and use it in GitHub Desktop.
Godot: Star scene that sends a signal when colliding with a player object and then removes itself from the game
extends Area2D
signal star_taken
func _on_Area2D_body_entered( body ):
if (not body.get("is_player") == null):
$CollisionPolygon2D.disabled = true
hide()
emit_signal("star_taken")
queue_free()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment