Steps to Reproduce
- Create a Tilemap
- Set a cell to solid
- Move the pos of the Tilemap
Same problem appears, in other order
- Create a Tilemap
- Move the pos of the Tilemap
- Set a cell to solid
only when setting the pos directly on construction it doesn't fail.
Expected Result
Collision boundaries are moved also, when Tilemap (and its graphics) are moved.
Actual Result
Collision boundaries are not moved.
Environment
- Browser: Firefox 141.0
- Excalibur versions: 0.30.3
- Operating system: Windows
Additional information
This problem also occurs when using useLevelOffsets: false with the LDtk plugin and having World Coordinates != 0,0 - as a direct result of this bug (because in the plugin the pos is changed after construction).
Minimal code
game.start('start', {
loader,
}).then(() => {
const spriteSheet = SpriteSheet.fromImageSource({
image: Resources.TileMap,
grid: {
rows: 4,
columns: 4,
spriteHeight: 32,
spriteWidth: 32
},
spacing: {
margin: {
x: 0,
y: 0
}
}
});
const tilemap = new TileMap({
rows: 4,
columns: 4,
tileWidth: 32,
tileHeight: 32,
});
let tile1 = tilemap.getTile(0, 0);
if (tile1) {
tile1.solid = true // XXX first relevant line
}
for (let tile of tilemap.tiles) {
const sprite = spriteSheet.getSprite(0, 0);
if (sprite) {
tile.addGraphic(sprite);
}
}
tilemap.pos = tilemap.pos.add(vec(512, 0)) // XXX second relevant line
game.currentScene.add(tilemap)
});
Steps to Reproduce
Same problem appears, in other order
only when setting the pos directly on construction it doesn't fail.
Expected Result
Collision boundaries are moved also, when Tilemap (and its graphics) are moved.
Actual Result
Collision boundaries are not moved.
Environment
Additional information
This problem also occurs when using
useLevelOffsets: falsewith the LDtk plugin and having World Coordinates != 0,0 - as a direct result of this bug (because in the plugin the pos is changed after construction).Minimal code