Great example! I was considering a similar approach (looping through arrays to output specific tiles) until Corona gets full tilemap support, perhaps via a third-party solution like “Tiled” (www.mapeditor.org).
To repeat what I wrote a few days ago on the subject, I might also consider layering multiple tilemaps, each using different “grid sizes”. For example, you could build 3 arrays instead of just 1 array. The first uses 160x160 pixel images, the second 80x80, and the third 40x40. In the largest grid size, you’d place big expansive areas… large areas of brick, ground, grass, whatever. Thus, one “supersize” tile (a separate image file) consists of 4 “small” tiles, but it takes the place of 4 separate sprites in the Corona engine… a memory saving approach, I’m guessing. Then you’d move to the next array, “medium” (80x80) and fill in some other tiles as needed. Finally, you’d finish out the level design using small 40x40 tiles, but instead of 96 of them, there would probably be half that number (or less!) depending on how much area you’ve painted in the previous maps.
Eventually, all of the tiles would be fused together in a DisplayGroup() so they could be moved around as a single unit.
I look forward to your scrolling tiles approach!
Brent
[import]uid: 9747 topic_id: 3149 reply_id: 9301[/import]