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)
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"
killThing : function killThing(unit){
if (unit instanceof Event)
- unit = unit.trigger;
+ unit = unit.data.unit;
delete this.byId[unit.__id__];
this.active.remove(unit);
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;
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(){
// 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) {
// 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' })
.find('.box').html('<h1>Paused!</h1>');
// Create Victory/Defeat box
- $('#welcome').clone()
+ $('#loading').clone()
.attr('id', 'gameover')
.hide()
.appendTo( $('body') )
.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; }
-<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>