summaryrefslogtreecommitdiff
path: root/Game/States/Default
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-09-08 22:35:06 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-09-08 22:35:06 +0200
commit4597189f157834c80f56b12b701fd2b2a15c2798 (patch)
treef522e9a58ec756dc27306781da99e828b195c549 /Game/States/Default
parent7d7d845e76f78a87cf87c9464d700e52cd88ce6f (diff)
next commit
Diffstat (limited to 'Game/States/Default')
-rw-r--r--Game/States/Default/StateDefault.gd17
-rw-r--r--Game/States/Default/StateDefault.tscn6
2 files changed, 23 insertions, 0 deletions
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")