elitian Posted April 11, 2016 Share Posted April 11, 2016 In this tutorial about game states, there is a part where the author says: this.game.state.start("GameOver",true,false,score); "This is the first time I am calling the state with all its arguments, so let’s have a look at them: GameOver is the name of the state to start. The second argument is called clearWorld, default at true, and clears the World display list fully (but not the Stage, so if you’ve added your own objects to the Stage they will need managing directly)." What is this "Stage" she talks about? And how would I add my "own" objects to this "Stage", in a way that the clearWorld won't clear these objects and I'll have to manage them directly? Link to comment Share on other sites More sharing options...
megmut Posted April 11, 2016 Share Posted April 11, 2016 There are plenty of good tutorials on states in phaser, like http://perplexingtech.weebly.com/game-dev-blog/using-states-in-phaserjs-javascript-game-developement Think of them as a way of breaking down your game into chunks.. you might have a state for the menu, then a state for the game, and then a state for gameover. You can pass parameters between these states, and set boolean values of the cache and clearWorld to true or false accordingly. Have a quick google, there's loads of literature on this. Nick Link to comment Share on other sites More sharing options...
Milton Posted April 11, 2016 Share Posted April 11, 2016 The Stage is the base container of display objects. Each application has one Stage object, which contains all on-screen display objects. The Stage is the top-level container and is at the top of the display list hierarchy. I'm not up to date on Phaser, but in Flash you would just addChild(sprite) or this.addChild(sprite), or even stage.addChild(sprite). quiphop 1 Link to comment Share on other sites More sharing options...
elitian Posted April 11, 2016 Author Share Posted April 11, 2016 Thanks a lot Milton! Megmut, I know what states are, I asked what the Stage is. But thanks anyway! Maybe you read State instead of Stage? haha, indeed, they are similar words. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts