pyboids!Aug 6, 2005 · 1 minute read · Comments
greets. so these few days, i’ve been playing around with the boids algorithm, trying to write a simple implementation. i finally succeeded in doing so, in python, in under 125 lines. its pretty simple though but really cool.
boids is a “distributed behavioral model,” representing how birds fly or fish swim or whatnot. that link is a pretty good discussion of the algorithm, and this page has some pseudo code for the algorithm.
the really cool thing is how changing the rules really affects where the objects go. so for now, my implementation uses pygame and uses boxes rather than birds.
here is a picture:
oh yeah! and i am posting using drivel! - it seems to works great!