Saturday, February 9, 2008

Making a tile-based scrolling platform game in AS3.0 (argh!)

I've been looking over various forums such as the kirupa forums for information on making a tile-based platform game in actionscript 3. It seems the information is limited but basically, if you want it to run fast, then you have to do it as follows:

Use a single bitmap file containing all the tiles you will use in the level (this is the tilesheet.)

Plot the tiles onto a single, screen-sized blank bitmap in flash, using copyPixels to grab the tiles from the tilesheet bitmap.

And do this again every time the screen needs to move.

Of course its a bit more detailed than that since I need it to scroll left/right, I'll need a list of tiles in the correct locations put into a file (I'm planning to use XML for this) and then load the columns as needed. I think I will have the background seperate from the tiles (which will be in PNG format - bitmaps with transparency, what more could you want?) and move it independantly. Not sure on this yet however!

It's going to be a lot of work to do, so first things first I'm going to try and render a couple of tiles on a static screen in flash, and see if I can get that working..

Get ready to see it in my next post!

0 comments: