Hi Zombie20
I am at my comp now, so I made a few edits to the code to help you with it:
sync on:sync rate 30
backdrop off
gosub load_images
gosub create_map
repeat
cls
gosub draw_map
sync
until scancode() > 0
end
create_map:
Dim map (4,4)
restore Map_Data
for y = 0 to 4
for x = 0 to 4
read map(x,y) : `read data into the map
next x
next y
return
load_images:
` make images for this example
`load image "ground.bmp",1
ink rgb(0,200,0),0
box 0,0,32,32
get image 1,0,0,32,32
ink rgb(0,0,200),0
box 0,0,32,32
get image 2,0,0,32,32
`load image "sky.bmp",2
return
draw_map:
for y = 0 to 4
for x = 0 to 4
If map(x,y) > 0
Paste image Map(x,y),x*32,y*32
endif
next x
next y
return
Map_Data:
data 2,2,2,2,2
data 2,2,2,2,2
data 2,2,2,2,2
data 1,1,1,1,1
data 1,1,1,1,1
I didn't have the ground and sky images you are using so I made some up.
So many games to code.......so little time.