Best way to go about it is to use a tilemap.
Create a 2d array and store a value that coresponds to an image, in each grid location. Then have a loop that loops thru the array and draw all the image on screen. Also create an offset x and y when drawing the images. The offset will have a maximum value of the tilesize minus 1. This is for smooth movement. Example of a draw loop.
for loopy=ypos to ypos+10; fit 10 tiles vertically, one for the overlap
for loopx=xpos to xpos+15; fit 15 tiles horizontally, again, one for the overlap
drawimage tile_array(loopx,loopy),loopx*24xoffset,loopy*24yoffset; *24 because each tile is 24 pixels wide and high.
next
next
ypos and xpos are the co-ords on the world map. So that the program knows what tiles to draw. Well just a wee starter, as i don't know that much about it myself, but this information is correct. :D
|