summaryrefslogtreecommitdiff
path: root/models/chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/chunk.js')
-rw-r--r--models/chunk.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/models/chunk.js b/models/chunk.js
index 0ed0ee7..49059b1 100644
--- a/models/chunk.js
+++ b/models/chunk.js
@@ -68,6 +68,7 @@ var entityList = require("models/entity").entityList;
var classUtils = require("utils/class");
var chunkUtils = require("utils/chunk");
var gameUtils = require("utils/game");
+let doorUtils = require("utils/tele");
var tempTerrainOffsetSet1 = [
new Pos(0, -1),
@@ -267,7 +268,17 @@ Chunk.prototype.generateAllTiles = function() {
this.addRestZone();
}
if (Math.random() < 1 / 36) {
- this.addTeleporter();
+ this.addTeleporter();
+ }
+ for (let i = 0; i < 30; i++) {
+ var tempPos = new Pos(
+ Math.floor(Math.random() * chunkSize),
+ Math.floor(Math.random() * chunkSize)
+ );
+ tempPos.add(this.pos);
+ this.setTile(tempPos, 0x9b);
+ let id = doorUtils.registerDoor(tempPos);
+ console.log("Put door #" + id + " at " + tempPos.toString());
}
chunkUtils.persistAllChunks();
}