This is another project I completed for a computer animation class at WPI, where it simulates 3 object types or "species" interacting with each other. Certain colors are attracted to certain others, and repel other colors as well.
Blue chases green, green chases red, and red chases blue. Green avoids blue, red avoids blue, and blue avoids red. if Blue catches green, it will change it's color to green, and so on with the other colors.
every object has a detection radius, if another object reaches that radius, the attraction and repelling forces get applied to the objects and their new velocities are calculated and applied as well
all objects avoid the grey square in the middle