interaction wheel

cancel interaction wheel
This commit is contained in:
2024-02-28 07:12:09 -06:00
parent f87b1cfa9a
commit 50093e5937
9 changed files with 188 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
extends Node2D
class_name InteractionWheel
var interactions: Array[Interaction]
@onready var interaction_icons: Array[Node] = $Interactions.get_children()
@onready var cursor: Sprite2D = $Cursor
func initialize(interaction_location: Vector2i, interactions: Array[Interaction]) -> void:
position = Grid.grid_to_world_center(interaction_location)
self.interactions = interactions
func _ready() -> void:
for i in range(interactions.size()):
interaction_icons[i].texture = interactions[i].image
interaction_icons[i].show()
func _process(delta: float) -> void:
var selection_direction = Input.get_vector("view_left", "view_right", "view_up", "view_down")
if selection_direction:
cursor.rotation = selection_direction.angle()
cursor.show()
if Input.is_action_just_pressed("select"):
pass