diff --git a/gmtk_2024/scripts/ui_actions.gd b/gmtk_2024/scripts/ui_actions.gd index 8f90d85..8744051 100644 --- a/gmtk_2024/scripts/ui_actions.gd +++ b/gmtk_2024/scripts/ui_actions.gd @@ -3,29 +3,36 @@ extends Node @export var player : CharacterBody2D; var current_selected = "none"; +var this_frame = true; @export var scale_duration: float = 0.5 var target_scale: Vector2 = Vector2(1, 1) func _process(delta: float) -> void: - if Input.is_action_just_pressed("click"): + + if Input.is_action_just_pressed("click") and this_frame: if current_selected == "scale_up": scale_up() elif current_selected == "scale_down": scale_down() elif current_selected == "mirror": mirror(); - + this_frame = true func select_up(): current_selected = "scale_up" + this_frame = false func select_down(): current_selected = "scale_down" + this_frame = false + func select_mirror(): current_selected = "mirror" + this_frame = false + func scale_up(): if player: