Arcade physics generic solid color shapes?

You can use this.physics.add.existing to create a body on any game object. You can then access the body - and its methods like setVelocityX and setCollideWorldBounds - on the gameObject.body property.

The game objects created by physics.add.image just contain additional methods that delegate down to the body property. They exist for convenience and are not the general way of working with bodies.

1 Like