Permalink
Browse files

Working on screen creation

  • Loading branch information...
1 parent b0c3933 commit 9c3f7d7fe0fb0ed3fbf5ad3904c61b4afe16fb2e @OrganicPanda committed Apr 10, 2012
Showing with 9 additions and 6 deletions.
  1. +5 −5 public/js/Squabble/Game.js
  2. +4 −1 public/js/Squabble/Screen/Base.js
View
@@ -2,7 +2,7 @@
var Squabble = Squabble || {};
// Squabble Game Class. Used to start and manage a game of Squabble
-Squabble.Game = function(settings) {
+Squabble.Game = function(gameElement, settings) {
// Apply args
this.settings = settings || {};
@@ -19,10 +19,10 @@ Squabble.Game = function(settings) {
this.util = Squabble.Util;
this.dom = Squabble.Dom;
this.screen = {
- splash : new Squabble.Screen.Splash(this),
- menu : new Squabble.Screen.Menu(this),
- score : new Squabble.Screen.Score(this),
- board : new Squabble.Screen.Board(this)
+ splash : new Squabble.Screen.Splash(this, this.selector('', gameElement)),
+ menu : new Squabble.Screen.Menu(this, this.selector('', gameElement)),
+ score : new Squabble.Screen.Score(this, this.selector('', gameElement)),
+ board : new Squabble.Screen.Board(this, this.selector('', gameElement))
};
this.currentScreenId = null;
@@ -3,11 +3,14 @@ var Squabble = Squabble || {};
Squabble.Screen = Squabble.Screen || {};
// Squabble Base Screen Class. Extend to create a screen
-Squabble.Screen.Base = function(game) {
+Squabble.Screen.Base = function(game, screenElement) {
// Store our game controller
this.game = game;
+ // Store the DOM element that represents this screen
+ this.element = screenElement;
+
};
// Show this screen

0 comments on commit 9c3f7d7

Please sign in to comment.