我正在尝试为我的游戏中的精灵启用 P2JS 物理引擎,并且game.physics.enable
似乎只适用于 Arcade 物理引擎。这里发生了什么?
例子:
player.body
//=> null
game.physics.enable(player, Phaser.Physics.P2JS, true)
//=> undefined
player.body
//=> null
game.physics.enable(player, Phaser.Physics.NINJA, true)
//=> undefined
player.body
//=> null
game.physics.enable(player, Phaser.Physics.ARCADE, true)
//=> undefined
player.body
//=> b.Physics.Arcade.Body {sprite: Player, game: b.Game, type: 0, offset: b.Point, position: b.Point…}