IAdvancedRobotPeer SetMove Method Robocode Robot API for .NET
Sets the robot to move forward or backward by distance measured in pixels when the next execution takes place.

This call returns immediately, and will not execute until you call Execute  or take an action that executes.

Note that both positive and negative values can be given as input, where positive values means that the robot is set to move forward, and negative values means that the robot is set to move backward. If 0 is given as input, the robot will stop its movement, but will have to decelerate till it stands still, and will thus not be able to stop its movement immediately, but eventually.

Examples

// Set the robot to move 50 pixels forward
SetMove(50);

// Set the robot to move 100 pixels backward 
// (overrides the previous order)
SetMove(-100);

...
// Executes the last SetMove()
Execute();

Namespace: Robocode.RobotInterfaces.Peer
Assembly: robocode (in robocode.dll) Version: 1.9.2.0
Syntax

void SetMove(
	double distance
)

Parameters

distance
Type: OnlineSystem Double
The distance to move measured in pixels. If distance > 0 the robot is set to move forward. If distance < 0 the robot is set to move backward. If distance = 0 the robot is set to stop its movement.
See Also