efecarranza Posted March 2, 2015 Share Posted March 2, 2015 Hey all, I am having some problems making init work. I have one state and i'm calling the next one by doing ('newState', false, false, this.hero) i want to pass my hero from my first state, which is kind of like a prologue/cutscene, so I don't have to re define him on every state but I'm having some problems with passing him. Could somebody show me the correct way to do init or point me to a good example? Thanks Link to comment Share on other sites More sharing options...
Abderrahmane TJ Posted March 3, 2015 Share Posted March 3, 2015 Could you show us some code ? thank you Link to comment Share on other sites More sharing options...
Nikow Posted March 3, 2015 Share Posted March 3, 2015 Where have you declare your object 'hero' in the first file ? Link to comment Share on other sites More sharing options...
B3nac Posted March 4, 2015 Share Posted March 4, 2015 Check out this tutorial on States with Phaser. https://developer.mozilla.org/en-US/docs/Games/Workflows/HTML5_Gamedev_Phaser_Device_Orientation. I found it pretty easy to follow and figure out. Hope this helps. You can also see how he goes state to state in his github files. https://github.com/EnclaveGames/Cyber-Orb Link to comment Share on other sites More sharing options...
Recommended Posts