Merge
authorDavid Négrier <d.negrier@thecodingmachine.com>
Sun, 3 May 2020 13:51:16 +0000 (15:51 +0200)
committerDavid Négrier <d.negrier@thecodingmachine.com>
Sun, 3 May 2020 13:51:16 +0000 (15:51 +0200)
1  2 
front/src/Phaser/Game/GameManager.ts
front/src/Phaser/Game/GameScene.ts
front/src/Phaser/Player/Player.ts

index 83e205ec171cf158a08d8ded3e5db6aad6825d99,2dd9fdf19c6c7638b6f445bdb3cb5c72e178a74f..ad4d5a2c2ddeb8a96caa2fef5a17485eb8b19f30
@@@ -21,13 -24,11 +25,12 @@@ export class GameManager 
      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);
+             this.SimplePeer = new SimplePeer(this.ConnexionInstance);
          });
      }
  
          }
      }
  
 +    getPlayerName(): string {
 +        return this.playerName;
 +    }
++
+     pushPlayerPosition(event: HasMovedEvent) {
+         this.ConnexionInstance.sharePosition(event.x, event.y, event.direction);
+     }
  }
  
 -export const gameManager = new GameManager();
 +export const gameManager = new GameManager();
Simple merge
Simple merge