Workshop › Angry Birds-style Slingshot › Step 27 of 47
After moving the bodies, step checks every pair of bodies once with collide. Now the beam rests on the posts and
the bird can knock the tower.
```js
for (let i = 0; i < bodies.length; i++) for (let j = i + 1; j < bodies.length; j++) collide(bodies[i], bodies[j])
```i goes over every body, j over every body after i.j at i + 1 tries each pair only once and never a body with itself.In step, after the for loop that moves the bodies and before the // Fallen off the world comment, write the
line.
Skills: Collision detection, Loops