Merge b49fd7e855
into 10e0f9f0de
This commit is contained in:
commit
bd486aaf4b
11
src/main.ts
11
src/main.ts
|
@ -43,8 +43,9 @@ Phaser.GameObjects.Rectangle.prototype.setPositionRelative = setPositionRelative
|
||||||
document.fonts.load("16px emerald").then(() => document.fonts.load("10px pkmnems"));
|
document.fonts.load("16px emerald").then(() => document.fonts.load("10px pkmnems"));
|
||||||
|
|
||||||
let game;
|
let game;
|
||||||
|
let manifest;
|
||||||
|
|
||||||
const startGame = async (manifest?: any) => {
|
const startGame = async () => {
|
||||||
await initI18n();
|
await initI18n();
|
||||||
const LoadingScene = (await import("./loading-scene")).LoadingScene;
|
const LoadingScene = (await import("./loading-scene")).LoadingScene;
|
||||||
const BattleScene = (await import("./battle-scene")).default;
|
const BattleScene = (await import("./battle-scene")).default;
|
||||||
|
@ -102,9 +103,11 @@ const startGame = async (manifest?: any) => {
|
||||||
fetch("/manifest.json")
|
fetch("/manifest.json")
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(jsonResponse => {
|
.then(jsonResponse => {
|
||||||
startGame(jsonResponse.manifest);
|
manifest = jsonResponse.manifest;
|
||||||
}).catch(() => {
|
}).catch(err => {
|
||||||
// Manifest not found (likely local build)
|
// Manifest not found (likely local build or path error on live)
|
||||||
|
console.log(`Manifest not found. ${err}`);
|
||||||
|
}).finally(() => {
|
||||||
startGame();
|
startGame();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue