Phaser Physics Snippets

start the physics engine
Description:starts the Arcade Physics engine

Enable an object for physics
Description:Tell Phaser to use physics on this object
Example: game.physics.enable(this.char, Phaser.Physics.ARCADE);

Set Velocity
Description:Sets the velocity of an object

Set Bounce
Description:sets the bounce for the when the object collides. 1 is 100% bounce. .5 is 50%

Set Global Gravity
Description:Sets the default gravity for all objects
Example:game.physics.arcade.gravity.y = gravityValue;

Set object gravity
Description:Sets the gravity on an individual sprite
Example:this.char.body.gravity.y = gravityValue;

set group physics
Description:Sets up a group for physics
Example://enable body for all child sprites myGroup.enableBody = true; //set the type of physics for all child sprites myGroup.physicsBodyType = Phaser.Physics.ARCADE;

set group physics
Description:allows group children to collide with each out. Place in update function