diff --git a/chunk.gd b/chunk.gd index aa8b7e4..a0b86a2 100644 --- a/chunk.gd +++ b/chunk.gd @@ -3,7 +3,6 @@ extends Node3D var exits: Array = [false, false, false, false] -const STREET_WIDTH: float = 40 const ASPHALT_WIDTH: float = 20 @onready var exit_area = $BuildingAreas/B_area_E/Collision @onready var building_area = $BuildingAreas/B_area/Collision @@ -13,14 +12,14 @@ func _ready() -> void: $Mesh.mesh.size.x = Global.chunk_size $Mesh.mesh.size.y = Global.chunk_size - var building_side = (Global.chunk_size - STREET_WIDTH) / 2 - var building_center = (building_side + STREET_WIDTH) / 2 + var building_side = (Global.chunk_size - Global.street_width) / 2 + var building_center = (building_side + Global.street_width) / 2 building_area.shape.size.z = building_side building_area.shape.size.x = building_side building_area.position.x = building_center building_area.position.z = building_center - exit_area.shape.size.z = STREET_WIDTH + exit_area.shape.size.z = Global.street_width exit_area.shape.size.x = building_side var pavement_side = (Global.chunk_size - ASPHALT_WIDTH) / 2 @@ -32,7 +31,7 @@ func _ready() -> void: $BuildingAreas/B_area_E/Pavement.mesh.size.z = Global.chunk_size $BuildingAreas/B_area_E/Pavement.mesh.size.x = pavement_side - var z_correction_factor = STREET_WIDTH / 40 + var z_correction_factor = Global.street_width / 40 var x_correction_factor = building_side / 55 for st_body in $BuildingAreas.get_children(): st_body.get_node("Collision").position.x = building_center diff --git a/global.gd b/global.gd index 60b8603..2e1c15d 100644 --- a/global.gd +++ b/global.gd @@ -1,3 +1,4 @@ extends Node var chunk_size: float = 150 +var street_width: float = 40 var station_coords: Vector3 = Vector3.ZERO