gamef1 Posted March 16, 2019 Share Posted March 16, 2019 Hi All, this is my first post in the forum I searched for something similar to my issue, but I could not find it. I am making my first game, so I am doing some beginner mistake. I have the level loaded as [Level0, Level1] Both are classes class Level0 extends Phaser.Scene { // all class code here } Then when the user hits space bar I want to load the Level1 (which is where the game begins). const { cursors } = this; if (cursors.space.isDown && typeof window !== undefined) { window.game.scene.remove('Level0'); window.game.scene.start('Level1'); } The problem is that while I am able to switch to the Level1, I can see that in fact the actual working scene is still the Level0. The music and images from Level 0 are not removed. The basic idea is Level0 is the start of the game, and hitting space bar you load the first Level, which is another class with its own music and images. I am loading the file correctly, what am I doing wrong? <script src="Scene0.js"></script> <script src="Scene1.js"></script> <script src="game.js"></script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.