I"m having trouble with pausing. When the player pauses it's supposed to go to this pause menu. It does. But when you want to go back, it starts the level over again. I used gosub to get there and gosub to get back, which probably is going to be the culprit(or just part of the culprit), but I don't know how to get back to point when the player pauses.
Here's the code:
`controls
if upkey()=1 then move object 1,0.35
if downkey()=1 then move object 1,-0.35
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-2)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+2)
if spacekey()=1 and playergrav#=0 then playergrav#=0.35
if inkey$()="p" then gosub PAUSEMENU
if inkey$()="t" then position camera 25,35,55 : point camera 0,-5,0
` get current object position
posx#=object position x(1)
posy#=object position y(1)
posz#=object position z(1)
` gravity
playergrav#=playergrav#-0.01
posy#=posy#+playergrav#
`sliding collision
position object 1,posx#,posy#,posz#
if object collision(1,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=-0.0
endif
`set size for controled object
s#=object size y(1)/2.0
`ensure camera stays out of static boxes
if get static collision hit(oldposx#-s#,oldposy#-s#,oldposz#-s#,oldposx#+s#,oldposy#+s#,oldposz#+s#,posx#-s#,posy#-s#,posz#-s#,posx#+s#,posy#+s#,posz#+s#)=1
dec posx#,get static collision x()
dec posy#,get static collision y()
dec posz#,get static collision z()
if get static collision y()<>0.0 then playergrav#=0.0
endif
`update with new object position
position object 1,posx#,posy#,posz#
`camera
angle#=object angle y(1)
camdist#=5.5 : camhigh#=posy#+0.8 : camfade#=3.5
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
xrotate camera 10
`end loop
sync
loop
PAUSEMENU:
cls
do
set text font "Arial Black"
set text size 30
center text 520,250,"PAUSE"
center text 520,300,"Press Space to continue"
if spacekey()=1
Gosub L1
endif
loop
Can anyone tell me of a way HOW to get back? That doesn't involve gosub?
I'm thinking it will have to be stored in an array or a variable or something...
Yodaman Jer