Moving back to using ScenePlugin and adding EntryScene
This commit is contained in:
parent
2852f204f5
commit
0731bd39e5
6 changed files with 65 additions and 32 deletions
40
front/src/Phaser/Login/EntryScene.ts
Normal file
40
front/src/Phaser/Login/EntryScene.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import {gameManager} from "../Game/GameManager";
|
||||
import {TextField} from "../Components/TextField";
|
||||
import {TextInput} from "../Components/TextInput";
|
||||
import {ClickButton} from "../Components/ClickButton";
|
||||
import Image = Phaser.GameObjects.Image;
|
||||
import Rectangle = Phaser.GameObjects.Rectangle;
|
||||
import {PLAYER_RESOURCES, PlayerResourceDescriptionInterface} from "../Entity/Character";
|
||||
import {cypressAsserter} from "../../Cypress/CypressAsserter";
|
||||
import {SelectCharacterSceneName} from "./SelectCharacterScene";
|
||||
import {ResizableScene} from "./ResizableScene";
|
||||
import {Scene} from "phaser";
|
||||
import {LoginSceneName} from "./LoginScene";
|
||||
import {FourOFourSceneName} from "../Reconnecting/FourOFourScene";
|
||||
|
||||
export const EntrySceneName = "EntryScene";
|
||||
|
||||
/**
|
||||
* The EntryScene is not a real scene. It is the first scene loaded and is only used to initialize the gameManager
|
||||
* and to route to the next correct scene.
|
||||
*/
|
||||
export class EntryScene extends Scene {
|
||||
constructor() {
|
||||
super({
|
||||
key: EntrySceneName
|
||||
});
|
||||
}
|
||||
|
||||
preload() {
|
||||
}
|
||||
|
||||
create() {
|
||||
gameManager.init(this.scene).then(() => {
|
||||
this.scene.start(LoginSceneName);
|
||||
}).catch(() => {
|
||||
this.scene.start(FourOFourSceneName, {
|
||||
url: window.location.pathname.toString()
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue