feat: Add some more trees
This commit is contained in:
parent
f99af7cd6a
commit
a5c1d211ad
78
chunk.gd
78
chunk.gd
|
|
@ -38,94 +38,16 @@ func update() -> void:
|
|||
continue
|
||||
|
||||
if i == 0: #n
|
||||
var vertices = PackedVector3Array()
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, -Global.chunk_size/2))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2 , 0.5, -Global.chunk_size/2))
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, -Global.chunk_size/2))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
|
||||
|
||||
# Initialize the ArrayMesh.
|
||||
var arr_mesh = ArrayMesh.new()
|
||||
var arrays = []
|
||||
arrays.resize(Mesh.ARRAY_MAX)
|
||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||
# Create the Mesh.
|
||||
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
var m = MeshInstance3D.new()
|
||||
m.mesh = arr_mesh
|
||||
add_child(m)
|
||||
$BuildingAreas/B_area_N/Collision.disabled = true
|
||||
$BuildingAreas/B_area_N.visible = false
|
||||
if i == 1: #s
|
||||
var vertices = PackedVector3Array()
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, Global.chunk_size/2))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
|
||||
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, Global.chunk_size/2))
|
||||
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, Global.chunk_size/2))
|
||||
|
||||
# Initialize the ArrayMesh.
|
||||
var arr_mesh = ArrayMesh.new()
|
||||
var arrays = []
|
||||
arrays.resize(Mesh.ARRAY_MAX)
|
||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||
# Create the Mesh.
|
||||
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
var m = MeshInstance3D.new()
|
||||
m.mesh = arr_mesh
|
||||
add_child(m)
|
||||
$BuildingAreas/B_area_S/Collision.disabled = true
|
||||
$BuildingAreas/B_area_S.visible = false
|
||||
if i == 2: #w
|
||||
var vertices = PackedVector3Array()
|
||||
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, STREET_WIDTH/2))
|
||||
|
||||
# Initialize the ArrayMesh.
|
||||
var arr_mesh = ArrayMesh.new()
|
||||
var arrays = []
|
||||
arrays.resize(Mesh.ARRAY_MAX)
|
||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||
# Create the Mesh.
|
||||
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
var m = MeshInstance3D.new()
|
||||
m.mesh = arr_mesh
|
||||
add_child(m)
|
||||
$BuildingAreas/B_area_W/Collision.disabled = true
|
||||
$BuildingAreas/B_area_W.visible = false
|
||||
if i == 3: #e
|
||||
var vertices = PackedVector3Array()
|
||||
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, STREET_WIDTH/2))
|
||||
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
|
||||
|
||||
# Initialize the ArrayMesh.
|
||||
var arr_mesh = ArrayMesh.new()
|
||||
var arrays = []
|
||||
arrays.resize(Mesh.ARRAY_MAX)
|
||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||
# Create the Mesh.
|
||||
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
var m = MeshInstance3D.new()
|
||||
m.mesh = arr_mesh
|
||||
add_child(m)
|
||||
$BuildingAreas/B_area_E/Collision.disabled = true
|
||||
$BuildingAreas/B_area_E.visible = false
|
||||
|
||||
var center_mesh = MeshInstance3D.new()
|
||||
center_mesh.position = Vector3(0,0.6,0)
|
||||
center_mesh.mesh = PlaneMesh.new()
|
||||
center_mesh.mesh.size = Vector2(STREET_WIDTH,STREET_WIDTH)
|
||||
add_child(center_mesh)
|
||||
|
||||
i += 1
|
||||
|
|
|
|||
32
spawn.tscn
32
spawn.tscn
|
|
@ -17,13 +17,37 @@ mesh = SubResource("PlaneMesh_kdh3y")
|
|||
surface_material_override/0 = SubResource("StandardMaterial3D_eoxb4")
|
||||
|
||||
[node name="Tree" parent="." unique_id=1643526032 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 56.65297, 0, 58.980564)
|
||||
transform = Transform3D(-0.25, 0, 2.1855694e-08, 0, 0.25, 0, -2.1855694e-08, 0, -0.25, 56.65297, 0, 58.980564)
|
||||
|
||||
[node name="Tree2" parent="." unique_id=1540661030 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -58.315056, 0, 58.980564)
|
||||
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, -58.315056, 0, 58.980564)
|
||||
|
||||
[node name="Tree3" parent="." unique_id=733885099 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 56.65297, 0, -59.754894)
|
||||
transform = Transform3D(-1.0927847e-08, 0, 0.25, 0, 0.25, 0, -0.25, 0, -1.0927847e-08, 56.65297, 0, -59.754894)
|
||||
|
||||
[node name="Tree4" parent="." unique_id=1749315975 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -58.315056, 0, -59.754894)
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -58.315056, 0, -59.754894)
|
||||
|
||||
[node name="Tree5" parent="." unique_id=548660262 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 56.65297, 0, 20.611866)
|
||||
|
||||
[node name="Tree6" parent="." unique_id=60264276 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -58.315056, 0, 20.611866)
|
||||
|
||||
[node name="Tree7" parent="." unique_id=474542968 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 56.65297, 0, -19.729847)
|
||||
|
||||
[node name="Tree8" parent="." unique_id=1315362359 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-1.0927847e-08, 0, 0.25, 0, 0.25, 0, -0.25, 0, -1.0927847e-08, -58.315056, 0, -19.729847)
|
||||
|
||||
[node name="Tree9" parent="." unique_id=966257851 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-0.25, 0, 2.1855694e-08, 0, 0.25, 0, -2.1855694e-08, 0, -0.25, -21.001902, 0, 59.295353)
|
||||
|
||||
[node name="Tree10" parent="." unique_id=1132289865 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-0.25, 0, 2.5580984e-08, 0, 0.25, 0, -2.5580984e-08, 0, -0.25, -21.001898, 0, -60.134964)
|
||||
|
||||
[node name="Tree11" parent="." unique_id=652494687 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 19.339811, 0, 59.295353)
|
||||
|
||||
[node name="Tree12" parent="." unique_id=235943393 instance=ExtResource("2_yqulk")]
|
||||
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 19.339815, 0, -60.134964)
|
||||
|
|
|
|||
Loading…
Reference in New Issue