sliding( set )


Parameters

  Type Description
set boolean enable or disable movement sliding

_result

Not set.

Descriptions

Note: Sliding is an advanced command because it requires an understanding of command blocking. When creating your first robots you may want to avoid sliding.

This command enables or disables movement sliding depending upon the value of the set parameter. If set evaluates to true, sliding is enabled. When enabled sliding allows a robot to rotate its body while it is moving without affecting the direction of movement. If set evaluates to false, sliding is disabled. When sliding is disable a robot will move in a curve if it rotates its body while moving. 

When a new match is created, sliding can be prevented altogether under the Advanced tab of the New Match window. When a match is created with sliding not allowed, the sliding command has no affect. In other words, if the settings for a match does not allow sliding a robot can not enable it. If a match allows sliding, however, a robot can selectively enable or disable sliding for itself.

In older versions of Robot Battle the ability to slide was a bug. This bug became popular, however, so sliding is now a supported feature that can be disabled per match for those who do not like it. 

The following is a simple example of a robot that slides. In order to slide, a robot must disable command blocking and then issue overlapping movement and rotation commands. While not included in this example, a robot could then use the waitfor command to determine when the movement and rotation completed.

lockall( on )
sliding( on )

blocking( off )
ahead( 250 )
bodyright( 90 )

See Also

blocking, waitfor, ahead, back, bodyleft, bodyright