Libraries‎ > ‎Library‎ > ‎Movement‎ > ‎

Turn

BehaviourComposer: ignore everything before this.

Begin micro-behaviour

Begin description:
Turn a specified number of degrees to change my heading.
End description

Turn

Begin NetLogo code:
substitute-text-area-for rotation-angle 10turn-right rotation-angle
End NetLogo code

Variants

You can change the contents of the text area to another number or the value of a parameter (see Parameter). Using a negative value will turn left instead. For example, if you want to turn a random amount left or right up to 10 degrees you can use

random-number-between -10 10
You can enhance this behaviour to occur repeatedly by clicking on the 'Enhance' menu item.

Related Micro-behaviours

Jump forward moves forward using the heading changed by this behaviour. There are many movement behaviours in the main library.

How this works

This uses turn-right, a Behaviour Composer NetLogo command.

History

Turn was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.