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