summaryrefslogtreecommitdiff
path: root/Stages/Stage.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Stages/Stage.gd')
-rw-r--r--Stages/Stage.gd17
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