Home > code > pyboids!

pyboids!

August 6th, 2005 ahmedre

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!

Categories: code Tags:
  1. Sajid
    August 8th, 2005 at 09:31 | #1

    Ahmed!!!!

    You’re back. Yay!

  2. August 9th, 2005 at 21:59 | #2

    yup, sure am :)

  1. No trackbacks yet.
Comments are closed.