summaryrefslogtreecommitdiff
path: root/Game
diff options
context:
space:
mode:
Diffstat (limited to 'Game')
-rw-r--r--Game/Client.gd17
-rw-r--r--Game/Selection/selection_rectangle.gd6
2 files changed, 15 insertions, 8 deletions
diff --git a/Game/Client.gd b/Game/Client.gd
index 98a8e6c..f4fd1e6 100644
--- a/Game/Client.gd
+++ b/Game/Client.gd
@@ -6,6 +6,8 @@ signal stage_state_changed(state: State)
@warning_ignore("unused_signal")
signal placed_tower(tower: Tower)
+signal multi_select_finished
+
var state: State :
set(value):
@@ -35,13 +37,13 @@ func place_tower(tower: Tower):
tower.owner_id = network_id
tower.name = "Tower@" + str(network_id) + "@" + str(Time.get_ticks_usec())
- tower.attack_range = [
- current_stage.map.tile_set.tile_size.x * 2,
- current_stage.map.tile_set.tile_size.x * 3,
- current_stage.map.tile_set.tile_size.x * 4,
- ].pick_random()
- tower.attack_power = [1, 2, 3, 4].pick_random()
- tower.attack_speed = [1, 2, 3, 4].pick_random()
+ #tower.attack_range = [
+ #current_stage.map.tile_set.tile_size.x * 2,
+ #current_stage.map.tile_set.tile_size.x * 3,
+ #current_stage.map.tile_set.tile_size.x * 4,
+ #].pick_random()
+ #tower.attack_power = [1, 2, 3, 4].pick_random()
+ #tower.attack_speed = [1, 2, 3, 4].pick_random()
current_stage.place_tower.rpc(inst_to_dict(tower.to_network_data()))
@@ -69,6 +71,7 @@ func multi_select(layer: int):
selection_area.select.connect(func(nodes):
for node in nodes:
Client.select_tower(node)
+ multi_select_finished.emit()
)
get_tree().current_scene.add_child(selection_area)
diff --git a/Game/Selection/selection_rectangle.gd b/Game/Selection/selection_rectangle.gd
index 944372d..40619ba 100644
--- a/Game/Selection/selection_rectangle.gd
+++ b/Game/Selection/selection_rectangle.gd
@@ -30,11 +30,15 @@ func _process(_delta: float) -> void:
queue_redraw()
if is_active and Input.is_action_just_released("select"):
- for area in get_overlapping_areas():
+ var areas = get_overlapping_areas()
+ for area in areas:
if "is_selected" in area.get_parent():
if area.get_parent().owner_id == multiplayer.get_unique_id():
area.get_parent().is_selected = true
+ if not areas.is_empty():
+ Client.multi_select_finished.emit()
+
size = Vector2.ZERO
queue_redraw()