well i figured some more out. Here's all my code now.
sync on
set display mode 800,600,32
rem load images
load image "c:\sprites\wall.bmp",1
load image "c:\sprites\sprite2.bmp",2
load image "c:\sprites\grass.bmp",3
rem movable sprite postion
guyx=100
guyy=100
rem the map is 14 tiles by 10 tiles
dim map(10,14)
rem reads the map
for x = 1 to 14
for y = 1 to 10
map(x,y)=map
read map
if map=1 then paste image 1,x*50,y*50,1
if map=0 then paste image 3,x*50,y*50,1
next x
next y
oldposx=2
oldposy=2
oldmovedx=100
oldmovedy=100
do
sync
rem moves sprite
if upkey()=1 and move<>false then guyy=guyy-5: movedy=movedy-5:print "Y=",guyy
if downkey()=1 and move<>false then guyy=guyy+5: movedy=movedy+5:print "Y=",guyy
if leftkey()=1 and move<>false then guyx=guyx-5: movedx=movedx-5:print "X=",guyx
if rightkey()=1 and move<>false then guyx=guyx+5: movedx=movedx+5:print "X=",guyx
if movedx>=oldmovedx+50 then posx=oldposx+1:posx=oldposx
if movedx<=oldmovedx-50 then posx=oldposx-1:posx=oldposx
if movedy>=oldmovedy+50 then posy=oldposy+1:posy=oldposy
if movedy<=oldmovedy-50 then posy=oldposy-1:posy=oldposy
move=true
sprite 2,guyx,guyy,2
rem makes boundaries around the map
if guyx<105 then guyx=guyx+5
if guyx>645 then guyx=guyx-5
if guyy>445 then guyy=guyy-5
if guyy<105 then guyy=guyy+5
read map(posx,posy)
if map(posx,posy)=1 then move=false
loop
data 1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,0,0,0,0,0,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1
my problem is that it is reading map(posx,posy) and posx=2, posy=2, but at (2,2) on my data there is grass(0). I think it is reading:
DATA 1,1
DATA 1,0
...since there are 3 ones there, then move=false. how do i get it to just read:
DATA -,-
DATA -,0<---just that
....that's what I want it to do. Is there a way to do this?
Thanks so much Pilchard...you've taught me so much about Programming, I really appreciate it.
.....