/**
* @author Chris Campbell
* @author Richard Davey
* @copyright 2015 Photon Storm Ltd.
* @license {@link http://choosealicense.com/licenses/no-license/|No License}
*
* @description This example requires the Phaser Box2D Plugin to run.
* For more details please see http://phaser.io/shop/plugins/box2d
*/var game =newPhaser.Game(800,600, Phaser.CANVAS,'phaser-example',{ preload: preload, create: create, render: render });functionpreload(){
game.load.image('ball','assets/sprites/shinyball.png');}var circle
functioncreate(){
game.stage.backgroundColor ='#124184';// Enable Box2D physics
game.physics.startSystem(Phaser.Physics.BOX2D);
game.physics.box2d.gravity.y =500;
game.physics.box2d.restitution =0.8;
game.physics.box2d.setBoundsToWorld();// Create a sprite with a Box2D physics bodyvar ball = game.add.sprite(400, game.world.centerY,'ball');
game.physics.box2d.enable(ball);// Set the Sprites body shape to a Circle with the same radius as the sprite (width / 2).
ball.body.setCircle(ball.width /2);// You can also create a Circle body directly, without binding it to a sprite:var circle = game.physics.box2d.createCircle(300,300,32);}functionrender(){
game.debug.box2dWorld();}