Merge pull request #44 from thecodingmachine/map-v0
My first map representing TCM office grand floor without KEN office
This commit is contained in:
commit
33bcbd4650
6 changed files with 305 additions and 19 deletions
|
@ -44,12 +44,16 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
|||
//hook preload scene
|
||||
preload(): void {
|
||||
cypressAsserter.preloadStarted();
|
||||
let mapUrl = 'maps/map2.json';
|
||||
let mapUrl = 'maps/map.json';
|
||||
this.load.on('filecomplete-tilemapJSON-'+Textures.Map, (key: string, type: string, data: any) => {
|
||||
// Triggered when the map is loaded
|
||||
// Load tiles attached to the map recursively
|
||||
this.map = data.data;
|
||||
this.map.tilesets.forEach((tileset) => {
|
||||
if (typeof tileset.name === 'undefined' || typeof tileset.image === 'undefined') {
|
||||
console.warn("Don't know how to handle tileset ", tileset)
|
||||
return;
|
||||
}
|
||||
let path = mapUrl.substr(0, mapUrl.lastIndexOf('/'));
|
||||
this.load.image(tileset.name, path + '/' + tileset.image);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue