From 4597189f157834c80f56b12b701fd2b2a15c2798 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 8 Sep 2024 22:35:06 +0200 Subject: next commit --- Game/States/Default/StateDefault.gd | 17 +++++++++++++++++ Game/States/Default/StateDefault.tscn | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 Game/States/Default/StateDefault.gd create mode 100644 Game/States/Default/StateDefault.tscn (limited to 'Game/States/Default') diff --git a/Game/States/Default/StateDefault.gd b/Game/States/Default/StateDefault.gd new file mode 100644 index 0000000..26384c5 --- /dev/null +++ b/Game/States/Default/StateDefault.gd @@ -0,0 +1,17 @@ +class_name StateDefault +extends State + + +func _state_input(event: InputEvent) -> void: + if event.is_action_pressed("build_mode_start"): + set_state("StateBuild") + + if event.is_action_pressed("builder_tower_select"): + if not event.is_double_click() and not Input.is_action_pressed("select_multiple"): + if Tower.selected_towers: + for tower in Tower.selected_towers.duplicate(): + tower.is_selected = false + + if event.is_action_pressed("select"): + if Unit.selected_unit: + Unit.selected_unit.is_selected = false diff --git a/Game/States/Default/StateDefault.tscn b/Game/States/Default/StateDefault.tscn new file mode 100644 index 0000000..1f73d30 --- /dev/null +++ b/Game/States/Default/StateDefault.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cg16o7eqqha70"] + +[ext_resource type="Script" path="res://Game/States/Default/StateDefault.gd" id="1_e8s2t"] + +[node name="StateDefault" type="Node"] +script = ExtResource("1_e8s2t") -- cgit v1.2.3