Putting the name in GameManager rather than passing it from scene to scene.
This commit is contained in:
parent
5601e5e134
commit
76b745ebea
3 changed files with 12 additions and 12 deletions
|
@ -5,7 +5,6 @@ import {DEBUG_MODE, RESOLUTION, ROOM, ZOOM_LEVEL} from "../../Enum/EnvironmentVa
|
|||
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 {
|
||||
|
@ -29,7 +28,6 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
|||
map: ITiledMap;
|
||||
startX = (window.innerWidth / 2) / RESOLUTION;
|
||||
startY = (window.innerHeight / 2) / RESOLUTION;
|
||||
playerName: string;
|
||||
|
||||
|
||||
constructor() {
|
||||
|
@ -69,8 +67,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
|||
}
|
||||
|
||||
//hook initialisation
|
||||
init(data: GameSceneInitDataInterface) {
|
||||
this.playerName = data.name;
|
||||
init() {
|
||||
}
|
||||
|
||||
//hook create scene
|
||||
|
@ -168,7 +165,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
|||
this,
|
||||
this.startX,
|
||||
this.startY,
|
||||
this.playerName
|
||||
this.GameManager.getPlayerName()
|
||||
);
|
||||
this.CurrentPlayer.initAnimation();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue