Physics

Class: Phaser.Physics

Constructor

new Physics(game, physicsConfig)

The Physics Manager is responsible for looking after all of the running physics systems.
Phaser supports 4 physics systems: Arcade Physics, P2, Ninja Physics and Box2D via a commercial plugin.

Game Objects (such as Sprites) can only belong to 1 physics system, but you can have multiple systems active in a single game.

For example you could have P2 managing a polygon-built terrain landscape that an vehicle drives over, while it could be firing bullets that use the
faster (due to being much simpler) Arcade Physics system.

Parameters
Name Type Argument Default Description
登录查看完整内容