Flopsy/objects/key/key.gd

15 lines
278 B
GDScript3
Raw Normal View History

2022-07-18 12:58:38 +02:00
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)