wingbase/public/js/starbugs/main.js
2016-03-21 16:15:49 +00:00

29 lines
396 B
JavaScript

'use strict';
window.addEventListener('load', init);
var game;
function init() {
game = new Game();
game.tick();
game.net.connect();
}
function Game() {
var self = this;
this.connected = false;
this.state = 'connecting';
this.net = new Net();
this.renderer = new Renderer();
this.tick = function() {
self.renderer.render(self.state);
requestAnimationFrame(self.tick);
}
}