Awesome code & Sam’s trial & error(s)

Hi everyone!

I found some awesome demos while trying to figure out what I could do for my assignment. I miserably tried to manipulate code for hours…thinking I could simply look at a flocking code and other notes and synthesize a predator from which the boids would flee from. But, a challenge it was and a challenge it has remained. View a screen capture of everything here.

Here are some awesome demos:

Particles with Attraction and Repulsion Forces

Flocking with predators

I managed to integrate my ball into the flocking code found on processing (see below), but I couldn’t figure out how to code such that the flock would flee from the ball as well. So, I just pretended that this was a game and the user’s purpose was to avoid the flock with the mouse.

Ideally, one would create another function that tells the flock to avoid the x and y position of the ball (plus its diameter I assume) at any times.

Furthermore, I changed the class’s original multi-ball animation script by adding some color coding (see below). I just wrote another function and incorporated it.

Comments are closed.