diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-05 11:34:49 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-05 11:34:49 +0100 |
commit | c8f674ac6fa0914d9e448d2929f2385cdad80d60 (patch) | |
tree | a913454c42bb520aa644f4e2dcf0d42ba11c83de /Stages/Stage.gd | |
parent | 84365b6f901a9c0251a9f724a8d9f81a3787e97d (diff) |
next commit
Diffstat (limited to 'Stages/Stage.gd')
-rw-r--r-- | Stages/Stage.gd | 17 |
1 files changed, 13 insertions, 4 deletions
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 |