Confused about Maps and Tiles..., and some questions on how you learned!

Blitz3D Forums/Blitz3D Beginners Area/Confused about Maps and Tiles..., and some questions on how you learned!

best way to think of arrays and tile maps is like this, imho:

your array is a piece of squared paper, x squares wide, and y squares tall. in blitz this is created by:
dim myarray(width,height)


your squared paper is numbered along the bottom (the X axis) the numbers 1 to width, and up the side (the Y axis) the numbers 1 to height. this is how you access a particular spot in your array.

then imagine that in every square on your piece of squared paper, you have scribbled a number. this is like saying:
myarray(x,y) = 1

or
myarray(x,y) = 423


your drawing function then cycles through every slot in your array and does something with this number. for extreme basics, it could just use the text command to show you what number is in that slot. alternatively, it could be used as the frame parameter in drawimage to show what tile to draw.
getting more advanced, you could even use the numbers 1-20 to represent grass where your units move normal speed. 21-25 is water... only boats go there. 26-28 is fire! instant death! etc...

hope i didnt just confuse you more... ;) get in touch somehow if you like... il help as much as possible :)