2024-04-28 08:52:21 +00:00
|
|
|
extends BetterCharacterBody2D
|
2024-04-21 22:09:04 +00:00
|
|
|
class_name TopHat
|
|
|
|
|
|
|
|
|
2024-04-24 02:16:09 +00:00
|
|
|
@onready var animator: AnimationPlayer = %"Animator"
|
|
|
|
|
|
|
|
|
2024-04-21 22:09:04 +00:00
|
|
|
func _on_move(movement: Vector2) -> void:
|
2024-04-28 08:52:21 +00:00
|
|
|
better_move_and_collide(movement)
|
2024-04-21 22:56:35 +00:00
|
|
|
|
|
|
|
func _on_dragged(_cursor: Cursor) -> void:
|
|
|
|
collision_layer = 16
|
|
|
|
collision_mask = 18
|
|
|
|
z_index = 1
|
2024-04-24 02:16:09 +00:00
|
|
|
animator.play(&"drag_start")
|
2024-04-21 22:56:35 +00:00
|
|
|
|
|
|
|
func _on_fallen() -> void:
|
|
|
|
collision_layer = 8
|
|
|
|
collision_mask = 14
|
|
|
|
z_index = 0
|
2024-04-24 02:16:09 +00:00
|
|
|
animator.play(&"RESET")
|