Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/bsp_level_generator.gd
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-23 19:35:54 +0100
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-23 19:35:54 +0100
commit03080afab1ace191d0fda29845b033887e6e49f3 (patch)
tree99275b941046522393d84ac1399410b5c69c5263 /scripts/bsp_level_generator.gd
parentb262d5d194036571d0b3adad3c9914ba9dbe0c8b (diff)
bsp_level_generator: Fix walls generating past the end of the room
enemy: Fix seeing through walls
Diffstat (limited to 'scripts/bsp_level_generator.gd')
-rw-r--r--scripts/bsp_level_generator.gd5
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/bsp_level_generator.gd b/scripts/bsp_level_generator.gd
index f4191a3..bef90be 100644
--- a/scripts/bsp_level_generator.gd
+++ b/scripts/bsp_level_generator.gd
@@ -65,9 +65,6 @@ func is_leaf(node: BSPNode) -> bool:
return node.left == null and node.right == null
func check_door(grid: Array[Tile.Tile], axis: int, door_pos: Vector2i) -> bool:
- var other_axis = (axis + 1) % 2
- door_pos[other_axis] += 1
-
var room_left = door_pos
room_left[axis] -= 1
@@ -106,7 +103,7 @@ func generate_grid(map: BSPNode, grid: Array[Tile.Tile]) -> void:
var test_door = randi_range(map.min_dims[other_axis], map.max_dims[other_axis] - 1)
var door_pos = Vector2i.ZERO
door_pos[map.axis] = split_axis
- door_pos[other_axis] = test_door + 2
+ door_pos[other_axis] = test_door + 1
var door_pos2 = door_pos
door_pos2[other_axis] += 1