Y.subclass over new Y.Class
authordsc <david.schoonover@gmail.com>
Wed, 24 Nov 2010 10:47:07 +0000 (02:47 -0800)
committerdsc <david.schoonover@gmail.com>
Wed, 24 Nov 2010 10:47:07 +0000 (02:47 -0800)
14 files changed:
doc/roadmap.md [new file with mode: 0644]
src/lessly/bitgrid.js
src/lessly/log.js
src/portal/layer.js
src/portal/loop/cooldown.js
src/portal/loop/fps.js
src/portal/util/tree/pointquadtree.js
src/portal/util/tree/quadtree.js
src/portal/util/tree/rbtree.js
src/tanks/config.js
src/tanks/game.js
src/tanks/map/level.js
src/tanks/ui/config.js
src/tanks/util/config.js [new file with mode: 0644]

diff --git a/doc/roadmap.md b/doc/roadmap.md
new file mode 100644 (file)
index 0000000..efb4c0c
--- /dev/null
@@ -0,0 +1,8 @@
+# Littlest Roadmap
+
+- UI for config system
+- Animations
+- Items
+- Level transitions
+- Improve friendly fire of AI
+
index 815b3b5..eb7c70c 100644 (file)
@@ -20,7 +20,7 @@ function toY(y){ return Math.floor(y/CELL_Y); }
  * TODO: Make rect() routines agnostic to cell dimensions
  * TODO: Optimize set operations
  */
-BitGrid = new Y.Class('BitGrid', {
+BitGrid = Y.subclass('BitGrid', {
     init : function init(w, h){
         this.width = w;
         this.height = h;
index 3fa7703..9d339f3 100644 (file)
@@ -1,4 +1,4 @@
-Log = new Y.Class('Log', {
+Log = Y.subclass('Log', {
     _n : 0,
     DEFAULT_OPTIONS : {
         autoScroll : true,
index bd61600..b6cd536 100644 (file)
@@ -9,7 +9,7 @@ var CONTEXT_ATTRS = Y([
 
 
 
-Layer = new Y.Class('Layer', {
+Layer = Y.subclass('Layer', {
     _cssClasses : 'portal layer',
     
     canvas   : null,
index 5ba12cd..1a61a37 100644 (file)
@@ -1,4 +1,4 @@
-Cooldown = new Y.Class('Cooldown', {
+Cooldown = Y.subclass('Cooldown', {
     'init' : function(cooldown, isReady){
         this.cooldown = cooldown; // ms
         this.ready    = isReady || true;
index 663afc8..9038237 100644 (file)
@@ -1,4 +1,4 @@
-FpsSparkline = new Y.Class('FpsSparkline', {
+FpsSparkline = Y.subclass('FpsSparkline', {
     
     init : function init(loop, el, w,h, maxBuffer, interval){
         this.buffer    = [];
index 28d2e16..38b7222 100644 (file)
@@ -39,7 +39,7 @@ LeafType = {
     }
 },
 
-Node = new Y.Class('Node', {
+Node = Y.subclass('Node', {
     init : function Node(x, y, w, h, parent) {
         this.w = w;
         this.h = h;
@@ -130,7 +130,7 @@ Range = new Y.Class('Range', Y.YCollection, {
     }
 }),
 
-Leaf = new Y.Class('Leaf', {
+Leaf = Y.subclass('Leaf', {
     toString : function toString(){
         return LeafType.toString(this.type)+'('+this.x+','+this.y+', value='+this.value+')';
     }
@@ -191,7 +191,7 @@ RangeCell = new Y.Class('RangeCell', Leaf, {
     }
 }),
 
-PointQuadTree = new Y.Class('PointQuadTree', {
+PointQuadTree = Y.subclass('PointQuadTree', {
     'init' : function(minX,minY, maxX,maxY) {
         this.x1 = this.x = minX;
         this.y1 = this.y = minY;
index 8b23c47..5f92556 100644 (file)
@@ -25,7 +25,7 @@ var
 CAPACITY  = 8,
 REGION_ID = 0,
 
-Region = new Y.Class('Region', {
+Region = Y.subclass('Region', {
     init : function init(x1,y1, x2,y2, value){
         Rect.call(this, x1,y1, x2,y2);
         this.id = REGION_ID++;
@@ -43,7 +43,7 @@ Region = new Y.Class('Region', {
     }
 }),
 
-QuadTree = new Y.Class('QuadTree', {
+QuadTree = Y.subclass('QuadTree', {
     depth    : 0,
     parent   : null,
     regions  : [],
index 1c71b2f..a5cb4e1 100644 (file)
@@ -26,7 +26,7 @@ Node.prototype.toString = function(){
 };
 
 var
-RedBlackTree = new Y.Class('RedBlackTree', {
+RedBlackTree = Y.subclass('RedBlackTree', {
     init : function init(key, value){
         if (this.key !== undefined)
             this.setKey(key, value);
index 6386908..ed61e1b 100644 (file)
@@ -1,12 +1,16 @@
 //  -*- mode: JavaScript; tab-width: 4; indent-tabs-mode: nil; -*-
 tanks.config = {
-    ui : {
-        showGridCoords : false,
-        showCountdown  : false
-    },
-    pathing : { 
-        overlayAIPaths    : true,
-        overlayPathmap    : false,
-        traceTrajectories : false
+    defaults : {
+        ui : {
+            showGridCoords : false,
+            showCountdown  : true
+        },
+        pathing : { 
+            overlayAIPaths    : false,
+            overlayPathmap    : false,
+            traceTrajectories : false
+        }
     }
 };
+
+tanks.config.values = Y(tanks.config.defaults).clone().end();
\ No newline at end of file
index b3cf024..e6cdbf0 100644 (file)
@@ -1,4 +1,4 @@
-tanks.Game = new Y.Class('Game', {
+tanks.Game = Y.subclass('Game', {
     overlayPathmap : false,
     
     
index a3c6d2b..9c050d2 100644 (file)
@@ -29,8 +29,8 @@ Level = Rect.subclass('Level', {
         
         E = 
         game.addUnit(new Tank(2), 0,1);
-        // game.addUnit(new Tank(2), 1,0);
-        // game.addUnit(new Tank(2), 8,1);
+        game.addUnit(new Tank(2), 1,0);
+        game.addUnit(new Tank(2), 8,1);
     },
     
     addWall : function addWall(x,y, w,h, isBoundary){
index 479fc9d..9076096 100644 (file)
@@ -34,7 +34,7 @@ Y.YString.prototype.splitCamel =
 // - Update tanks.config.values
 
 var ns = tanks.ui.config = {}
-,   c = tanks.config
+,   c = tanks.config.values
 ,   p = c.pathing
 ;
 
diff --git a/src/tanks/util/config.js b/src/tanks/util/config.js
new file mode 100644 (file)
index 0000000..2404089
--- /dev/null
@@ -0,0 +1,5 @@
+Config = Y.subclass('Config', {
+    
+    
+    
+});
\ No newline at end of file