How to divide the display
nghoangtu

I have the code which draws a bitmap on the display window (480x640), and I want to add a background image which divides the display into multiple squares (32x32 each). Should I use al_draw_bitmap for every square? Or al_draw_bitmap with for loop?

Mark Oates

Are you making like a background tile map, and you want to draw all the tiles like mario?

nghoangtu

Just the background sir

MikiZX

Using for loop should be easier to write. So instead of writing 300 times al_draw_bitmap it is better to use 'for' loop - that is what they exist for (to automate repetitive tasks).

Thread #617951. Printed from Allegro.cc