How I can change the parameters in my game in real time?

Hello everyone! I want to know how I can change the parameters in my game in real time, through the browser console or from somewhere else? maybe through a call to the window or game variable, or is there some special function that allows the data in the update () function of my game to be changed after it has been updated? For example my update():

update() {
        if (this.isStart) this.player.move(this.cursors)
    }

You can do

window.game = new Phaser.Game(/*…*/);

but you still need to get to the scene so you would do

function init () {
  window.playScene = this;
}

Or you can use something like

1 Like