15 lines
278 B
GDScript3
15 lines
278 B
GDScript3
|
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)
|