Hi Juggleboy,
I've added ashingda's code to your program and changed a few things myself which I will explain. I've replaced a few of the commands with "?" because I don't want to make it too easy for you

Search for "?" and replace them before trying to run the program.
If you aren't already using DarkEDIT I'd highly recommend it. It will be in your DarkBasic folder.
rem Program Name: 2D Tile Map
rem Author: Juggleboy
rem Date: 27/03/2010
rem ==================
sync on
sync rate 30
gosub create_tile_images
gosub create_map
rem === MAIN ===
cls
gosub draw_map
?
wait key
end
rem === SUBROUTINES ===
create_tile_images:
rem sky tile
ink 230,0
box 0,0,31,31
get image 1,0,0,32,32
rem brick tile
ink rgb(128,0,0),0
box 0,0,?,?
get image 2,0,0,?,?
return
`//
create_map:
rem set the tiles for the map. 0=sky, 1=brick
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0
data 0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
`Load to array
dim Map(20,15)
for lpy = 0 to 14
for lpx = 0 to 19
read Map(lpx,lpy)
next lpx
next lpy
return
`//
draw_map:
for lpy = 0 to 14
for lpx = 0 to 19
i = 1+Map(lpx,lpy)
paste image ?,lpx*32,lpy*32
next lpx
next lpy
return
First of all I added a program header. It's nice to look back at old code and see when you wrote it, also if your code gets passed around, your name is on it so you will get credit for your work.
I grouped the image subroutines into one because they do very similar things and are both called at the same time anyway.
Your images are the right size (32x32) but this seems to be by accident.
When you draw a box 0,0,32,32 it is actually 33x33 because 0 is included; if you moved your box across and down it would become clear 1,1,33,33.
GET IMAGE works differently, it lassos the pixels. Imagine a grid running in-between the pixels like when you zoom in MSPaint, now instead of numbering the pixels you number the lines between them. Something like this:
lines# 0 1 2 3 4
pixel# |0|1|2|3|
So you see to grab from pixel 0 to 3 we have to do GET IMAGE 0,0,4,1.
Why do I have the Y coordinates 0 to 1? For the same reason: this is a one pixel high line but to include the pixel (0) I have surround it with it's lowest point 0 and it's highest point 1. (I mean highest numerically, this is of course coming down the screen).
I separated out the sections of your program with section header thingies. You don't have to do this yourself but I find it easier when I can see where my subroutines begin.
I added an END after the drawing commands. It's very important to have this command if you are using subroutines (which I'm glad to see you are); if you don't tell the program to end it will run into your subroutines and execute them as if part of the main program, and we don't want that!
Functions are even more sensitive: if the program cursor runs into those your program will crash all together!
I removed a few comments. Writing lots of comments is a good habit, especially when you are still developing your program, but some commands or subroutine calls are self-explanatory and don't need commenting.
For example: "sync on" needs no explanation.
One last thing that might interest you is how colours work in DB.
The RGB command is just a function that converts the numbers you give into a single integer. Did you know DB stores colours as a single integer?
This works by stacking the numbers on top of each other.
I see you already know that the brightest a colour can be is 255. Well to stack these colours we start with 0-255 as all the shades of blue, then we put green on top of that by multiplying it by 256. This works because even 1 green (256) is is higher than blue can ever be (255) so we wont get the two mixed up. To put red on top of that we find the multiply it by 65536 (256*256) so 1 red is higher than 255 blue and 255 green put together, and we will never get any of them mixed up.
For example rgb(255,255,255) is the same as 255*65536 + 255*256 + 255
Try it yourself.
This is why I knew I could turn rgb(0,0,255) into 255 because blue is the only colour there so there's no need for RGB. Also black is simply 0 because we'd get 0 from multiplying anyway.
"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright