mrxj88 Posted January 5, 2017 Share Posted January 5, 2017 Im trying out states in my game for the first time. i tried to follow this tutorial and i get this error: Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render my code is the exact same so not sure why im receiving this error. the site i was using was:http://perplexingtech.weebly.com/game-dev-blog/using-states-in-phaserjs-javascript-game-developement Link to comment Share on other sites More sharing options...
drhayes Posted January 5, 2017 Share Posted January 5, 2017 Do you have this deployed somewhere we could look at? Do you have multiple states? What does the code look like at the line with this error? If you just want to make it public for free (including the source!) you could try using https://zeit.co/now/ or CodePen. Link to comment Share on other sites More sharing options...
samme Posted January 5, 2017 Share Posted January 5, 2017 This can happen if you accidentally pass an undefined value or a value that isn't a State object into game.state.add(). Make sure you define all states first and add them last. Link to comment Share on other sites More sharing options...
Recommended Posts