Multi Scene in back end

- Change maps url to get maps
 - Change GameScene to create scene with file since back end
 - Change LoginScene to upload scene and start game
This commit is contained in:
gparant 2020-05-09 19:41:21 +02:00
parent 7f989cfd23
commit fb8d9bf9a8
8 changed files with 101 additions and 53 deletions

View file

@ -143,6 +143,8 @@ export interface ConnexionInterface {
createConnexion(characterSelected: string): Promise<any>;
loadMaps(): Promise<any>;
joinARoom(roomId: string, character: string): void;
sharePosition(x: number, y: number, direction: string, character: string): void;
@ -173,6 +175,9 @@ export class Connexion implements ConnexionInterface {
this.GameManager = GameManager;
}
/**
* @param characterSelected
*/
createConnexion(characterSelected: string): Promise<ConnexionInterface> {
return Axios.post(`${API_URL}/login`, {email: this.email})
.then((res) => {
@ -199,13 +204,22 @@ export class Connexion implements ConnexionInterface {
this.groupUpdatedOrCreated();
this.groupDeleted();
return this;
return res.data;
})
.catch((err) => {
console.error(err);
throw err;
});
}
loadMaps() : Promise<any>{
return Axios.get(`${API_URL}/maps`).then((res) => {
return res.data;
}).catch((err) => {
console.error(err);
throw err;
});
}
/**
*