mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Added onStepCallback to Game step.
This commit is contained in:
parent
b438c0ead8
commit
0589effa22
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,7 @@ var Class = require('../utils/Class');
|
||||||
var Config = require('./Config');
|
var Config = require('./Config');
|
||||||
var DebugHeader = require('./DebugHeader');
|
var DebugHeader = require('./DebugHeader');
|
||||||
var Device = require('../device');
|
var Device = require('../device');
|
||||||
|
var NOOP = require('../utils/NOOP');
|
||||||
|
|
||||||
var AddToDOM = require('../dom/AddToDOM');
|
var AddToDOM = require('../dom/AddToDOM');
|
||||||
var DOMContentLoaded = require('../dom/DOMContentLoaded');
|
var DOMContentLoaded = require('../dom/DOMContentLoaded');
|
||||||
|
@ -79,6 +80,8 @@ var Game = new Class({
|
||||||
*/
|
*/
|
||||||
this.loop = new TimeStep(this, this.config.fps);
|
this.loop = new TimeStep(this, this.config.fps);
|
||||||
|
|
||||||
|
this.onStepCallback = NOOP;
|
||||||
|
|
||||||
// Wait for the DOM Ready event, then call boot.
|
// Wait for the DOM Ready event, then call boot.
|
||||||
DOMContentLoaded(this.boot.bind(this));
|
DOMContentLoaded(this.boot.bind(this));
|
||||||
|
|
||||||
|
@ -129,6 +132,8 @@ var Game = new Class({
|
||||||
|
|
||||||
// Scenes
|
// Scenes
|
||||||
|
|
||||||
|
this.onStepCallback();
|
||||||
|
|
||||||
for (var i = 0; i < active.length; i++)
|
for (var i = 0; i < active.length; i++)
|
||||||
{
|
{
|
||||||
active[i].scene.sys.step(time, delta);
|
active[i].scene.sys.step(time, delta);
|
||||||
|
|
Loading…
Reference in a new issue