Heres the editted version of your program and it works. What i did:
* Converted the DATA into an array called MAP
* Made your FOR loop go from 0 -> 23 0 -> 31 to accomodate for the array
* Therefore i took out the -10 in the Sprite print statement
* Changed your collision detection and deleted what i didnt use (you can obviously put it back in) and i implemented a ymove# variable instead of (+ 0.8*Speed#)
MaxTiles=816 : Dim Tiles(MaxTiles,3)
DIM map(31,23)
`Simple Grass tiles
INK RGB(0,255,0),0 : box 0,0,10,10 : INc ImgNum : get image ImgNum,0,0,10,10
`Simple Brown tiles
INK RGB(128,64,0),0 : box 0,0,10,10 : INc ImgNum : get image ImgNum,0,0,10,10
`Simple Blue tiles
INK RGB(0,0,170),0 : box 0,0,10,10 : INc ImgNum : get image ImgNum,0,0,10,10
`Simple LightBlue tiles
INK RGB(0,0,210),0 : box 0,0,10,10 : INc ImgNum : get image ImgNum,0,0,10,10
`Character is a red dot
INK RGB(200,0,0),0 : box 0,0,10,10 : INc ImgNum : PlayerImg=ImgNum+1 : get image PlayerImg,0,0,10,10
Sync on : Sync rate 0
`Draw the map
For Y=0 to 23
For x=0 to 31
Inc SpriteNum
Read SpriteVal
Map(x,y) = SpriteVal
if spriteval = 1
endif
IF SpriteVal>0 then Sprite SpriteNum,(X*10),(Y*10),SpriteVal
Next x
Next y
Restore : SpriteNum=0
PlayerX#=100
PlayerY#=20
Do
`Make a rate of speed so this will work on almost all computers
FPS#=Screen Fps()
Speed#=60.0/FPS#
Gosub HandleTiles
Gosub HandlePlayer
If leftkey()=1 then Playerx#=Playerx#-(0.8*Speed#)
If Rightkey()=1 then Playerx#=Playerx#+(0.8*Speed#)
Text 10,10,Str$(PlayerX#)
Text 10,20,Str$(PlayerY#)
Circle ((17*10)-10),((7*10)-10),5
SpriteNum=0
Sync
Loop
`*********************************** Sub-Routes *********************************************
HandleTiles:
`Some Scrolling
xtile = Playerx#/10
ytile = (Playery#/10)
Check = map(xtile,(ytile+1))
print xtile
print ytile
print check
if check = 1
ymove# = 0
endif
if check = 0
ymove# = (0.8*Speed#)
endif
return
HandlePlayer:
Sprite SpriteNum+1,Playerx#,PlayerY#,PlayerImg
PlayerY#=PlayerY#+ymove#
Return
`********************************* Data statements ********************************************
Data 0,0,0,0,0,0,0,0,0,0,0,0,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,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,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,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,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,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,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,1,1,1,1,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,0,0,0,0,0,0,0,0,0,0,0,0
Data 0,0,0,0,0,0,0,0,1,1,1,1,1,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,0,0,0,0,0,0,0,0,0,0,0,0
Data 0,0,0,0,0,1,1,1,1,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0
Data 0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data 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