so i’ve been refactoring my code recently and found a problem with phaser scene load order
import BootSceneController from "../scene/boot/boot_scene_controller";
import DebugSceneController from "../scene/debug/debug_scene_controller";
import GameplaySceneController from "../scene/gameplay/gameplay_scene_controller";
import LoadingSceneController from "../scene/loading/loading_scene_controller";
import MainMenuSceneController from "../scene/mainMenu/main_menu_scene_controller";
import MainSceneController from "../scene/main/main_scene_controller";
export const SceneInfo = {
bootScene: {
key: "default",
module: BootSceneController
},
...
}
var phaserconfig = {
title: packageData.name,
version: packageData.version,
scene: [
SceneInfo.bootScene.module,
SceneInfo.debugScene.module,
SceneInfo.loadingScene.module,
SceneInfo.mainScene.module,
SceneInfo.mainMenuScene.module,
SceneInfo.gameplayScene.module,
],
...
}
const game = new Phaser.Game(phaserconfig);
i dont know why. but debugScene keep getting loaded first before Boot scene.
the key of debug scene is also mentioned as default in console.log.
EDIT : after additional refactoring. it seems that some base scene extension might be related to cause the problem.
but even after removing all those extends and basely extends Phaser.Scene it now initially load gameplay scene instead