From b1d9bfe7e80b4d95acd26d0ab6a1ce34ad18d91c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 24 Nov 2024 11:46:03 +0100 Subject: next commit --- chunk.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'chunk.gd') diff --git a/chunk.gd b/chunk.gd index 8dcd416..24713a2 100644 --- a/chunk.gd +++ b/chunk.gd @@ -6,7 +6,7 @@ var chunk_size := Vector3(16, 16, 16) @export var noise: FastNoiseLite -var blocks: Array[Block] = [] +var blocks: Array = [] func generate_chunk(row, column, depth): @@ -18,7 +18,7 @@ func generate_chunk(row, column, depth): st.begin(Mesh.PRIMITIVE_TRIANGLES) st.set_material(material) - var blocks = [] + blocks = [] for x in chunk_size.x: #blocks[x] = [] @@ -66,7 +66,7 @@ func generate_chunk(row, column, depth): st.set_uv(Vector2(0, 0)) if (blocks[x][y].size() > z+1 and blocks[x][y][z + 1].type == Block.Type.AIR) or blocks[x][y].size() == z+1: - block.add_face(st, Block.Face.FRONT, block) + block.add_face(st, Block.Face.FRONT) if (blocks.size() > x+1 and blocks[x + 1][y][z].type == Block.Type.AIR) or blocks.size() == x+1: block.add_face(st, Block.Face.RIGHT) @@ -88,3 +88,5 @@ func generate_chunk(row, column, depth): var mesh = MeshInstance3D.new() mesh.mesh = st.commit() mesh.create_trimesh_collision() + + return mesh -- cgit v1.2.3