Flopsy/objects/key/key.gd
2022-07-18 12:58:38 +02:00

14 lines
278 B
GDScript

extends StaticBody2D
func _ready():
$Sprite/AnimationPlayer.play("default")
func _on_PlayerCollision(body):
if visible:
GlobalState.keys['yellow'] = true
$SoundCollected.play()
hide()
func _on_SoundCollected_finished():
queue_free()
get_parent().remove_child(self)