Updated terraman2D. I reimplemented colliders.

This commit is contained in:
Relintai 2022-03-04 18:16:09 +01:00
parent 0c8e0e2978
commit dbd6926290
2 changed files with 9 additions and 9 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9b512dd510207d32911064a1bbe15b80c91b006b"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "5567c7da33666372c9c66e5669037c5e1bc3ff21"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}}
{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9b512dd510207d32911064a1bbe15b80c91b006b"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "60a7e84a5dc2fc252b0c582dd8f877685d28d74a"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}}

View File

@ -25,28 +25,28 @@ func _generate_chunk(chunk : Terrain2DChunk):
chunk.set_voxel(3, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_TYPE)
if x == 8 && y == 8:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(3, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_TYPE)
elif x == 10 && y == 10:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(3, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_TYPE)
elif x == 8 && y == 10:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
elif x == 8:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_WEST | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
elif y == 8 && x == 10:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH | Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
elif y == 8:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_NORTH | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
elif x == 10:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_EAST | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
elif y == 10:
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
chunk.set_voxel(Terrain2DChunkDefault.FLAG_CHANNEL_WALL_SOUTH | Terrain2DChunkDefault.FLAG_CHANNEL_COLLIDER, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_FLAGS)
else:
chunk.set_voxel(0, x, y, Terrain2DChunkDefault.DEFAULT_CHANNEL_TYPE)