WhiteSoul Posted July 30, 2014 Share Posted July 30, 2014 Hello, how is it going? I have trouble understanding how game states works in Phaser, I've searched the forum and I found a few posts about this, but I don't understand exactly how should I use it, I found it a bit confusing. ^^;I know the basics, but I don't know how to implement it. I mean, I have two files in HTML format, one is the menu and the other one the game itself.Should I write all the code in one document or just leave it like is right now? Thank you so much in advance. Regards, Daniel. Link to comment Share on other sites More sharing options...
Dumtard Posted July 30, 2014 Share Posted July 30, 2014 Have a look through this example. It has multiple states (Boot, Preload, MainMenu, Game) which are all attached to the game object in the index.html file. WhiteSoul and michaelcalkins 2 Link to comment Share on other sites More sharing options...
WhiteSoul Posted July 30, 2014 Author Share Posted July 30, 2014 Oh thank you, here it seems clear.I will try it now. Link to comment Share on other sites More sharing options...
WhiteSoul Posted July 30, 2014 Author Share Posted July 30, 2014 I tried without results... The screen appears black.This is so confusing to me. I will read again the documentation to see if I understand better. Link to comment Share on other sites More sharing options...
Dumtard Posted July 30, 2014 Share Posted July 30, 2014 Well, if you can show what you have I can hopefully explain the problem tell you how to change it to make it work. WhiteSoul 1 Link to comment Share on other sites More sharing options...
WhiteSoul Posted July 30, 2014 Author Share Posted July 30, 2014 Ok, thank you. ^^ Then you want that I post all the code here? Link to comment Share on other sites More sharing options...
Dumtard Posted July 31, 2014 Share Posted July 31, 2014 Sure, that will be fine. WhiteSoul 1 Link to comment Share on other sites More sharing options...
end3r Posted August 1, 2014 Share Posted August 1, 2014 You can also read my Phaser tutorial at Tuts+ and check the source code of the demo on GitHub - tutorial explains the concept of states and the demo game is showcasing it in action with the commented code. WhiteSoul 1 Link to comment Share on other sites More sharing options...
WhiteSoul Posted August 1, 2014 Author Share Posted August 1, 2014 Oh, nice tutorial, I will take a look now. Thank you guys so much, and sorry for taking all this time to respond. I will try to do it again before to post the code. Link to comment Share on other sites More sharing options...
Recommended Posts