ahead( distance )
Parameters
| Type | Description | |
| distance | numeric | amount to move forward |
_result
Not set.
Description
Moves a robot forward the amount specified by distance. If the
distance is negative, the robot moves backwards. Running into another robot
or wall causes damage of 1 energy per collision. If
movement clipping is enabled, distance is reduced to the distance the
robot can travel in a straight line without hitting a wall. If movement clipping
is disabled distance is unlimited.
After calling the ahead command, you can determine the remaining distance
using the _movermn system variable. When
a robot is moving laterally, the _moving
system variable is true. Ahead
generally requires multiple turns to complete and therefore causing blocking.
A robot's speed accelerates at the rate specified by the acceltarget
command
until it reaches the speed specified by the speedtarget command.
See Also
back, clipmoves, stopmove, stop, acceltarget, speedtarget, blocking, _movermn, _moving, _accel, _velocity