Skip to main content

Scatter Everyone

Sets all the agents' locations to random positions in SpaceLand.

Scatter Everyone block

Description

The Scatter Everyone block sets all agents' locations to random positions in SpaceLand. This is a code block part of the agents drawer.

Usage

Scatter Everyone is used to scatter all agents in SpaceLand to random locations.

Note: If this block is used in a breed tab where more than one agent of that breed exists, each individual agent of this breed will scatter everyone once. For example, if there are five agents of the breed, everyone will be scattered 5 times as each individual agent runs the code.

Syntax

This block has no inputs.

(in reference to every agent) scatter everyone

Example

The scatter everyone block scatters all agents in spaceland by assigning each one random x and y coordinates. If this block is called by The World, all agents are scattered once.

Scatter Everyone example code

Notes

An important difference between scatter everyone and scatter is that scatter scatters only the agents attached to the scatter block. Scatter everyone scatters all agents in SpaceLand.

  • Scatter - Scatters only the agents executing the block