Flag ripple effect using BitmapData
I wanted to replicate some of the effects seen in 8 and 16-bit video games, where sprites would be distorted to represent fire or water effects during battles in Pokémon or other RPGs
Published at 12:52 on Tuesday 18th November 2008 by xerode
Filed under Animation, Experiments, Flash, Laboratory
I’ve been looking at ActionScript’s Bitmap and BitmapData classes a bit recently as they’re one area of Flash I’ve yet to really play around with. I’ve read from bitmaps before but hadn’t tried writing to them and as this is a useful technique for visual effects and games, I started looking at it over the weekend.
I wanted to replicate some of the effects seen in 8 and 16-bit video games, where sprites would be distorted to represent fire or water effects during battles in Pokémon or other RPGs. I figured that the simplest way would be to use sine waves to repositon rows or columns of pixels. Add a little animation and I came up with a basic flag ripple effect.
It’s a very rough and ready script and the output isn’t realistic but I’m going to look at using dynamic gradients and masking or the DisplacementMapFilter class to improve it. With the advent of Flash 10’s Pixel Bender Filters I’m guessing that scripting this kind of effect may become obsolete but as a means of teaching myself about writing BitmapData it’s pretty effective.
In case you’re wondering, the Flash movie above is an imitation of some of the fake advertising in the Starship Troopers series, using one of my photos from an Anonymous protest.

Discussion
You can leave a response or trackback from your own site
2 replies to “Flag ripple effect using BitmapData”
You can follow any responses to this post by subscribing to the RSS 2.0 feed
Alias
18/11/08
You might find this of interest if you can bear to sit through the video:
http://www.lfpug.com/smoke-fir.....p-effects/
xerode
18/11/08
Cheers man, I'll have a look later :)
Reply