Phaser current version test environment

Basic Phaser setup for testing

by Lewis Lane

HTML

<script src="https://rawgit.com/photonstorm/phaser/master/build/phaser.min.js"></script>
<div id="test"></div>

JavaScript

// Phaser current version test environment
// Mouse position

var game = new Phaser.Game(500, 400, Phaser.AUTO, 'test');

var BasicGame = function(game) {};

BasicGame.Boot = function (game) {
    // nothing here
};

// initialise up our endTime var
var endTime = 0;

BasicGame.Boot.prototype = 
{
    preload: function() {
      game.time.advancedTiming = true;
    },
	create: function() 
	{

    },
    update: function() 
    {

    }, 
    render: function()
    {        
        game.debug.text(game.time.fps || '--', 2, 14, "#00ff00");
        game.debug.text(Phaser.VERSION, game.world.width - 55, 14, "#ffff00");
        var pos = game.input.activePointer.position;
        game.debug.text("x:" + pos.x + " y:" + pos.y, 180, 200);
    }
};

game.state.add('Boot', BasicGame.Boot);
game.state.start('Boot');