23 lines
478 B
GDScript
23 lines
478 B
GDScript
class_name ArrowGirl extends Area2D
|
|
|
|
@onready var _sprite = $AnimatedSprite2D
|
|
|
|
#boilerplate
|
|
func _ready():
|
|
_sprite.play("idle", 1)
|
|
|
|
#animation stuff
|
|
func _on_animation_finished() -> void:
|
|
if randf() < 0.2:
|
|
_sprite.play("idle_glance", 2)
|
|
else:
|
|
_sprite.play("idle", 2)
|
|
|
|
func _on_body_entered(body) -> void:
|
|
if body is BoxBoy:
|
|
%DialogController.set_dialog("Hello flowers!", 0.2)
|
|
|
|
func _on_body_exited(body) -> void:
|
|
if body is BoxBoy:
|
|
%DialogController.set_dialog("")
|