[Home]History of SpinBotChallenge/St00pid

Robo Home | Changes | Preferences | AllPages


Revision 3 . . (edit) October 14, 2004 23:31 EST by c529c2358.cable.wanadoo.nl
Revision 1 . . October 14, 2004 2:52 EST by c529c2358.cable.wanadoo.nl
  

Difference (from prior major revision) (minor diff)

Changed: 9c9,10
* designed to participate in David Alves' SpinBotChallenge
* designed to participate in the Pez' SpinBotChallenge
* http://robowiki.net/cgi-bin/robowiki?SpinBotChallenge

Changed: 62c63,64
turnRight(angle_180(bearing - getHeading() + 90 - direction/20));
turnRight(angle_180(bearing - getHeading() + 90));
adjustForWall?();

Changed: 65c67
timetohit = getTime() + enemyDist/11 - 20;
timetohit = getTime() + enemyDist/11 - 14;

Added: 70a73,133
public void adjustForWall?()
{
double tX, tY, dX, dY;
double newHeading;
double sign;
dX = direction * Math.sin(rad(getHeading()));
dY = direction * Math.cos(rad(getHeading()));
tX = getX() + dX;
tY = getY() + dY;

if (tX>=20 && tX<=getBattleFieldWidth?()-20 && tY>=20 && tY<=getBattleFieldHeight?()-20)
return;

if (tX < 20)
{
tX = 20;
if (dY<0)
sign = -1;
else
sign = 1;
dX = 20-getX();
dY = sign * Math.sqrt(direction*direction - dX*dX);
}

if (tX > getBattleFieldWidth?()-20)
{
tX = getBattleFieldWidth?()-20;
if (dY<0)
sign = -1;
else
sign = 1;
dX = getBattleFieldWidth?()-20-getX();
dY = sign * Math.sqrt(direction*direction - dX*dX);
}

if (tY < 20)
{
tY = 20;
if (dX<0)
sign = -1;
else
sign = 1;
dY = 20-getY();
dX = sign * Math.sqrt(direction*direction - dY*dY);
}

if (tY > getBattleFieldHeight?()-20)
{
tY = getBattleFieldHeight?()-20;
if (dX<0)
sign = -1;
else
sign = 1;
dY = getBattleFieldHeight?()-20-getY();
dX = sign * Math.sqrt(direction*direction - dY*dY);
}
double turn = deg(Math.atan2(dX, dY)) - getHeading();
if (direction<0)
turn += 180;
turnRight(angle_180(turn));
}

Changed: 74c137,138
turnGunRight?(angle_180(bearing - getGunHeading?()));
if (Math.abs(bearing - getGunHeading?()) < 20)
turnGunRight?(angle_180(bearing - getGunHeading?()));

Changed: 78c142
// AdvancedRobots?, remeber?) and that the gun needs time (probably one tick
// AdvancedRobots?, remember?) and that the gun needs time (probably one tick

Added: 79a144,146
if (!(getGunHeat()<1))
return;


Added: 100a168,173
while (!(getGunHeat()<1))
{
found = false;
radar();
}
timetohit = getTime() + enemyDist/11 - 20;

Added: 103a177
found = false;

Changed: 123,124c197

</pre>
</pre>

Robo Home | Changes | Preferences | AllPages
Search: