Phaser Template

by chongdashu

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.4/phaser.js"></script>

JavaScript

var game = new Phaser.Game(500, 340, Phaser.AUTO, '', {
    preload: preload,
    create: create,
    update: update,
    render: render
});

var button = null;

function preload() {

    game.load.crossOrigin = 'anonymous';
    game.load.image('player', 'http://imgur.com/oS5Q1Jx.png');
}

function create() {

    game.stage.backgroundColor = '#3498db';
    game.physics.startSystem(Phaser.Physics.ARCADE);

    // Debug Text
    text = game.add.text(
        game.world.centerX, 
        game.world.centerY + 100, "Hello, world!", {
        	"fill": "white",
        	font: "bold 12pt Consolas",
    });
    text.anchor.set(0.5, 0.5)
    
}



function update() {
  	// Updates go here
}


function render() {}