This commit is contained in:
_Bastler 2021-07-01 13:48:03 +02:00
parent 2701d656da
commit 413f1ea6df
2 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@ export class GameMap {
}
private getTileProperty(index: number): Array<ITiledMapLayerProperty> {
return this.tileSetPropertyMap[index];
return this.tileSetPropertyMap[index] || [];
}
private trigger(propName: string, oldValue: string | number | boolean | undefined, newValue: string | number | boolean | undefined, allProps: Map<string, string | boolean | number>) {
@ -198,7 +198,7 @@ export class GameMap {
this.putTileInFlatLayer(tileIndex, x, y, layer);
const phaserTile = phaserLayer.putTileAt(tileIndex, x, y);
for (const property of this.getTileProperty(tileIndex)) {
if ( property.name === "collides" && property.value === "true") {
if ( property.name === "collides" && property.value) {
phaserTile.setCollision(true);
}
}

View File

@ -1085,7 +1085,7 @@ export class GameScene extends DirtyScene {
}, this.userInputManager);
}
}));
)
this.iframeSubscriptionList.push(iframeListener.setTilesStream.subscribe((eventTiles) => {
for (const eventTile of eventTiles) {
this.gameMap.putTile(eventTile.tile, eventTile.x, eventTile.y, eventTile.layer);