AdvancedRobot SetBack Method Robocode Robot API for .NET
Sets the robot to move back 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 back, and negative values means that the robot is set to move ahead. 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 back
SetBack(50);

// Set the robot to move 100 pixels ahead 
// (overrides the previous order)
SetBack(-100);

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

Namespace: Robocode
Assembly: robocode (in robocode.dll) Version: 1.9.3.0
Syntax

public void SetBack(
	double distance
)

Parameters

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