buttonsrtoys Posted August 29, 2015 Share Posted August 29, 2015 I would like to start my game in a paused state with simple instructions on the screen, such as "Arrow keys to navigate, Space bar to shoot". Once the user hits one of these keys, the text would disappear and the game would start. I'm clear on showing and hiding the text. Is there a simple technique for pausing the start of the game? Most of the examples I'm finding online are more involved than what I'm looking for. Link to comment Share on other sites More sharing options...
tips4design Posted August 29, 2015 Share Posted August 29, 2015 Are you using actual game states? Than it would be easy to create a paused state or something like that. Link to comment Share on other sites More sharing options...
buttonsrtoys Posted August 29, 2015 Author Share Posted August 29, 2015 I'm not using game states currently. My game is effectively the classic Asteroids where play resets after all the targets are destroyed. The functionality's mostly there though I haven't programmed the play reset. Should I consider introducing game states? I'm not considering issuing the game. It's more of an exercise in getting up to speed on Phaser and JS. Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted August 29, 2015 Share Posted August 29, 2015 You just need to add a custom flag switching off update.create: function() {var work = false;}update: function() {if (work) {/* do */}} Link to comment Share on other sites More sharing options...
buttonsrtoys Posted August 30, 2015 Author Share Posted August 30, 2015 Thanks. So this would require editing the Phaser JS? I was hoping to avoid this, or is this what most users do? Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted August 30, 2015 Share Posted August 30, 2015 Thanks. So this would require editing the Phaser JS? I was hoping to avoid this, or is this what most users do? No, Phaser JS do not need editing. This must be done in your code. Link to comment Share on other sites More sharing options...
Horizonicblue Posted August 30, 2015 Share Posted August 30, 2015 HiHere is one example http://phaser.io/examples/v2/misc/pause-menuI think this will help you to solve your problem Initially show your instructions and make pause true in create function,use something like input.onDown to unpause the game and remove instructions. lekzd and in mono 2 Link to comment Share on other sites More sharing options...
Recommended Posts