Thank you... I did all of that. but for some reason, whenever I move the number changes to 0? Any Sugestions? (I also only want you to stop when you run into the walls.)
`Set Up the Background
Sync On
Backdrop On
Color Backdrop Black
Autocam Off
`Variables
x#=0 : y#= 15 : z#=0
`Make the Charecter
Make Object Sphere 200,3
Color object 200,rgb(0,100,0)
`Make The Ground Cubes
For cubes=1 to 118
Make Object Cube cubes,40
Scale Object cubes,100,50,100
Position object cubes,0,-1000,0
Color Object cubes,rgb(200,0,0)
Make Object Collision Box cubes,-22,-20,-22,22,20,22,0
Next cubes
`Position the Map form the .TXT File
xpos#=-200
zpos#=200
For a=0 to 118
num#=Read Byte From File ("Maps.txt",a)
if num#=48
Position Object a+1,xpos#,15,zpos#
endif
if num#=49 then Position Object a+1,xpos#,0,zpos#
if num#=10 or num#=13 then xpos#=xpos#-40
xpos#=xpos#+40
if xpos#=200
xpos#=-200
zpos#=zpos#-40
endif
Next a
`Main Loop
Do
`Movement + Position
Position Object 200,x#,y#,z#
`Movement + Keys
a#=object angle y(200)
if upkey()=1 then x#=newxvalue(x#,a#,.5) : z#=newzvalue(z#,a#,.5)
if downkey()=1 then x#=newxvalue(x#,a#,-.5) : z#=newzvalue(z#,a#,-.5)
if leftkey()=1 then yrotate object 200,wrapvalue(object angle y(200)-1)
if rightkey()=1 then yrotate object 200,wrapvalue(object angle y(200)+1)
`The Light Changer
`So you stay on the blocks
oldx#=x# : oldz#=z#
x#=newxvalue(x#,a#,40) : z#=newzvalue(z#,a#,40)
col=intersect object(200,oldx#,15,oldz#,x#,15,z#)
If x#<0
dec x#,get object collision x()
dec z#,get object collision z()
endif
x#=oldx# : z#=oldz#
Set Cursor 10,10
Print ": ",col
If x#<-200 then x#=-200
If x#>200 then x#=200
If z#<-180 then z#=-180
If z#>220 then z#=220
`Camera things
Set Camera to Follow x#,y#,z#,a#,10,5,10,1
`Refresh the screen
Sync
`End of Loop
Loop
`Terminate Program!
End
To run it you need a notepad program that says this and is named Maps.txt:
0111111110
0111111110
0110110110
0110110110
0110110110
0110110110
0110110110
0110110110
0111111110
0111111110
(Or something close to that)
Am I dead yet?