Skip to content

Instantly share code, notes, and snippets.

@kdbanman
Created March 15, 2016 19:18
Show Gist options
  • Save kdbanman/ddbe02be7d0a0ad1c588 to your computer and use it in GitHub Desktop.
Save kdbanman/ddbe02be7d0a0ad1c588 to your computer and use it in GitHub Desktop.
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