wyrian/js/GameController.js
2011-02-12 02:43:29 +01:00

25 lines
528 B
JavaScript

var GameController = function(inputController, displayController) {
var that = {};
that._loopRunning = false;
that._loop = null;
that._inputController = inputController;
that._displayController = displayController;
that.start = function() {
that._loopRunning = true;
that._loop = setInterval(that.loop, 30);
};
that.stop = function() {
that._loopRunning = false;
};
that.loop = function() {
that._inputController.observe();
// add other stuff here
that._displayController.draw();
};
return that;
};