1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| public int TakeStep()
{
Vec2 ball;
long T;
T = abstract_robot.getTime();
// Get the vector to the ball
ball = abstract_robot.getBall(T);
// Point ourselves to it
abstract_robot.setSteerHeading(T, ball.t);
// Go to it (maximum speed)
abstract_robot.setSpeed(T, 1.0);
// If we can kick it, do so!
if (abstract_robot.canKick(T)) abstract_robot.kick(T);
return(CSSTAT_OK);
}
|