# NodeBox

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

# boids.Boids.update()

## Syntax

    flock.update(shuffled=True)

## Description

Calculates the flock of boids' next movement frame. Each time update() is called, the boids move another step in their flight pattern. The update() method shuffles the flock.boids list to ensure fluid movement of all individual boids. If you wish the boids to always retain the same position in this list, call update() with the shuffled parameter set to False.

## Example

    boids = ximport("boids")
    flock = boids.flock(10, 0, 0, WIDTH, HEIGHT)

    for i in range(10):
      flock.update()