I’ve been developing my game for some weeks now and have made some scenes. Just recently, I suddenly can’t access my old scenes, and somehow I can’t run a specific scene based on its super key
Here’s the code:
main.js
/** @type {import("../typings/phaser")} */
import { SOpening } from "./scenes/SOpening";
import { STestGround } from "./scenes/STestGround";
import { SWareHouse } from "./scenes/SWareHouse";
import { SPentapolis } from "./scenes/SPentapolis";
import UIPlay from "./UI/UIPlay";
var config = {
type: Phaser.AUTO,
width:800,
height:600,
pixelArt: true,
scale:{
parent:'myGame',
// autoCenter:Phaser.Scale.CENTER_BOTH
},
physics:{
default: 'matter',
matter:{
gravity:{y:0.4},
debug:false
}
},
scene:[
STestGround,
SPentapolis,
SWareHouse,
UIPlay,
SOpening,
]
};
let game = new Phaser.Game(config);
CST.js
export const CST={
SCENES:{
UIPlay:"UIPlay",
SOpening : "SOpening",
STestGround:"STestGround",
SWareHouse:"SWareHouse",
SPentapolis:"SPentapolis",
}
}
STestGround.js
import { CST } from "../CST";
export class STestGround extends Phaser.Scene{
constructor() {
super({
key: CST.SCENES.STestGround
})
}
init(){
}
preload(){
}
create(){
console.log("Test");
}
}
As far as I concern, I’ve never touched one of those files while I was working on the other scene.
When I run the game, instead of playing STestGround, the game runs the UIPlay. Also, if I put SOpening as the first scene to be played, the game won’t let me, instead it runs the another random scene.
The only scene that works fine is SPentapolis. However, when I want to run another scene from SPentapolis, I can’t.
Can anybody help me,please…