Jump to content

Does order of states matter?


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

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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