<h1>The Littlest Battletank</h1>
<div id="controls">
- <label for="nbullets">Num Bullets</label> <input id="nbullets" name="nbullets" value="5" type="text">
+ <label for="nbullets">Num Bullets</label> <input id="nbullets" name="nbullets" value="15" type="text">
</div>
<ul id="info" class="rounded">
if ( isNaN(n) || n === bullets.size() ) return;
while (n < bullets.size()) {
- var i = rand(0, bullets.size()-1);
+ var i = Math.round(rand(0, bullets.size()-1));
bullets.remove( bullets.attr(i).remove() );
}
LBT.root.draw();
setInterval(updateInfo, 1000);
- updateInfo();
+ // updateInfo();
+ toggleGame();
// Fix grid-size on resize
// $(window).bind('resize', resizeGame);
}
Thing.fillStats(this.stats) );
},
+ remove : function remove(){
+ if (this.shape) this.shape.remove();
+ if (this.tline) this.tline.remove();
+ if (this.game) this.game.killUnit(this);
+ return this;
+ },
+
createCooldowns : Y.op.nop,
// setLocation : function setLocation(x,y){
Tank = new Y.Class('Tank', Thing, {
projectile : Bullet,
- blocking: true,
+ blocking: false,
// Bounding box size
width : REF_SIZE*0.7,