ok i made a level maker for my new little heads up display typa game well it exports a text file with the setup like this
X,y,img,collision
12,5,3,1
14,17,9,0
i'm using grid spaces so those x and y positions cooraspond to grid positios and the text file ussually is around 15 or 20 kbs if every place is filled with a image. thee problem is reading the image postions in. its not working correctly :/ heres my code
Function Ground_Creation
Load image "Ground tiles2.bmp",600
Paste image 600,0,0
For X=10 to 19
Get image X,(X-10)*20,0,(X-9)*20,20
next X
cls
Dim Setup(31,23)
Open to read 1,"Map.txt"
For X=1 to 1000
Read String 1,Load$
if Mid$(Load$,2)<>","
Q$=Mid$(Load$,1)+Mid$(Load$,2) : IX=Val(Q$)
else
Q$=Mid$(Load$,1) : IX=Val(Q$)
endif
If Mid$(Load$,2)=","
If Mid$(Load$,4)<>","
Q$=Mid$(Load$,3)+Mid$(Load$,4) ; IY=Val(Q$)
else
IY=Val(Mid$(Load$,3))
endif
else
If Mid$(Load$,5)=","
IY=Val(Mid$(Load$,4))
endif
endif
If Mid$(Load$,5)=","
Image=Val(Mid$(Load$,6))
else
Image=Val(Mid$(Load$,5))
endif
If Mid$(Load$,7)=","
col=Val(Mid$(Load$,8))
else
col=val(Mid$(Load$,7))
endif
setup(IX,IY)=Img+9
Terrain(IX,IY)=Col
next X
for Y=1 to 23
For X=1 to 31
If Setup(X,Y)>9
Paste image setup(X,Y),Way(1,X)-9,Way(2,Y)-9
endif
next x
next y
Get image 1000,0,0,640,480
close file 1
undim Setup(31,23)
endfunction
any suggestions?