Skip to main content

Backwards

Moves backwards a specified number of steps.

Backwards block

Description

The Backwards block moves the agent in Spaceland in the heading opposite that which it is facing. The renderer tweens the movement such that it appears the agent changes location smoothly instead of instantaneous. This is a code block part of the Movement drawer.

Usage

The Backwards block moves the agent in Spaceland in the heading opposite that which it is facing. The renderer tweens the movement such that it appears the agent changes location smoothly instead of instantaneous.

Syntax

Inputs in this block:

  • A number (number of steps to move backwards)
Backwards block syntax

Example

While the forever button is toggled, the turtle agents wander throughout spaceland randomly, turning by a random amount and moving forwards. However, a button, called 'Reverse,' can make the turtles move backwards instead. Pressing the 'Reverse' button twice will set the turtles moving forwards again.

Backwards example code

Notes

Because of the tweening effect, certain interactions can cause confusion. Click here to read more on how tweening can create confusing scenarios.