Hold shift while clicking flag. Starting from random positions, birds soon flock. Separate flocks of predator and prey form.
My variation of the "Boids" model: Boids follow three rules: align, cohere, and separate. There is no leader, yet flocking emerges. Boids only see nearby neighbors, not the whole flock, but the group self-organizes. But we use two separate types of Boid. Each flocks separately, and one type of Boid eats the other. Each type of Boid has separate but parallel variables. I added wing flapping and wind for effect. The original Boids model is by Craig Reynolds. One fun application was bat swarms in the move Batman Returns. Thanks to boltoncode for scratch coding ideas. See our variant, flocking segregation, with red and blue birds on https://lifepatternsemerging.com Eagle from wikimedia commons, GIF by Rovsen.vahabov (Eagles don't really flock, but hard to find good animated birds) Pidgeon from wikimedia commons, GIF by Gadgetroid