Merge pull request #852 from joberthel/fix-starting-position

use map tilewidth to calculate starting position instead of hardcoded value
This commit is contained in:
David Négrier 2021-03-28 17:50:28 +02:00 committed by GitHub
commit ad4f8e892e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -817,7 +817,7 @@ export class GameScene extends ResizableScene implements CenterListener {
const y = Math.floor(key / layer.width); const y = Math.floor(key / layer.width);
const x = key % layer.width; const x = key % layer.width;
possibleStartPositions.push({x: x*32, y: y*32}); possibleStartPositions.push({x: x * this.mapFile.tilewidth, y: y * this.mapFile.tilewidth});
}); });
// Get a value at random amongst allowed values // Get a value at random amongst allowed values
if (possibleStartPositions.length === 0) { if (possibleStartPositions.length === 0) {