Fix js bug introduced in last commit

This commit is contained in:
Neale Pickett 2010-03-03 13:43:42 -07:00
parent 2d023d167f
commit 4dd0b01f5b
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ function Tank(ctx, width, height, color, sensors) {
var craterStroke = torgba(color, 0.5); var craterStroke = torgba(color, 0.5);
var craterFill = torgba(color, 0.2); var craterFill = torgba(color, 0.2);
var sensorStroke = torgba(color, 0.4); var sensorStroke = torgba(color, 0.4);
var maxlen = 0;
this.x = 0; this.x = 0;
this.y = 0; this.y = 0;
@ -31,6 +32,9 @@ function Tank(ctx, width, height, color, sensors) {
this.sensors[i][1] = s[1] - (s[2]/2); this.sensors[i][1] = s[1] - (s[2]/2);
this.sensors[i][2] = s[1] + (s[2]/2); this.sensors[i][2] = s[1] + (s[2]/2);
this.sensors[i][3] = s[3]?1:0; this.sensors[i][3] = s[3]?1:0;
if (s[0] > maxlen) {
maxlen = s[0];
}
} }
// Set up our state, for later interleaved draw requests // Set up our state, for later interleaved draw requests