Jump to content

using game.paused


gwartney
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...