This is a flocking class I created for iPhone.
After a 20 seconds or so you can see how they interact and push/pull from each other.

I've created an example project with this class, which can be downloaded here:
onedayitwillmake.com/blog/2010/09/post-a-day-4-objective-c-flocking-behaviorsboid-class/

Loading more stuff…

Hmm…it looks like things are taking a while to load. Try again?

Loading videos…