ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 254 forks source link

ROT.Map.Uniform only uses the set seed for rooms, not for corridors #135

Closed konijn closed 6 years ago

konijn commented 6 years ago

Greetings,

it would appear that the corridors do not use the seed from
ROT.RNG.setSeed( PP.game.seed * PP.game.level );

An example is here: http://konijn.github.io/project-pandora/

Just start a game by pressing 1, then hit control S to save, every time you reload game 1 , you will see the rooms and the player in the same spot, but the corridors are every time different.

ondras commented 6 years ago

This is caused by a collision with your own ArrayRandom function that conflicts with the rot.js-based one:

Array.prototype.random = function ArrayRandom(){
  return this[Math.floor(Math.random() * this.length)];
}

Removing this function of yours might completely solve your issue :-)

konijn commented 6 years ago

Oh my, you rock!!