Sorry I should of done the code already but I was lazy.
I'll do some right now.
Quote: "I feel more confident about that bit than I do about making the whole GUI, exporting data, grid snapping etc."
We all basically start like you do with an idea and we put the idea into a picture which we can then can see the exact coordinates of everything to make the GUI exactly how we envision. Exporting data is just saving the array and any other data needed. Grid snapping is as you put "if mouse is over a certain block of a grid" the grid is just two FOR/NEXT loops for the X and Y coordinates.
` Screen setup and sync rate
set display mode 800,600,32
sync rate 0
sync on
` Make random number picking more random
randomize timer()
` Make 20 tiles
for t=1 to 20
` Pick a random color
ink rgb(rnd(255),rnd(255),rnd(255)),0
box 0,0,32,32
ink rgb(255,255,255),0
` Show the tile number
center text 16,7,str$(t)
` Grab the image
get image t,0,0,32,32,1
next t
` Set the starting tiles
TileStart=1
CTile=1
do
cls
` Show the tiles
Tile=TileStart
for y=30 to 267 step 32
for x=30 to 196 step 32
` Show the tile
paste image Tile,x,y,1
` Check if the mouse is over the tile
if mousex()=>x and mousey()=>y and mousex()=<x+32 and mousey()=<y+32
` Check for the left mouse button
if mouseclick()=1
` Change the current tile the mouse uses
CTile=Tile
endif
endif
` Go to the next tile
inc Tile
` Leave the FOR/NEXT loop when the tile limit is up
if Tile=21 then exit
next x
` Leave the FOR/NEXT loop when the tile limit is up
if Tile=21 then exit
next y
` Show the current tile#
text 28,280,"Current Tile #"+str$(CTile)
paste image CTile,28,300,1
sync
loop
The above code creates 20 tiles and shows them with an added check for the mouse coordinates and button. The FOR/NEXT loops use screen coordinates so it's easier to set a specific grid where you want the tiles to be seen. If you've never seen STEP in a FOR/NEXT loop it basically tells Darkbasic "Yes, I do want the numbers from 30 to 267 but count by increments of 32." (so the tiles aren't overlapping).
I'm only posting that part right now because it's very easy to use that same method to create the map grid. I'll let you try the map grid on your own.