This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, add your sprite and enable physics on it | |
sprite = game.add.sprite(game.world.centerX, game.world.centerY); | |
game.physics.p2.enable(this.sprite); | |
// Create a shape | |
var circObj = new Phaser.Circle(0, 0, 25); | |
// Set the body size of your sprite | |
sprite.body.setCircle(circObj._radius, 0, 0); | |
// Draw the graphics | |
var ring = game.add.graphics(); | |
ring.lineStyle(2, 0x000000, 0.25); |