diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-09-08 22:35:06 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-09-08 22:35:06 +0200 |
commit | 4597189f157834c80f56b12b701fd2b2a15c2798 (patch) | |
tree | f522e9a58ec756dc27306781da99e828b195c549 /Game/States/Default | |
parent | 7d7d845e76f78a87cf87c9464d700e52cd88ce6f (diff) |
next commit
Diffstat (limited to 'Game/States/Default')
-rw-r--r-- | Game/States/Default/StateDefault.gd | 17 | ||||
-rw-r--r-- | Game/States/Default/StateDefault.tscn | 6 |
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") |