interactive pigeon poop

an old experiment with flash, BitmapData & AMFPHP

In 2006, I tore my meniscus doing Capoeira. After surgery, I was tied to a reclining chair for a while and needed a project. It was the perfect opportunity to try a project with AMFPHP, an Open Source architecture built to make it easy for Flash to send data to, or get data from, a server. Before hand I had always relied on my colleague and friend Spencer Sanchez to code all the back end stuff. This was the perfect opportunity to learn a new and useful tool.

I had found the pigeon graphic and animation (essentialy “the trailer”) in my archives. I originally made them for a lecture I did on basic MovieClip Tweening the semester I taught “Interactive Multimedia Development” (i.e. Flash) at UMass. Old stuff recycled.

So the initial experiment was in saving and retrieving. A brief overview. Each poop is stored as a simple set of properties: the name of the little splooge animation (there are only four to choose from), its position, scale, and rotation (which is why they look varied). Smudges are even simpler. They’re stored as a single points. How is a smudge only one point? When the user clicks and drags on the drawing, the smudge is made by grabbing a circular group of pixels from the last position of the mouse (a point) and adding them to the new point at 50% opacity… Thus it fades out as the user drags. So all that’s needed to remember the smudge is a single point, even though it changes many more points on the screen. Cool. It’s all because we’re not storing the final image, we’re storing the artist’s drawing process.

The benefit of AMFPHP is that I can send over Poop and Smudge objects over the wire… I don’t have to serialize or deserialize the data manually, meaning that if I wanted to add a property like color to poops and have it saved as well, the changes would be minimal. For this and many other reasons (a nice sandbox and debugging environment to name a few), I highly recommend AMFPHP.

When I decided to add the smudge feature, I googled “coding smudge tool,” and thus found the strategy I used, described ever so generously by this guy who shared his ideas. He’s got other interesting stuff regarding coding for iPhone apps if you have a geeky code side.

so………………… if you’re too timid to try creating a “drawing” yourself, I made a few in the gallery (and it seems a few folks have added a few:). When you select a piece in the gallery, the program actually redraws it as you watch just as the artist made it. I like watching them. There’s something cool about not knowing where the drawing is going. That’s my favorite part.

So try dropping some poops and smudging them around. Make a masterpiece, give it a name, and save it for me (and others) to see. I guarantee I’ll smile.

let
me know
what you think
just remember i have feelings too

*