diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-10-09 17:20:55 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-10-09 17:20:55 +0200 |
commit | 1aac583cee47d232ef22d8c5df97b888f689ab96 (patch) | |
tree | 7ef0796e4f01272fc68d199e1b0dc1812aaad1e0 /Stages | |
parent | b96e384d8299473b14edcbf885fa914a9308d18f (diff) |
intermediate commit
Diffstat (limited to 'Stages')
-rw-r--r-- | Stages/Stage.gd | 15 |
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) |