Jump to content

Sound muteOnPause problem


damager
 Share

Recommended Posts

Okay, i don't know who is fixing bugs on phaser. But that was definately bug. I add code of checking boolean "muteOnPause", cause that checking was only in Stage Visability handler, not in game pause setter. I think that there's can be another variable like "muteOnDomPause" and "muteOnPause".

set: function (value) {

    if (value === true)
    {
        if (this._paused === false)
        {
            this._paused = true;
            if (this.sound.muteOnPause)
            {
                this.sound.setMute();
            }
            this.time.gamePaused();
            this.onPause.dispatch(this);
        }
        this._codePaused = true;
    }
    else
    {
        if (this._paused)
        {
            this._paused = false;
            if (this.sound.muteOnPause)
            {
                this.sound.unsetMute();
            }
            this.input.reset();
            this.time.gameResumed();
            this.onResume.dispatch(this);
        }
        this._codePaused = false;
    }

}

P.S In my game i did the next thing: i create 2 variables: muteOnDOMPause and muteOnPause. and every usage of previous of muteOnPause i change as muteOnDOMPause, and in setter of game pause  and only there i use muteOnPause; In game i can actually choose what kind of mute i need

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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