Created
March 15, 2016 19:18
-
-
Save kdbanman/ddbe02be7d0a0ad1c588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = require('jquery'); | |
var Logger = require('polyball/shared/Logger'); | |
var Physics = require('physicsjs'); | |
var Model = require('polyball/shared/Model'); | |
var Comms = require('polyball/client/Comms'); | |
$(document).ready(function() { | |
var model = new Model(); | |
var comms = new Comms(); | |
var gameRenderer = new GameRenderer({ | |
model: model | |
}); | |
var hud = new HUD(); | |
var synchronizer = new Synchronizer({ | |
comms: comms, | |
model: model | |
}); | |
Physics.util.ticker.on(function( time ) { | |
// if it is time to render: | |
gameRenderer.render(); | |
// if it is time to tick: | |
synchronizer.tick() | |
}); | |
}); // end on DOM ready |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment