Closed Alpvax closed 7 years ago
Thanks, it's an error with moving off the west side of the map, not to do with the speed at which you move. I am fairly sure it's something in this section of GenerateMap.js:
case "east":
position = (Math.round(RNG(sideLength)) * sideLength) - 1;
case "west":
position = Math.round(RNG(sideLength - 1)) * sideLength;
I think it's to do with the random number generator and the maths used there to find a position occasionally selecting one that is not part of the map, either -1 or 1 higher than the map's length.
Yeah it's
position = (Math.round(RNG(sideLength)) * sideLength) - 1;
Can give a value of -1, I'll fix it soon.
Fix is changing that line to:
position = (Math.round(RNG(1, sideLength)) * sideLength) - 1;
Fixed.
Usual practice is to include this issue number in the commit when you close it
Is that #2 or is it listed elsewhere?
Exactly
I did that as an example of how it should be. If it wasn't already closed it would have closed it too
Cool, thanks for the link & example.
Moving a single tile away and back the error did not reoccur. Might look into it some other time, busy right now.
Crash (with full path stripped to fit them on 1 line):