diff options
author | munvoseli <muslinmelody@gmail.com> | 2023-06-10 13:46:52 -0400 |
---|---|---|
committer | munvoseli <muslinmelody@gmail.com> | 2023-06-10 13:46:52 -0400 |
commit | 05d4f95ffb956c43d5fb7595721fc5ba4c555090 (patch) | |
tree | 8e982866564a6461839770372a67f4378867555d | |
parent | 71baed2f2e488902d85fc57c52a6d3189cae587f (diff) |
temporarily increase teleporter rate to 10 per chunk
-rw-r--r-- | models/chunk.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/chunk.js b/models/chunk.js index 2ab0d72..42396ea 100644 --- a/models/chunk.js +++ b/models/chunk.js @@ -137,8 +137,8 @@ Chunk.prototype.getRestZonePos = function(pos) { Chunk.prototype.addTeleporter = function() { var tempPos = new Pos( - Math.floor(Math.random() * chunkSize), - Math.floor(Math.random() * chunkSize) + Math.floor(Math.random() * chunkSize), + Math.floor(Math.random() * chunkSize) ); tempPos.add(this.pos); var tempType = Math.floor(Math.random() * TELEPORTER_TILE_AMOUNT); @@ -165,7 +165,7 @@ Chunk.prototype.generateTile = function(pos) { } else { if (Math.random() < 0.01) { tempTile = FLOUR_TILE + Math.floor(Math.random() * 3); - } + } else { tempTile = EMPTY_TILE; } @@ -266,8 +266,9 @@ Chunk.prototype.generateAllTiles = function() { if ((this.pos.x == 0 && this.pos.y == 0) || Math.random() < 1 / (10 * 10)) { this.addRestZone(); } - if (Math.random() < 1 / 36) - this.addTeleporter(); + if (Math.random() < 1 / 1) + for (let i = 0; i < 10; i++) + this.addTeleporter(); chunkUtils.persistAllChunks(); } |