Jump to content

Does order of states matter?


Vaughan
 Share

Recommended Posts

    //  No parameters given, which means no default state is created or started
    var game = new Phaser.Game(1024, 768, Phaser.CANVAS, 'gameContainer', null, true, true );
 
    game.state.add('mainmenu', ORPG.MainMenuState);
    game.state.add('preloader', ORPG.BootstrapState, true);


Loading my states like this, I end up getting:

Phaser.StateManager - No state found with the key: mainmenu
 
This is after trying to change in the create function of preloader.

 

Link to comment
Share on other sites

As I understand, the core game invokes your added state reserved function (preload, create, etc) only when this state is started.

So state creation (or adding state to the game) doesn't matter.

 

Maybe ORPG doesn't have a MainMenuState property ? 

 

started State documentation here (in progress) : https://github.com/photonstorm/phaser/wiki/Phaser-General-Documentation-:-States

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...