Vaughan Posted January 28, 2014 Share Posted January 28, 2014 // 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 More sharing options...
Alvin Posted January 28, 2014 Share Posted January 28, 2014 Simple check, are you sure there is no problem in your ORPG.MainMenuState or that this State is defined ? Link to comment Share on other sites More sharing options...
jerome Posted January 28, 2014 Share Posted January 28, 2014 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 Arlefreak 1 Link to comment Share on other sites More sharing options...
Recommended Posts