From 5bfd6b9346da52e0790002183b0c24e114823057 Mon Sep 17 00:00:00 2001 From: Skye Kelley <10640425-sb24kelley@users.noreply.gitlab.com> Date: Sun, 18 Sep 2022 19:30:14 -0400 Subject: [PATCH 1/2] update gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 91a629f..55f3696 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ node_modules/* -dist/js/bundle.js \ No newline at end of file +dist/js/bundle.js +devuser/ +.vscode/ +work_recordings/ From b055ff8cbd9939fce7600fe40e8d93b7c2543aaa Mon Sep 17 00:00:00 2001 From: Skye Kelley <10640425-sb24kelley@users.noreply.gitlab.com> Date: Thu, 22 Sep 2022 21:27:09 -0400 Subject: [PATCH 2/2] Fix randomizeWalls for different map sizes --- src/Controllers/EnvironmentController.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Controllers/EnvironmentController.js b/src/Controllers/EnvironmentController.js index 61a9d57..c148bd0 100644 --- a/src/Controllers/EnvironmentController.js +++ b/src/Controllers/EnvironmentController.js @@ -61,12 +61,17 @@ class EnvironmentController extends CanvasController{ let resolution = 20; Perlin.seed(); - for (let r = 0; r < this.env.num_rows; r++) { - for (let c = 0; c < this.env.num_cols; c++) { - let xval = c/this.env.num_cols*(resolution/this.env.renderer.cell_size*(this.env.num_cols/this.env.num_rows)); - let yval = r/this.env.num_rows*(resolution/this.env.renderer.cell_size*(this.env.num_rows/this.env.num_cols)); + let num_rows = this.env.grid_map.rows + let num_cols = this.env.grid_map.cols + // let num_rows = this.env.num_rows + // let num_cols = this.env.num_cols + + for (let r = 0; r < num_rows; r++) { + for (let c = 0; c < num_cols; c++) { + let xval = c/num_cols*(resolution/this.env.renderer.cell_size*(num_cols/num_rows)); + let yval = r/num_rows*(resolution/this.env.renderer.cell_size*(num_rows/num_cols)); let noise = Perlin.get(xval, yval); - avg_noise += noise/(this.env.num_rows*this.env.num_cols); + avg_noise += noise/(num_rows*num_cols); if (noise > noise_threshold && noise < noise_threshold + thickness/resolution) { let cell = this.env.grid_map.cellAt(c, r); if (cell != null) {