# NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

# Boids

## Description

The Boids library provides features to implement coordinated animal motion such as bird flocks and fish schools. The code is based on Craig W. Reynolds flocking model and Conrad Parker's pseudocode.

Essentially, a boid, a single element in the flock, has three simple steering behaviours:

- Separation: steer to avoid crowding local flockmates
- Alignment: steer towards the average heading of local flockmates
- Cohesion: steer to move towards the average position of local flockmates

The beauty of it is that the flock doesn't have a predefined flight path, or any math describing its motion; a flock is totally and naturally self-organising.

## Download

| boids.zip (5KB) Last updated for NodeBox 1.0rc4.

## Commands in the Boids library

- flock()
- Boids.update()
- Boids.scatter()
- Boids.goal()
- Boids.nogoal()
- Boids.boids[]

## Example

Play movie