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:
parent
7f989cfd23
commit
fb8d9bf9a8
8 changed files with 101 additions and 53 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue