Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/bsp_level_generator.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bsp_level_generator.gd')
-rw-r--r--scripts/bsp_level_generator.gd11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/bsp_level_generator.gd b/scripts/bsp_level_generator.gd
index 4a1ca9b..664b7a5 100644
--- a/scripts/bsp_level_generator.gd
+++ b/scripts/bsp_level_generator.gd
@@ -111,8 +111,8 @@ func generate_grid(map: BSPNode, grid: Array[Tile.Tile]) -> void:
have_door = true
# Place grid for mesh
- grid[door_pos.y * grid_width + door_pos.x] = Tile.Tile.FLOOR
- grid[door_pos2.y * grid_width + door_pos2.x] = Tile.Tile.FLOOR
+ grid[door_pos.y * grid_width + door_pos.x] = Tile.Tile.DOOR
+ grid[door_pos2.y * grid_width + door_pos2.x] = Tile.Tile.DOOR
#door_pos[map.axis] -= 1
#grid[door_pos.y * grid_width + door_pos.x] = Tile.Tile.FLOOR
@@ -146,14 +146,13 @@ func generate_geo(grid: Array[Tile.Tile], array: Array) -> void:
for x in range(grid_width):
var tile = grid[y * grid_width + x]
- if tile == Tile.Tile.FLOOR:
+ if tile == Tile.Tile.FLOOR or tile == Tile.Tile.DOOR:
generate_plane(array, Vector3(x, 0, y), [Vector3(1, 0, 0), Vector3(0, 0, 1)], Vector3.UP)
elif tile == Tile.Tile.WALL:
- generate_plane(array, Vector3(x, 2, y), [Vector3(0, 0, 1), Vector3(0, -2, 0)], Vector3.RIGHT)
+ generate_plane(array, Vector3(x, 2, y), [Vector3(0, 0, 1), Vector3(0, -2, 0)], Vector3.LEFT)
generate_plane(array, Vector3(x, 2, y+1), [Vector3(1, 0, 0), Vector3(0, -2, 0)], Vector3.BACK)
- generate_plane(array, Vector3(x+1, 2, y+1), [Vector3(0, 0, -1), Vector3(0, -2, 0)], Vector3.LEFT)
+ generate_plane(array, Vector3(x+1, 2, y+1), [Vector3(0, 0, -1), Vector3(0, -2, 0)], Vector3.RIGHT)
generate_plane(array, Vector3(x+1, 2, y), [Vector3(-1, 0, 0), Vector3(0, -2, 0)], Vector3.FORWARD)
- pass
func _ready() -> void:
var starting_axis = randi_range(0, 1)