2024-04-28 08:52:21 +00:00
|
|
|
extends BetterCharacterBody2D
|
2024-04-21 22:09:04 +00:00
|
|
|
class_name Monocle
|
|
|
|
|
|
|
|
|
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
|
2024-04-29 01:20:27 +00:00
|
|
|
z_index = Enums.ZIndex.EntityAir
|
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
|
2024-04-29 01:20:27 +00:00
|
|
|
z_index = Enums.ZIndex.EntityGround
|
2024-04-24 02:16:09 +00:00
|
|
|
animator.play(&"RESET")
|
2024-04-29 01:20:27 +00:00
|
|
|
|
|
|
|
func _on_trapped() -> void:
|
|
|
|
z_index = Enums.ZIndex.EntitySacrifice
|
|
|
|
|
|
|
|
func _on_freed() -> void:
|
|
|
|
z_index = Enums.ZIndex.EntityGround
|