wyrian/js/GameController.js

25 lines
528 B
JavaScript
Raw Normal View History

2011-02-12 00:35:54 +00:00
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);
2011-02-12 00:35:54 +00:00
};
that.stop = function() {
that._loopRunning = false;
2011-02-12 00:35:54 +00:00
};
that.loop = function() {
that._inputController.observe();
2011-02-12 00:35:54 +00:00
// add other stuff here
that._displayController.draw();
2011-02-12 00:35:54 +00:00
};
return that;
2011-02-12 00:35:54 +00:00
};