diff --git a/BUGS b/BUGS deleted file mode 100644 index 54823b6..0000000 --- a/BUGS +++ /dev/null @@ -1,2 +0,0 @@ -* 90° angle bug -* results list isn't sorted diff --git a/ctanks.c b/ctanks.c index 28190b5..2386f3f 100644 --- a/ctanks.c +++ b/ctanks.c @@ -305,9 +305,15 @@ tanks_move_tank(struct tanks_game *game, v[1] = tank->speed.current[1] * (1 - friction) * (TANK_TOP_SPEED / 100.0); /* Outside and inside speeds */ - So = max(v[0], v[1]); - Si = min(v[0], v[1]); - dir = (v[0] > v[1]) ? 1 : -1; + if (fabsf(v[0]) > abs(v[1])) { + Si = v[1]; + So = v[0]; + dir = 1; + } else { + Si = v[0]; + So = v[1]; + dir = -1; + } /* Radius of circle to outside tread (use similar triangles) */ r = So * (TANK_RADIUS * 2) / (So - Si); diff --git a/intro.html b/intro.html index 0097c55..c59f48c 100644 --- a/intro.html +++ b/intro.html @@ -130,7 +130,7 @@ get-turret 12 + set-turret! ( Rotate turret )
Turret angle can be set between -359° and 359°, with 0° directly in front of the tank. Be aware that it takes time for the - turret to swing around: the turret can swing about 60° per turn. + turret to swing around: the turret can swing about 18° per turn.
Cannon range and recharging
diff --git a/run-tanks.c b/run-tanks.c index 0dfb800..1eb1b93 100644 --- a/run-tanks.c +++ b/run-tanks.c @@ -421,12 +421,12 @@ print_rounds(FILE *f, flags |= 2; } fprintf(f, " [%d,%d,%.2f,%.2f,%d,%d],\n", - (int)(t->position[0]), - (int)(t->position[1]), - t->angle, - t->turret.current, - flags, - sensors); + (int)t->position[0], + (int)(t->position[1]), + t->angle, + t->turret.current, + flags, + sensors); } } fprintf(f, "],\n");