diff options
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") |