status: number;
private ConnexionInstance: Connexion;
private currentGameScene: GameScene;
+ private playerName: string;
SimplePeer : SimplePeerInterface;
constructor() {
this.status = StatusGameManagerEnum.IN_PROGRESS;
}
-
- connect(email:string) {
- this.ConnexionInstance = new Connexion(email, this);
+
+ connect(name:string) {
+ this.playerName = name;
+ this.ConnexionInstance = new Connexion(name, this);
ConnexionInstance = this.ConnexionInstance;
return this.ConnexionInstance.createConnexion().then(() => {
this.SimplePeer = new SimplePeer(ConnexionInstance);
console.error(e);
}
}
+
+ getPlayerName(): string {
+ return this.playerName;
+ }
}
-export const gameManager = new GameManager();
\ No newline at end of file
+export const gameManager = new GameManager();
import Tile = Phaser.Tilemaps.Tile;
import {ITiledMap, ITiledTileSet} from "../Map/ITiledMap";
import {cypressAsserter} from "../../Cypress/CypressAsserter";
-import { GameSceneInitDataInterface } from "./GameSceneInitDataInterface";
export const GameSceneName = "GameScene";
export enum Textures {
map: ITiledMap;
startX = (window.innerWidth / 2) / RESOLUTION;
startY = (window.innerHeight / 2) / RESOLUTION;
- playerName: string;
constructor() {
}
//hook initialisation
- init(data: GameSceneInitDataInterface) {
- this.playerName = data.name;
+ init() {
}
//hook create scene
this,
this.startX,
this.startY,
- this.playerName
+ this.GameManager.getPlayerName()
);
this.CurrentPlayer.initAnimation();