I believe this fixes the periodic ghost-blocker bug.
authordsc <david.schoonover@gmail.com>
Tue, 4 Jan 2011 21:02:27 +0000 (13:02 -0800)
committerdsc <david.schoonover@gmail.com>
Tue, 4 Jan 2011 21:02:27 +0000 (13:02 -0800)
bin/deploy.sh
src/tanks/game.cjs
src/tanks/thing/thing.cjs
src/tanks/ui/main.cjs
www/css/lttl.css
www/welcome.html

index 7452616..11fd870 100755 (executable)
@@ -2,7 +2,7 @@
 
 VERBOSE=""
 SRC="src/Y src/ezl src/tanks"
-EXCLUDE="--exclude=$(join ' --exclude=' 'tmp' 'src' 'bin' $*)"
+EXCLUDE="--exclude=$(join ' --exclude=' 'tmp' 'src' 'bin' 'assets' $*)"
 GIT_VERSION=$(git show --oneline . | head -n1 | cut -d ' ' -f 1)
 
 
@@ -75,13 +75,14 @@ echo "hokay"
 
 if test "$CLEAN"; then
     printf "Cleaning and rebuilding...\t\t"
-    commonjs $SRC $CLEAN || fail "Error cleaning project!"
+    paver -q clean || fail "Error cleaning project!"
     echo "hokay"
 fi
 
 printf "Building and generating dep-graph...\t"
-commonjs $SRC --script-tags > www/deps.html || fail "Error building modules!"
-sed -E 's|src="build/([^"]+)"|src="build/'$GIT_VERSION'/\1"|' www/deps.html > www/versioned-deps.html
+paver -q build || fail "Error building modules!"
+echo "<script>BUILD='$GIT_VERSION';</script>" > www/versioned-deps.html
+sed -E 's|src="build/([^"]+)"|src="build/'$GIT_VERSION'/\1"|' www/deps.html >> www/versioned-deps.html
 echo "hokay"
 
 printf "Uploading files...\t\t\t"
index 20d5e6e..d397fcd 100644 (file)
@@ -165,7 +165,7 @@ Y.subclass('Game', {
     
     killThing : function killThing(unit){
         if (unit instanceof Event)
-            unit = unit.trigger;
+            unit = unit.data.unit;
         
         delete this.byId[unit.__id__];
         this.active.remove(unit);
@@ -181,6 +181,7 @@ Y.subclass('Game', {
     
     moveThingTo : function moveThingTo(agent, x,y){
         this.pathmap.removeBlocker(agent);
+        if (agent.dead) return agent;
         agent.position(x,y);
         this.pathmap.addBlocker(agent);
         return agent;
index f8c2305..b04aa59 100644 (file)
@@ -109,7 +109,7 @@ new evt.Class('Thing', {
     destroy : function destroy(){
         if (this.dead) return this;
         this.dead = true;
-        return this.remove().fire('destroy', this);
+        return this.remove().fire('destroy', this, { 'unit':this });
     },
     
     remove : function remove(){
index 7f42c80..fdd5f41 100644 (file)
@@ -23,7 +23,7 @@ qkv = Y(window.location.search.slice(1)).fromKV();
 // Main method is only executed once, so we'll setup things
 // that don't change between games.
 function main(){
-    $('#welcome').center().hide();
+    $('#loading').center();
     
     /// Debug ///
     if (qkv.ai) {
@@ -56,16 +56,8 @@ function main(){
     // Build and bind config
     configui.init();
     
-    // Create #loading box
-    $('#welcome').clone()
-        .attr('id', 'loading')
-        // .hide()
-        // .css({ 'top':'1em', 'left':'1em', 'margin':0, 'width':'auto' })
-        .appendTo( $('body') )
-        .find('.box').html('<h1>Loading...</h1>');
-    
     // Create #pause box
-    $('#welcome').clone()
+    $('#loading').clone()
         .attr('id', 'pause')
         .hide()
         .css({ 'top':'1em', 'left':'1em', 'margin':0, 'width':'auto' })
@@ -73,7 +65,7 @@ function main(){
         .find('.box').html('<h1>Paused!</h1>');
     
     // Create Victory/Defeat box
-    $('#welcome').clone()
+    $('#loading').clone()
         .attr('id', 'gameover')
         .hide()
         .appendTo( $('body') )
index beac57f..2d6d3b2 100644 (file)
@@ -37,6 +37,8 @@ td { text-align:center; vertical-align:middle; }
 
 .countdown { position:fixed; overflow:hidden; z-index:2000; text-align:center; border:10px solid #fff; color:#fff; }
 
+#loading h2 { text-align:center; }
+
 #welcome .box { cursor:pointer; }
 #notes { /* position:fixed; top:4em; right:1em; color:#BFBFBF;*/ }
     #notes ul, #notes ol, #notes li { list-style:circle ! important; }
index 819ffa9..d2c140a 100644 (file)
@@ -1,4 +1,12 @@
-<div id="welcome" class="bigblue">
+<div id="loading" class="bigblue">
+    <div class="box hud">
+        <h1>The Littlest Battletank</h1>
+        
+        <h2>Loading...</h2>
+    </div>
+</div>
+
+<div id="welcome" class="bigblue" style="display:none">
     <div class="box hud">
         <h1>The Littlest Battletank</h1>