gwartney Posted January 1, 2017 Share Posted January 1, 2017 So I have been looking at different solutions to pausing a game. And I wanted others opinions on how you guys go about doing this. As I found that when you pause it using default key input from phaser it locks up the ui and you cant unpause the game. I then ran across a solution such as the one below. But another way I have heard is just pausing the specific things that are relevant to being paused. Such as enemies and player ect. What do you guys find is the best method and do you guys have any examples that you might be able to point me to. Thank you. window.onkeydown = function(event) { if (event.keyCode == Phaser.Keyboard.P){ game.paused = !game.paused; } } Link to comment Share on other sites More sharing options...
PhasedEvolution Posted January 1, 2017 Share Posted January 1, 2017 That is a very nice solution. I did the same when I wanted to pause one of my games. I think it is better than pausing individual elements (and simpler). gwartney 1 Link to comment Share on other sites More sharing options...
gwartney Posted January 1, 2017 Author Share Posted January 1, 2017 Ok cool good to know iam on the right track then. Thanks for your input. Link to comment Share on other sites More sharing options...
Recommended Posts