From c8f674ac6fa0914d9e448d2929f2385cdad80d60 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 5 Nov 2024 11:34:49 +0100 Subject: next commit --- Stages/Stage.gd | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Stages/Stage.gd') diff --git a/Stages/Stage.gd b/Stages/Stage.gd index 3d3eceb..5b218d6 100644 --- a/Stages/Stage.gd +++ b/Stages/Stage.gd @@ -4,7 +4,7 @@ extends Node signal path_grid_changed -static var maps: Array[TileMapLayer] +static var maps: Array[Node] static var map: TileMapLayer static var path_grid: AStarGrid2D static var last_solid_set_points: Array[Vector2] @@ -15,7 +15,7 @@ func _init() -> void: func _ready() -> void: - maps = [get_node("%Map")] + maps = find_children("*", "TileMapLayer") map = maps[0] path_grid = AStarGrid2D.new() @@ -41,7 +41,7 @@ func place_tower(_remote_data: Dictionary) -> void: func _place_tower(parent: Node2D, tower: Tower): var player: Player = Network.get_player(tower.owner_id) - tower.get_node("Sprite2D").modulate = player.get_color() + tower.get_node("AnimatedSprite2D").modulate = player.get_color() tower.get_node("ComponentsAnchor").modulate = player.get_color() fill_tower_region(tower, true) @@ -87,7 +87,7 @@ func spawn_unit(_remote_data: Dictionary) -> void: func _spawn_unit(parent: Node2D, unit: Unit): var player: Player = Network.get_player(unit.owner_id) - unit.get_node("Sprite2D").modulate = player.get_color() + unit.sprite.modulate = player.get_color() parent.add_child(unit, true) @@ -104,3 +104,12 @@ func set_player_script(script: Script): player.set_script(script) for property in previous_values: player[property] = previous_values[property] + + +## get spawn node +func get_spawn(): + pass + +## get target after spawn to overwrite default spawn target +func get_overwrite_target(): + pass -- cgit v1.2.3