Ok, so I have a tiling engine, It works.. sort of
sync on
ink rgb(255,255,255),0
cls
rem Testing a Save Map Function
DATA 1,1,1,1
DATA 1,0,0,0
DATA 1,0,0,0
DATA 1,1,1,1
DIM myArray(4,4)
for x = 1 to 4
for y = 1 to 4
read tile
myArray(x,y)=tile
next y
next x
SAVE ARRAY "map.dat", myArray(4)
rem Testing a Load/Draw map Function
load bitmap "Images/test_tiles.bmp",1
for i = 1 to 2
get image i,i*32-32,0,i*32,32
next i
delete bitmap 1
load array "map.dat", myArray(4)
for x = 1 to 4
for y = 1 to 4
tilex=(x*32)
tiley=(y*32)
if myArray(x,y)=1 then image=1
if myArray(x,y)=0 then image=2
paste image image,tilex,tiley
next y
next x
The output should be a C shaped object, but instead it comes out as an upside-down U shape.. Any thoughts? Also, how would I integrate scrolling into this?
I attached the Source files, and tiles so you can give it a go..