I asked a similar question in 'SO' not knowing about this place,anyways here goes:

I wanted to know what the best approaches are while creating a platformer based game for handling background & objects.

Tiled method - Using small objects & loading on-the-fly : I understand this is good for employing a level editor for the game later but wouldn't it become too processor intensive to manage so many tiles(using arrays, i assume). Especially if have many objects which also might be mutually exclusive (eg different sets of bg objects which react differently to user). Please throw some light on what usually the tile sizes often considered. I have a doubt that I used too small tiles which reduced my frame rate drastically.

Create, store & scale: Creating the whole level & storing them in separate movie clips, scaling them while the level loads. I found this method could solve the frame rate problem, but I then had to handle the issue of not being able to place objects (like enemy, power ups, etc) during runtime, as I no longer tracked the exact locations of the player (hero) in the game.

  • \$\begingroup\$ Tile size is a tradeoff between performance and precision. Common sizes are 8 by 8 and 16 by 16. \$\endgroup\$
    – apscience
    Oct 23 '11 at 9:27

Even if you're using vector graphics, I recommend rasterizing them and using the "blit to a single BitmapObject canvas" method. Since it seems that your game is suited to a tile-based approach, this would result in a much quicker game. Just use BitmapData.copyPixels to place tiles and bypass the Flash display stack.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.