Jump to content

More questions about the Phaser workflow

Tácio Sousa

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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