2020-10-12 18:59:49 +02:00
|
|
|
import {gameManager} from "../Game/GameManager";
|
|
|
|
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
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
create() {
|
2020-12-04 11:30:35 +01:00
|
|
|
gameManager.init(this.scene).then((nextSceneName) => {
|
|
|
|
this.scene.start(nextSceneName);
|
2020-12-01 19:34:36 +01:00
|
|
|
}).catch((err) => {
|
|
|
|
console.error(err)
|
2020-10-12 18:59:49 +02:00
|
|
|
this.scene.start(FourOFourSceneName, {
|
|
|
|
url: window.location.pathname.toString()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|