Hello World Phaser Example

Kudos Thomas Palef: http://www.lessmilk.com/ http://blog.lessmilk.com/how-to-make-flappy-bird-in-html5-1/

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.3.0/phaser.js"></script>
<div id="game_div"> </div>

JavaScript

var game = new Phaser.Game(500, 500, Phaser.CANVAS, 'throbber-example', { create: create, update: update });

function create() {
	  game.stage.backgroundColor = "#ffffff";

    var circle = game.add.graphics(game.world.centerX, game.world.centerY);

    this.arc = game.add.graphics(game.world.centerX, game.world.centerY);

    circle.lineStyle(30, 0xeeeeee);
    circle.arc(0, 0, 200, 0, Math.PI * 2, false);

		this.length = 1.5
    this.arc.lineStyle(30, 0x4facf4);
    this.arc.arc(0, 0, 200, 0, this.length, false);
}

function update() {
		this.arc.angle += 5;
    
    if (this.length < 2.5) {
    		this.length += 0.1
    } else {
    		this.length -= 0.1
    }
    
    this.arc.arc(0, 0, 200, 0, this.length, false);
}