1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00
hella-farm/entities/chupacabra.gd

36 lines
904 B
GDScript3
Raw Normal View History

2024-05-02 23:37:20 +00:00
extends Entity
2024-04-24 03:26:50 +00:00
class_name Chupacabra
@export var skitter_directions: Array[Vector2] = []
2024-04-30 02:38:27 +00:00
@onready var movement_wander: MoveStraight = %"MovementWander"
@onready var movement_wander_tp: TargetPicker = movement_wander.get_node("TrackerMeat/TargetPicker")
2024-04-24 03:26:50 +00:00
func _on_dragged(_cursor: Cursor) -> void:
2024-05-02 23:37:20 +00:00
set_flying()
2024-04-24 03:26:50 +00:00
animator.play(&"drag_start")
func _on_fallen() -> void:
2024-05-02 23:37:20 +00:00
set_grounded()
2024-04-24 03:26:50 +00:00
animator.play(&"RESET")
2024-04-29 01:20:27 +00:00
func _on_trapped() -> void:
2024-05-02 23:37:20 +00:00
set_trapped()
2024-04-29 01:20:27 +00:00
func _on_freed() -> void:
2024-05-02 23:37:20 +00:00
set_grounded()
2024-04-30 02:38:27 +00:00
func _on_wander_enabled() -> void:
if movement_wander_tp.target:
movement_wander.steer_direction_towards(movement_wander_tp.target)
else:
movement_wander.randomize_direction()
2024-05-02 23:37:20 +00:00
func _on_gold_spawner_spawned(entity:Node2D) -> void:
entity.get_node("MoveStraight").speed = 25
entity.get_node("MoveStraight").randomize_direction()
entity.get_node("MoveStraight/Priority").priority_alternative()