use map tilewidth instead of hardcoded values
This commit is contained in:
parent
4b8a2aca34
commit
5375528d7c
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue