summaryrefslogtreecommitdiff
path: root/Stages/Stage.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-10-20 12:09:48 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-10-20 12:09:48 +0200
commit6db6465d1b938ec494cd66c9984bff5cc14bde11 (patch)
tree9533b364e3e40ff813ef263ab05bd69ac31f8777 /Stages/Stage.gd
parente82990eeafdf0be5d42d8aaa9b7fb6091e0d8435 (diff)
next commit
Diffstat (limited to 'Stages/Stage.gd')
-rw-r--r--Stages/Stage.gd18
1 files changed, 11 insertions, 7 deletions
diff --git a/Stages/Stage.gd b/Stages/Stage.gd
index cdffca9..a3608ee 100644
--- a/Stages/Stage.gd
+++ b/Stages/Stage.gd
@@ -4,6 +4,7 @@ extends Node
signal path_grid_changed
+static var maps: Array[TileMapLayer]
static var map: TileMapLayer
static var path_grid: AStarGrid2D
static var last_solid_set_points: Array[Vector2]
@@ -14,7 +15,8 @@ func _init() -> void:
func _ready() -> void:
- map = get_node("%Map")
+ maps = [get_node("%Map")]
+ map = maps[0]
path_grid = AStarGrid2D.new()
path_grid.region = map.get_used_rect()
@@ -26,10 +28,12 @@ func _ready() -> void:
assert(get_node("%StateManager"), "StateManager missing")
assert(get_node("%StateManager").get_children().size() > 0, "StateManager has no States")
- for cell in map.get_used_cells():
- var tile_data = map.get_cell_tile_data(cell)
- if tile_data.get_collision_polygons_count(0) > 0:
- path_grid.set_point_solid(cell, true)
+ @warning_ignore("shadowed_variable")
+ for map in maps:
+ for cell in map.get_used_cells():
+ var tile_data = map.get_cell_tile_data(cell)
+ if tile_data.get_collision_polygons_count(0) > 0:
+ path_grid.set_point_solid(cell, true)
func place_tower(_remote_data: Dictionary) -> void:
@@ -81,8 +85,8 @@ func _spawn_unit(parent: Node2D, unit: Unit):
parent.add_child(unit, true)
-func transform_players(script: Script):
- for player in Network.get_node("%Players").get_children():
+func set_player_script(script: Script):
+ for player in Network.get_players():
var previous_values := {}
var property_list = player.get_script().get_script_property_list().filter(func(item):
return item.type != 0