Seb Lee-Delisle


Bitmap Parallax Techniques

OK so it’s go go GO on this huuuuge platform game – 9 levels and a 1st March deadline. Yes, Christmas is cancelled. So I suspect that I may go a little quiet on the blog for a bit…

But… I thought you may like to know, I’ve been doing a little test on the best way to do parallax scrolling. What I wanted to avoid is having assets that come off the edges of the screen. If you make a parallax tile that’s one screenwidth, you pretty much always have to have two copies of it on screen because the join will always have to be in the middle of the screen somewhere.

So what I thought I'd try is convert the parallax layers into bitmaps, and then do bitmap fills for each one. The bitmap fill is the size of the screen, and the beauty of this method is that the tiles automatically repeat, because you can do that with bitmap fills.

So having got that working, sadly it seems that the original way is faster, assuming you cacheAsBitmap the layers. Ho hum.

Examples are here :

Using bitmapFill()

Using big tiles that go off the edge of the screen

The number in the top left hand corner is the number of ms per frame (average over 100 frames).

Now I'm going to try drawing the layers into a single bitmap instead. Wish me luck!

Artwork by Plug-in's creative genius Dominic Minns, if you wanna see the (old) Christmas game that these assets are from : Red Nose Racer

This entry was posted in Actionscript, Flash, Game programming, General, Obsolete. Bookmark the permalink.

7 Responses to Bitmap Parallax Techniques