Reload scene

Hi,

I have a game (RPG style) with two scenes: game (menu) & room (level). My room scene preload external resources (tilemap, characters on map, assets, etc…). For start room all works fine.

My problem is on “exit tile” (for enter to other level). When player overlaps exit tile, fadeOut camera and stop & remove roomscene, change main data (currentLevel, and other data) and start again roomscene. However, I have problems:

  • My first roomScene switch off correctly, but looks not completely deleted scene after .remove(key).
  • Looks that my new roomScene not starts (no error, not enter into preload and create methods).
  • I have doubts for this preload assets system. Should I make different?

Some help? Thanks!

I’m not sure, but try phaser-plugin-scene-watcher.

Code for this?

You can preload assets earlier, before the room scene.

Fantastic plugin!

I will try with this plugin for debug.

Thanks!

Very thanks, @samme.

With scene watcher, I see that first scene don’t run. I use “start” instead “launch” and stop first scene also (and other minor errors).

Very useful this plugin, thanks!

Fixed!! :smiley:

i doubt i can surpass the mighty samme lol, im not sure what to say since theres no code, just :slight_smile:
afaik : launch should stop the current scene in one go , you can load all assets for the whole game in the first scene, i tend to use a loader for that (separate scene) as they stay available through the whole session, and dont bother with loading any afterwards (unless you’re memory nitpicking for mobile only stuff) and if you really need a clear javascript can window.location.reload (its rusty but i think if you reload to ‘.’ or use an absolute url it will give you your opening screen. That’s like hard-resetting your virtual system (-> window/tab) and all the garbage should be out even if phaser forgot something.

anyway

good luck :smiley: