Files
aarpg/player/scripts/player_interactions_host.gd
Andriy Yednarovych e877c5f058 init
2026-02-22 19:26:26 +01:00

20 lines
432 B
GDScript

class_name PlayerInteractionsHost extends Node2D
@onready var player: Player = $".."
func _ready() -> void:
player.direction_change.connect(update_direction)
func update_direction(new_direction: Vector2) -> void:
match new_direction:
Vector2.DOWN:
rotation_degrees = 0
Vector2.UP:
rotation_degrees = 180
Vector2.LEFT:
rotation_degrees = 90
Vector2.RIGHT:
rotation_degrees = 270
_:
rotation_degrees = 0