use tilewidth and tileheight to center spawn position dynamically
This commit is contained in:
parent
9e835620f1
commit
f08aec28c0
@ -650,8 +650,8 @@ export class GameScene extends ResizableScene implements CenterListener {
|
||||
for (const layer of this.mapFile.layers) {
|
||||
if (layerName === layer.name && layer.type === 'tilelayer' && (layerName === "start" || this.isStartLayer(layer))) {
|
||||
const startPosition = this.startUser(layer);
|
||||
this.startX = startPosition.x + 16;
|
||||
this.startY = startPosition.y + 16;
|
||||
this.startX = startPosition.x + this.mapFile.tilewidth/2;
|
||||
this.startY = startPosition.y + this.mapFile.tileheight/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user