Module

03

Particles

/ Lesson

03.6

Flocking in three rules

18

min

Separation, alignment, cohesion.

03.6Flocking in three rules
Intro
▶
04:12 / 18:00

Preview renders the module’s sketch live. Drop your lesson video into the player’s Video field to replace it.

Space to play · ← → to seek

( The code )

The line that does the work.

sketch.js

v.add(sep).add(ali).add(coh)

Open the Lab from the player and change the numbers in this line first.

( What it draws ) One render of this module’s sketch.

In this lesson

Separation, alignment, cohesion. We build it live in about 18 minutes, then you change it in the Lab until it is yours.

Try this after

Change one number at a time and write down what it did. Most of the good surprises in this course come from the third or fourth change, not the first.

( In this module )

Keep going.

← Previous lesson

Trails and fading

Next lesson →

Curl noise

Create a free website with Framer, the website builder loved by startups, designers and agencies.