fixed building walls and moving cassettes around

This commit is contained in:
2026-02-11 09:49:03 +11:00
parent efd6414dfb
commit 78beaca893
5 changed files with 21 additions and 39 deletions

View File

@@ -116,6 +116,7 @@ func spawn_level(scene: PackedScene) -> void:
level = scene.instantiate() as Level
var flow_field: FlowField = FlowField.new()
level.flow_field = flow_field
level.name = "level"
level.add_child(flow_field)
flow_field.data = FlowFieldTool.load_flow_field_from_disc(level_config.zone.flow_field_data_path)
level.load_flow_field()

View File

@@ -49,13 +49,16 @@ func disable_path_tower_frames() -> void:
tower_frames[node].visible = false
func set_wall(point: FlowNodeData, caller_id: int) -> void:
func set_wall(node_id: int, caller_id: int) -> void:
var point: FlowNodeData
for node: FlowNodeData in flow_field.data.nodes:
if node.node_id == node_id:
point = node
point.traversable = false
flow_field.calculate()
flow_field.path_updated.emit()
if is_multiplayer_authority():
spawn_wall(point, wall_id, caller_id)
wall_id += 1
spawn_wall(point, wall_id, caller_id)
wall_id += 1
func remove_wall(point: FlowNodeData) -> void: