mirror of https://github.com/dirtbags/tanks.git
More fixes
This commit is contained in:
parent
962e08bd50
commit
dfacb42dee
4
TODO.txt
4
TODO.txt
|
@ -1,14 +1,10 @@
|
||||||
BUGS
|
BUGS
|
||||||
====
|
====
|
||||||
|
|
||||||
* Fix "random" bug
|
|
||||||
* Pull fuzzie tree
|
|
||||||
|
|
||||||
|
|
||||||
Requests
|
Requests
|
||||||
========
|
========
|
||||||
|
|
||||||
* Keep 12 hours of runs (720 runs)
|
|
||||||
* Merge devdsp fixes (https://github.com/devdsp/tanks/commits/master)
|
* Merge devdsp fixes (https://github.com/devdsp/tanks/commits/master)
|
||||||
* Fix leaderboard
|
* Fix leaderboard
|
||||||
* Read sensors from "sensors" and not "sensor[0-9]"
|
* Read sensors from "sensors" and not "sensor[0-9]"
|
||||||
|
|
2
ctanks.c
2
ctanks.c
|
@ -317,7 +317,7 @@ tanks_move_tank(struct tanks_game *game,
|
||||||
to be a penalty for having the treads go in opposite directions.
|
to be a penalty for having the treads go in opposite directions.
|
||||||
This probably plays hell with precisely-planned tanks, which I
|
This probably plays hell with precisely-planned tanks, which I
|
||||||
find very ha ha. */
|
find very ha ha. */
|
||||||
friction = .75 * (fabsf(tank->speed.current[0] - tank->speed.current[1]) / 200);
|
friction = TANK_FRICTION * (fabsf(tank->speed.current[0] - tank->speed.current[1]) / 200);
|
||||||
v[0] = tank->speed.current[0] * (1 - friction) * (TANK_TOP_SPEED / 100.0);
|
v[0] = tank->speed.current[0] * (1 - friction) * (TANK_TOP_SPEED / 100.0);
|
||||||
v[1] = tank->speed.current[1] * (1 - friction) * (TANK_TOP_SPEED / 100.0);
|
v[1] = tank->speed.current[1] * (1 - friction) * (TANK_TOP_SPEED / 100.0);
|
||||||
|
|
||||||
|
|
1
ctanks.h
1
ctanks.h
|
@ -14,6 +14,7 @@
|
||||||
#define TANK_MAX_ACCEL 35
|
#define TANK_MAX_ACCEL 35
|
||||||
#define TANK_MAX_TURRET_ROT (TAU/8)
|
#define TANK_MAX_TURRET_ROT (TAU/8)
|
||||||
#define TANK_TOP_SPEED 7
|
#define TANK_TOP_SPEED 7
|
||||||
|
#define TANK_FRICTION 0.75
|
||||||
|
|
||||||
/* (tank radius + tank radius)^2 */
|
/* (tank radius + tank radius)^2 */
|
||||||
#define TANK_COLLISION_ADJ2 \
|
#define TANK_COLLISION_ADJ2 \
|
||||||
|
|
|
@ -25,7 +25,7 @@ fn=$(printf "round-%04d.html" $next)
|
||||||
rfn=results$$.txt
|
rfn=results$$.txt
|
||||||
|
|
||||||
# Clean up old games
|
# Clean up old games
|
||||||
ofn=$(printf "round-%04d.html" $(expr $next - 20))
|
ofn=$(printf "round-%04d.html" $(expr $next - 720))
|
||||||
echo "Removing $ofn"
|
echo "Removing $ofn"
|
||||||
rm -f $ofn
|
rm -f $ofn
|
||||||
|
|
||||||
|
@ -64,8 +64,7 @@ cat <<EOF >>$fn
|
||||||
</html>
|
</html>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
summary.awk $tanks > summary.html.$$
|
summary.awk $tanks > summary.html.$$ && mv summary.html.$$ summary.html
|
||||||
mv summary.html.$$ summary.html
|
|
||||||
|
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ BEGIN {
|
||||||
print " <h2>Rounds</h2>";
|
print " <h2>Rounds</h2>";
|
||||||
print " <ul>";
|
print " <ul>";
|
||||||
getline rounds < "next-round";
|
getline rounds < "next-round";
|
||||||
for (i = rounds - 1; i >= rounds - 21; i -= 1) {
|
for (i = rounds - 1; (i >= rounds - 720) && (i > 0); i -= 1) {
|
||||||
printf("<li><a href=\"round-%04d.html\">%04d</a></li>\n", i, i);
|
printf("<li><a href=\"round-%04d.html\">%04d</a></li>\n", i, i);
|
||||||
}
|
}
|
||||||
print " </ul>";
|
print " </ul>";
|
||||||
|
|
Loading…
Reference in New Issue