From a7974758f0d861679f4c3ec071949ef19ac6e82e Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 17 May 2010 22:23:03 -0600 Subject: [PATCH] New tanks.js to expect what we put out --- www/tanks/tanks.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/tanks/tanks.js b/www/tanks/tanks.js index f416423..7484ae5 100644 --- a/www/tanks/tanks.js +++ b/www/tanks/tanks.js @@ -43,7 +43,9 @@ function Tank(ctx, width, height, color, sensors) { this.y = y; this.rotation = rotation; this.turret = turret; - this.fire = flags & 1; + if (flags & 1) { + this.fire = 5; + } this.led = flags & 2; this.sensor_state = sensor_state; } @@ -112,8 +114,9 @@ function Tank(ctx, width, height, color, sensors) { ctx.fillRect(-7, 4, 15, 5); ctx.rotate(this.turret); if (this.fire) { - ctx.fillStyle = color; + ctx.fillStyle = ("rgba(68,204,68," + this.fire/5 +")"); ctx.fillRect(0, -1, 45, 2); + this.fire -= 1; } else { if (this.led) { ctx.fillStyle = "#f00";