Hi! I’m making a dungeon game and I have a problem with object positions.
- I’m creating a door object in Tiled using a 32x32 PNG image (my map grid is 16x16 per tile).
- When I add the door object in Tiled, it looks perfectly aligned on the map (see photo 1).
- But when I load the same object in Phaser, the position doesn’t match anymore (see photo 2).
Here’s how I’m creating the door in JS (Phaser 3):
// Objects: doors
this.doors = this.physics.add.staticGroup();
const doorObjects = map.getObjectLayer('doors').objects;
doorObjects.forEach((obj) => {
const door = this.doors.create(obj.x, obj.y, 'door-close');
door.setData('doorID', obj.properties.find((p) => p.name === 'doorID')?.value);
});
How can I make the door appear in Phaser exactly where I see it in Tiled?
Thanks for any help!