First of all you need to understand multidimesional arrays. Entire tutorial have been written on arrays, but here is a bit of example code which can help.
This creates a random grid area
`assure random is always different
randomize timer()
`manually control screen update
sync on
sync rate 0
`create a multidimensional array
`it is 11 across and 11 down because there also is a 0 spot, I usually ignore spot 0 though
dim grid(10,10) as boolean
`Puts either a 1 or 0 in each spot
`This will probably be more complex in your program, not just random
for x=1 to 10
for y=1 to 10
grid(x,y)=rnd(1)
next y
next x
`draw background green box
ink rgb(30,255,0),0
box 0,0,100,100
`change color to brown
ink rgb(100,100,0),0
`Draws a brown box if the grid spot is 1
for x=1 to 10
for y=1 to 10
if grid(x,y)=1
box (x-1)*10,(y-1)*10,x*10,y*10
endif
next y
next x
`Updates the screen
sync : sync
`Waits for a key to be pressed
wait key
Random isn't really what you want for a world, so here is the code changed slightly to read from data statements.
`assure random is always different
randomize timer()
`manually control screen update
sync on
sync rate 0
`create a multidimensional array
`it is 11 across and 11 down because there also is a 0 spot, I usually ignore spot 0 though
dim grid(10,10) as boolean
`Puts either a 1 or 0 in each spot
`This will probably be more complex in your program, not just random
for y=1 to 10
for x=1 to 10
read grid(x,y)
next x
next y
`draw background green box
ink rgb(30,255,0),0
box 0,0,100,100
`change color to brown
ink rgb(100,100,0),0
`Draws a brown box if the grid spot is 1
for x=1 to 10
for y=1 to 10
if grid(x,y)=1
box (x-1)*10,(y-1)*10,x*10,y*10
endif
next y
next x
`Updates the screen
sync : sync
`Waits for a key to be pressed
wait key
`1 means draw a brown box
data 1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,0,0,1,1,1,1
data 1,0,1,1,1,0,1,1,1,1
data 1,0,1,1,1,0,0,0,1,1
data 1,0,1,1,1,1,1,0,1,1
data 1,0,0,0,1,1,0,0,1,1
data 1,0,1,0,0,0,0,1,1,1
data 1,0,1,0,1,1,0,0,0,1
data 1,0,0,0,1,1,1,1,0,1
data 1,1,1,1,1,1,1,1,1,1
Making a map as complex as the one you have posted will be difficult, so it may be best to start with a simple blocky one like mine and then improve on it. There is a way to take the image you have drawn and have dark basic pro make a multidimensional array of 1's and 0's out of it, but I won't go into that until you are comfortable with this.