【发布时间】:2022-06-11 00:40:54
【问题描述】:
【问题讨论】:
标签: phaser-framework
【问题讨论】:
标签: phaser-framework
您可以使用函数this.physics.world.setBounds(...) 设置自定义世界边界。
Here a link to the documentation.
因此,您只需将这一行放入您的代码中:
`this.physics.world.setBounds(0, 0, widthOfTheGame, heightOfTheGame, true, true, false, true);`.
在create 函数中。
按照文档
setBounds(x, y, width, height [, checkLeft] [, checkRight] [, checkUp] [, checkDown])
第三个false 用于world-bounds-top,因此不会发生碰撞。
【讨论】: