From 9b1ede17729d5f2e08ce7f78076051164bb88260 Mon Sep 17 00:00:00 2001 From: Arian Glander Date: Sat, 12 Feb 2011 01:35:54 +0100 Subject: [PATCH] basic structure --- index.html | 5 ++++- js/DisplayController.js | 7 +++++++ js/GameController.js | 26 ++++++++++++++++++++++++++ js/InputController.js | 7 +++++++ js/wyrian.js | 18 +++--------------- 5 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 js/DisplayController.js create mode 100644 js/GameController.js create mode 100644 js/InputController.js 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