GameLib.D3.Game = function ( ) { this.scenes = {}; }; GameLib.D3.Game.prototype.addScene = function( scene, identifer ) { this.scenes[identifer] = scene; }; GameLib.D3.Game.prototype.processPhysics = function ( timestep ) { for(var s in this.scenes) { var scene = this.scenes[s]; for(var w in scene.worlds) { var world = scene.worlds[w]; world.step(timestep); } } }; GameLib.D3.Game.prototype.render = function( dt, renderer, camera ) { for(var s in this.scenes) { var scene = this.scenes[s]; scene.render(dt, renderer, camera); } }; GameLib.D3.Game.prototype.update = function( dt ) { for(var s in this.scenes) { var scene = this.scenes[s]; for(var w in scene.worlds) { var world = scene.worlds[w]; world.step(dt); } scene.update(dt); scene.lateUpdate(dt); } };