mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
128c7143d5
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.
29 lines
572 B
JavaScript
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);
|
|
|
|
}
|