New Demo - Refactored Tile Engine + Rotating Grid
Saturday, 1 September 2007 | | |Whilst graphicly nothing new this demo shows the rotating grid concept in the tile engine. First I'll summarize the how the engine works with regard to level layout and design.
The Engine itself is a Sprite that has 3 Sprite Children.
- Lowest Sprite - the particle engine
- Middle Sprite - the world object sprite, this contains the player, enemies, the demo 'boxes'
- Top Sprite - the level itself
Another option would have been to iterate over my map array, and use copyPixels to draw the level. This is probably the most common method of scrolling bitmap level. However, you still need to efficiently manage your Bitmap & BitmapData objects - that's where the grid comes in. In the example (link at the end of this entry), there is only ever the same 9x9 Bitmaps on the sprite ever. As the grid is rotated, the bitmap object is repositioned and its bitmapData member set to a new values based on an update. You could think of it as a recycling object cache.
Demo