Refactoring/centralizing map loading in GameManager

This commit is contained in:
David Négrier 2020-05-11 23:26:40 +02:00
parent c846aff456
commit 9417e4a4d2
3 changed files with 20 additions and 5 deletions

View file

@ -103,9 +103,7 @@ export class LogincScene extends Phaser.Scene implements GameSceneInterface {
if (!scene) {
return;
}
let key = getMapKeyByUrl(scene.mapUrlStart);
let game = new GameScene(key,`${MAP_FILE_URL}${scene.mapUrlStart}`);
this.scene.add(key, game, false);
let key = gameManager.loadMap(scene.mapUrlStart, this.scene);
this.scene.start(key);
return scene;
}).catch((err) => {