fix
This commit is contained in:
parent
2701d656da
commit
413f1ea6df
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user