Yeah, he's looking into arrays for a 2D tile drawing system I think.
If you say your map is 128x128 tiles, then you'd dim an Array (like Pincho says, I'll just elaborate a bit):
Fill it with a blank collision check (say 0):
For Y=0 to 127
For X=0 to 127
Map(X,Y)=0
Next X
Next Y
Draw a safety box around the edges to avoid range problems (say 1):
For Y=0 to 127
For X=0 to 127
if X=0 or Y=0 or X=127 or Y=127 Then Map(X,Y)=1
Next X
Next Y
Set a random scattering of tiles on the map (1 in every 16 tiles is a collision):
For Y=0 to 127
For X=0 to 127
if rnd(16)=1 Then Map(X,Y)=1
Next X
Next Y
Draw the map using the array:
Xoffset=0
Yoffset=0
For Y=0 to screen width()/16
For X=0 to screen height()/16
If Map(X+Xoffset,Y+Yoffset)=1 then paste image 1,X*16,Y*16
Next X
Next Y
Check for a collision, return a 1 if collided with background:
Function Collision(X,Y)
XX=X/16
YY=Y/16
If Map(XX,YY)=1 then collision=1 else collision=0
Endfunction Collision
HTH.
Van-B
My cats breath smells of cat food.