From 05d4f95ffb956c43d5fb7595721fc5ba4c555090 Mon Sep 17 00:00:00 2001 From: munvoseli Date: Sat, 10 Jun 2023 13:46:52 -0400 Subject: temporarily increase teleporter rate to 10 per chunk --- models/chunk.js | 11 ++++++----- 1 file 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(); } -- cgit v1.2.3