summaryrefslogtreecommitdiff
path: root/Stages
diff options
context:
space:
mode:
Diffstat (limited to 'Stages')
-rw-r--r--Stages/Stage.gd15
1 files changed, 8 insertions, 7 deletions
diff --git a/Stages/Stage.gd b/Stages/Stage.gd
index 963ee46..1f73a09 100644
--- a/Stages/Stage.gd
+++ b/Stages/Stage.gd
@@ -25,10 +25,10 @@ func _ready() -> void:
path_grid.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE
path_grid.update()
- #towers = get_node("%Towers") # y-sort?
- towers = self
- #units = get_node("%Units") # y-sort?
- units = self
+ towers = get_node("%Towers") # y-sort?
+ #towers = self
+ units = get_node("%Units") # y-sort?
+ #units = self
spawn = get_node("%Spawn")
hud = get_node("%HUD")
@@ -39,10 +39,11 @@ func _ready() -> void:
func place_tower(tower: Tower, position: Vector2):
var player: Player = Network.players[tower.owner_id]
tower.get_node("Sprite2D").modulate = player.get_color()
+ tower.get_node("ComponentsAnchor").modulate = player.get_color()
tower.global_position = position
fill_tower_region(tower, true)
- towers.add_child(tower)
+ towers.add_child(tower, true)
func destroy_tower(tower: Tower):
@@ -73,8 +74,8 @@ func fill_tower_region(tower: Tower, solid = true):
@warning_ignore("shadowed_variable")
-func spawn_unit(unit: Unit, _spawn: Spawn):
+func spawn_unit(unit: Unit):#, _spawn: Spawn):
var player: Player = Network.players[unit.owner_id]
unit.get_node("Sprite2D").modulate = player.get_color()
- units.add_child(unit)
+ units.add_child(unit, true)