Manage multi scene
- Create position and check if user is in position to switch in the next scene. - When scene is load, we load all scene in the layer of name "exit". - Layer "exit" of map.json have a parametter "exitSceneKey" to identify next scene. - Add layer "start", the player could start in the scene on the object present in the layer of name "start".
This commit is contained in:
@@ -18,6 +18,11 @@ export interface HasMovedEvent {
|
||||
character: string;
|
||||
}
|
||||
|
||||
export interface MapObject {
|
||||
key: string,
|
||||
url: string
|
||||
}
|
||||
|
||||
export class GameManager {
|
||||
status: number;
|
||||
private ConnexionInstance: Connexion;
|
||||
@@ -25,6 +30,7 @@ export class GameManager {
|
||||
private playerName: string;
|
||||
SimplePeer : SimplePeerInterface;
|
||||
private characterUserSelected: string;
|
||||
Maps: Array<MapObject>;
|
||||
|
||||
constructor() {
|
||||
this.status = StatusGameManagerEnum.IN_PROGRESS;
|
||||
@@ -43,8 +49,9 @@ export class GameManager {
|
||||
}
|
||||
|
||||
loadMaps(){
|
||||
return this.ConnexionInstance.loadMaps().then((maps) => {
|
||||
return maps;
|
||||
return this.ConnexionInstance.loadMaps().then((data) => {
|
||||
this.Maps = data.maps;
|
||||
return data;
|
||||
}).catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user