wyrian/guiltouf/js/GameController.js
2011-02-12 15:55:38 +01:00

26 lines
500 B
JavaScript

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