Skip to content

Commit 5d1aebd

Browse files
comments
1 parent 5e346fa commit 5d1aebd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Systems/MazeGenerator.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export interface MazeGeneratorConfig {
1818
* - Split into its own file on Wednesday 3rd of December 2025
1919
*/
2020
export default class MazeGenerator {
21+
/** The arena to place the walls in */
2122
public arena: ArenaEntity;
22-
23+
/** The variables that affect maze generation */
2324
public config: MazeGeneratorConfig;
24-
2525
/** Stores all the "seed"s */
2626
public SEEDS: VectorAbstract[] = [];
2727
/** Stores all the "wall"s, contains cell based coords */
@@ -190,9 +190,12 @@ export default class MazeGenerator {
190190
this._buildWallFromGridCoord(x, y, width, height);
191191
}
192192
}
193+
194+
/** Checks if the given coordinates overlap with any wall */
193195
public isInWall(x: number, y: number): boolean {
194-
const width = this.arena.width / 2
195-
const height = this.arena.height / 2
196+
const width = this.arena.width / 2;
197+
const height = this.arena.height / 2;
198+
196199
for (const wall of this.WALLS) {
197200
const wallX = wall.x * this.config.CELL_SIZE - width;
198201
const wallY = wall.y * this.config.CELL_SIZE - height;
@@ -209,4 +212,4 @@ export default class MazeGenerator {
209212
}
210213
return false;
211214
}
212-
}
215+
}

0 commit comments

Comments
 (0)