Jump to content

More questions about the Phaser workflow


Tácio Sousa
 Share

Recommended Posts

I'm here again with a little bit more questions. I want to know how i do to :

 

- Pause the game. (I've tried game.pause, game.paused, game._paused and more other pause methods and all results in error)

- Stop the game controls. (Things inside update, input checks, player moves, ...)

- Play sounds/musics.

 

I'm making a "Aero Fighters" clone, and i'll need this for the ending of every stage, something like "final stage animation". Thanks for anyone who help me.

Link to comment
Share on other sites

If you set Game.paused = true then it will enter a pause loop mode, which only calls updates on the tweens, input and stage and, if you've specified one, your own onPausedCallback. If you want to turn off the built-in pause screen then set Stage.disablePauseScreen to true.

 

Input has changed totally now and you can disable input checks easily (Input.disabled = true).

 

Sound and Music only works using Web Audio at the moment. It's being totally rewritten at the moment, but you can still use it for now if you need. Just use the Loader to load a sound, and then do Game.sound.play() and give it the key to play.

Link to comment
Share on other sites

I've tried many ways, and nothing happened. I put : 

 

 

Phaser.Stage.disablePauseScreen = true;
Phaser.Input.disabled = true;
this.game.input.keyboard.disabled = true;
this.game.inputEnabled = false;
this.game.input.disabled = true;
this.game.stage.disablePauseScreen = true;
 
And the game continues running normally together with all inputs.   :(
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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