在Phaser-3框架中,有什么方法可以暂停运行游戏并恢复(使用按钮)吗?给出的Phaser-2不起作用.
发布于 2018-06-23 14:53:10
在phaser3中,可以有几个场景并行运行。因此,您可以创建一个新的场景与简历按钮,并暂停当前的场景。如果你有两个场景A,e,B,你可以:
# In scene A
this.scene.launch('sceneB')
this.scene.pause();
# Then in sceneB, you can return to sceneA:
button.on('pointerdown', function() {
this.scene.resume('sceneA');
this.scene.stop();
})发布于 2018-08-21 17:03:31
如果您只有默认场景,请调用game.scene.pause("default")。如果你有更多像这样叫它game.scene.pause(sceneKey)。
博士网址:https://photonstorm.github.io/phaser3-docs/Phaser.Scenes.SceneManager.html
发布于 2020-10-06 07:28:44
如果您只想冻结一个字符,可以使用this.sprite.body.moves = false;
https://stackoverflow.com/questions/50988219
复制相似问题