diff --git a/index.html b/index.html index 351eaae..0fab6b1 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,9 @@
- + + + + diff --git a/js/DisplayController.js b/js/DisplayController.js new file mode 100644 index 0000000..7d10e59 --- /dev/null +++ b/js/DisplayController.js @@ -0,0 +1,7 @@ +var DisplayController = function() { + + + this.draw = function() { + + }; +}; \ No newline at end of file diff --git a/js/GameController.js b/js/GameController.js new file mode 100644 index 0000000..0ad8a85 --- /dev/null +++ b/js/GameController.js @@ -0,0 +1,26 @@ +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(); + }; + + +}; \ No newline at end of file diff --git a/js/InputController.js b/js/InputController.js new file mode 100644 index 0000000..913a85b --- /dev/null +++ b/js/InputController.js @@ -0,0 +1,7 @@ +var InputController = function() { + + + this.observe = function() { + + }; +}; \ No newline at end of file diff --git a/js/wyrian.js b/js/wyrian.js index e2f2bc3..b79ea38 100644 --- a/js/wyrian.js +++ b/js/wyrian.js @@ -1,21 +1,9 @@ -var DisplayController = function() { - -}; - -var InputController = function() { - -}; - -var GameController = function() { - -}; - - var Wyrian = function() { // do basic initializations - var inputController = new InputController(), + var inputController = new InputController(), displayController = new DisplayController(), gameController = new GameController(inputController, displayController); - + + gameController.start(); }(); \ No newline at end of file