phaser/examples/wip/pausetime.js
photonstorm 128c7143d5 Lots more physics tests and updates.
PLEASE DO NOT upgrade to this release if you need your game working and it uses any of the physics functions, as they're nearly all broken here.
Just pushing up so I can share it with someone.
2014-01-20 20:14:34 +00:00

29 lines
572 B
JavaScript

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { create: create, render: render });
function create() {
game.onPause.add(onGamePause, this);
game.onResume.add(onGameResume, this);
}
function onGamePause() {
console.log('game paused at ' + this.time.now);
}
function onGameResume() {
console.log('game un-paused at ' + this.time.now);
console.log('was paused for ' + game.time.pauseDuration);
}
function render() {
game.debug.renderText('now: ' + game.time.now, 32, 32);
game.debug.renderText('paused: ' + game.paused, 32, 64);
}