Merge pull request #223 from thecodingmachine/develop

Deploy tileset key fix to prod
This commit is contained in:
David Négrier 2020-07-07 18:32:27 +02:00 committed by GitHub
commit 0cd03755c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ export class GameScene extends Phaser.Scene {
return;
}
//TODO strategy to add access token
this.load.image(tileset.name, `${url}/${tileset.image}`);
this.load.image(`${url}/${tileset.image}`, `${url}/${tileset.image}`);
})
}
@ -246,8 +246,9 @@ export class GameScene extends Phaser.Scene {
create(): void {
//initalise map
this.Map = this.add.tilemap(this.MapKey);
const mapDirUrl = this.MapUrlFile.substr(0, this.MapUrlFile.lastIndexOf('/'));
this.mapFile.tilesets.forEach((tileset: ITiledTileSet) => {
this.Terrains.push(this.Map.addTilesetImage(tileset.name, tileset.name, tileset.tilewidth, tileset.tileheight, tileset.margin, tileset.spacing/*, tileset.firstgid*/));
this.Terrains.push(this.Map.addTilesetImage(tileset.name, `${mapDirUrl}/${tileset.image}`, tileset.tilewidth, tileset.tileheight, tileset.margin, tileset.spacing/*, tileset.firstgid*/));
});
//permit to set bound collision