Flash AS3 sidescrolling tiles optimization

Posted by Galvanize on Game Development See other posts from Game Development or by Galvanize
Published on 2012-03-28T18:53:50Z Indexed on 2012/03/28 23:46 UTC
Read the original article Hit count: 404

I'm trying to make a sidescrolling game in Flash that will run on a low performance laptop.

While studying the subject from Tonypa I saw that he builds a Bitmap by making copys of the BitmapData of each tile from the Tile Sheet and placing it on the bigger Bitmat with the size of the screen.

But when I came to think on how to scroll my map I ran into some optimization doubts. I came up with two choices:

  1. Create a MovieClip, place a Bitmap instance for each tile that is shown on the screen + 1 row in it, then move them all. Then when the tile ran off the screen I would move it to end of the MovieClip and replace their BitmapData for the next row in my map.

  2. Use a Bitmap with copys of each tile in it (as shown in Tonypa's tutorial) but 1 extra row, move the whole Bitmap, and when it comes the time to replace rows, redraw the whole Bitmap and move it back to the origin position.

The first idea is how a co-worker of mine suggested, the second one is my own, but none of us has enough technical knowledge to be sure on a technique that would be optimal in performance, can anyone help?

© Game Development or respective owner

Related posts about flash

Related posts about actionscript-3