a few questions about a tilemap and a camera

BlitzMax Forums/BlitzMax Beginners Area/a few questions about a tilemap and a camera

Hello.

With tilemaps one advantage is that you don't have to output all of them, only the ones that are on screen at a particular time. This means that instead of your loop going:
for y= 0 to 50
  for x = 0 to 50
    drawimage tile,x,y ' Just pseudo, obviously
  next
next


with a bit of thought you can do something like
for y = current_top to current_top + screen_height
  for x = current_left to current_left _ screen_width
    drawimage tile,x,y
  next
next


whilst you keep track of the current top and leftmost tiles. This means you can have tilemaps of enormous sizes and only draw those that you can see. This should give you enough time to display all the anims you want.

Does that make sense to you?

Goodbye.