From 1aac583cee47d232ef22d8c5df97b888f689ab96 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 9 Oct 2024 17:20:55 +0200 Subject: intermediate commit --- Stages/Stage.gd | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Stages') 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) -- cgit v1.2.3