Ok, firstly: Change this
MENU:
cls
do
set text font "Distant Galaxy"
set text size 50 : center text 520,20,"MAZE-O-MANIA!"
set text size 40 : center text 520,60,"PRESS ENTER TO PLAY"
if returnkey()=1
goto L1I:
endif
loop
to this:
MENU:
cls
do
set text font "Distant Galaxy"
set text size 50 : center text 520,20,"MAZE-O-MANIA!"
set text size 40 : center text 520,60,"PRESS ENTER TO PLAY"
if returnkey()=1
goto L1I:
endif
loop
Return
secondly:change this:
L1I:
cls
do
set text font "Denmark"
set text size 50 : center text 520,60,"LEVEL 1:"
set text size 45 : center text 520,100,"SKYTOPIA"
set text size 35 : center text 520,240,"GET ALL OF THE JEWELS IN ORDER TO"
set text size 35 : center text 520,270,"PROCEED TO LEVEL 2. IF YOU COLLECT"
set text size 35 : center text 520,300,"ALL COINS, YOU GET TO GO TO A BONUS"
set text size 35 : center text 520,330,"LEVEL! PRESS ENTER TO CONTINUE ON."
if returnkey()=1
goto L1:
endif
loop
to this:
L1I:
cls
do
set text font "Denmark"
set text size 50 : center text 520,60,"LEVEL 1:"
set text size 45 : center text 520,100,"SKYTOPIA"
set text size 35 : center text 520,240,"GET ALL OF THE JEWELS IN ORDER TO"
set text size 35 : center text 520,270,"PROCEED TO LEVEL 2. IF YOU COLLECT"
set text size 35 : center text 520,300,"ALL COINS, YOU GET TO GO TO A BONUS"
set text size 35 : center text 520,330,"LEVEL! PRESS ENTER TO CONTINUE ON."
if returnkey()=1
goto L1:
endif
loop
thirdly, change this:
L1:
cls
`******set sync rate********
sync on : sync rate 0 : backdrop on : autocam off
`******set light and other**
set ambient light 85 : color ambient light rgb(255,255,255)
`******load sounds and music
load sound "sounds\coin.wav",1
load sound "sounds\jump.wav",2
load sound "sounds\jewel.wav",3
load sound "sounds\voidhum.wav",4
load sound "sounds\doink1.wav",5
loop sound 4
`******set up lives*********
jewels = 0 : lives = 4 : coins = 0
`******load sky box and character
load object "objects\character.x",1 : scale object 1, 50,50,50 : position object 1, 0,10,0 : set object 1, 1,0,0,0,1
load object "objects\skybox1.x",2 : scale object 2, 65555,65555,65555 : position object 2, 0,0,0 : xrotate object 2,90 : set object 2,1,0,0,0,1
`******load platforms and objects
make object box 3, 20,2,20 : position object 3, 0,0,0 : color object 3, rgb(200,100,200) : set object 3,1,0,0,0,1
objx#=object position x(3)
objy#=object position y(3)
objz#=object position z(3)
objsx#=object size x(3)/2.0
objsy#=object size y(3)/2.0
objsz#=object size z(3)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 4,2,2,20 : position object 4,0,0,20 : color object 4, rgb(200,100,200) : set object 4, 1,0,0,0,1
objx#=object position x(4)
objy#=object position y(4)
objz#=object position z(4)
objsx#=object size x(4)/2.0
objsy#=object size y(4)/2.0
objsz#=object size z(4)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 5,10,2,10 : position object 5, 0,-5,50 : color object 5, rgb(200,0,100) : set object 5,1,0,0,0,1
objx#=object position x(5)
objy#=object position y(5)
objz#=object position z(5)
objsx#=object size x(5)/2.0
objsy#=object size y(5)/2.0
objsz#=object size z(5)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 6,10,2,1 : position object 6,10,-5,50 : color object 6, rgb(200,0,100) : set object 6,1,0,0,0,1
objx#=object position x(6)
objy#=object position y(6)
objz#=object position z(6)
objsx#=object size x(6)/2.0
objsy#=object size y(6)/2.0
objsz#=object size z(6)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 7,10,2,1 : position object 7,-10,-5,50 : color object 7, rgb(200,0,100) : set object 7, 1,0,0,0,1
objx#=object position x(7)
objy#=object position y(7)
objz#=object position z(7)
objsx#=object size x(7)/2.0
objsy#=object size y(7)/2.0
objsz#=object size z(7)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 8,10,1,10 : position object 8,0,8,50 : color object 8, rgb(0,100,250) : set object 8,1,0,0,0,1
objx#=object position x(8)
objy#=object position y(8)
objz#=object position z(8)
objsx#=object size x(8)/2.0
objsy#=object size y(8)/2.0
objsz#=object size z(8)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 9, 1,1,20 : position object 9,0,-5,65 : color object 9, rgb(100,190,200) : set object 9,1,0,0,0,1
objx#=object position x(9)
objy#=object position y(9)
objz#=object position z(9)
objsx#=object size x(9)/2.0
objsy#=object size y(9)/2.0
objsz#=object size z(9)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 10,10,1,10 : position object 10,0,-5,85 : color object 10, rgb(0,100,200) : set object 10, 1,0,0,0,1
objx#=object position x(10)
objy#=object position y(10)
objz#=object position z(10)
objsx#=object size x(10)/2.0
objsy#=object size y(10)/2.0
objsz#=object size z(10)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 11,8,1,8 : position object 11,15,0,85 : color object 11, rgb(0,225,100) : set object 11,1,0,0,0,1
objx#=object position x(11)
objy#=object position y(11)
objz#=object position z(11)
objsx#=object size x(11)/2.0
objsy#=object size y(11)/2.0
objsz#=object size z(11)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 12,8,1,8 : position object 12,35,5,85 : color object 12, rgb(200,1,0) : set object 12,1,0,0,0,1
objx#=object position x(12)
objy#=object position y(12)
objz#=object position z(12)
objsx#=object size x(12)/2.0
objsy#=object size y(12)/2.0
objsz#=object size z(12)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 13,1,1,40 : position object 13,45,5,60 : color object 13, rgb(0,250,80) : set object 13,1,0,0,0,1
objx#=object position x(13)
objy#=object position y(13)
objz#=object position z(13)
objsx#=object size x(13)/2.0
objsy#=object size y(13)/2.0
objsz#=object size z(13)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 14,20,1,1 : position object 14,45,5,30 : color object 14, rgb(200,0,60) : set object 14,1,0,0,0,1
objx#=object position x(14)
objy#=object position y(14)
objz#=object position z(14)
objsx#=object size x(14)/2.0
objsy#=object size y(14)/2.0
objsz#=object size z(14)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 16,12,1,12 : position object 16,5,0,110 : color object 16, rgb(200,20,200) : set object 16,1,0,0,0,1
objx#=object position x(16)
objy#=object position y(16)
objz#=object position z(16)
objsx#=object size x(16)/2.0
objsy#=object size y(16)/2.0
objsz#=object size z(16)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 17,20,1,1 : position object 17,15,5,90 : color object 17, rgb(200,700,200) : set object 17,1,0,0,0,1
objx#=object position x(17)
objy#=object position y(17)
objz#=object position z(17)
objsx#=object size x(17)/2.0
objsy#=object size y(17)/2.0
objsz#=object size z(17)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 18,20,1,20 : position object 18,45,5,55 : color object 18, rgb(200,1,200) : set object 18,1,0,0,0,1
objx#=object position x(18)
objy#=object position y(18)
objz#=object position z(18)
objsx#=object size x(18)/2.0
objsy#=object size y(18)/2.0
objsz#=object size z(18)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
`********load jewels******************
load object "objects\jewel.x",20 : scale object 20,30,30,30 : position object 20,-14,-3,50 : xrotate object 20,90
load object "objects\jewel.X",21 : scale object 21,30,30,30 : position object 21,-12,-3,50 : xrotate object 21,90
load object "objects\jewel.x",22 : scale object 22,30,30,30 : position object 22,-10,-3,50 : xrotate object 22,90
load object "objects\jewel.x",23 : scale object 23,30,30,30 : position object 23,-8,-3,50 : xrotate object 23,90
load object "objects\jewel.x",24 : scale object 24,30,30,30 : position object 24,14,-3,50 : xrotate object 24,90
load object "objects\jewel.x",25 : scale object 25,30,30,30 : position object 25,12,-3,50 : xrotate object 25,90
load object "objects\jewel.x",26 : scale object 26,30,30,30 : position object 26,10,-3,50 : xrotate object 26,90
load object "objects\jewel.x",27 : scale object 27,30,30,30 : position object 27,8,-3,50 : xrotate object 27,90
`********make object that kills*******
make object plain 15,70000,70000 : xrotate object 15,90 : position object 15,0,-399,0 : hide object 15
`*******gravity********
playergrav#=0.0
`******main prog loop**
do
`print life and health information
ink rgb(0,50,250),0 : set cursor 0,0 : set text size 25
text 80,45,"LIVES "+str$(lives)
text 420,45,"JEWELS "+str$(jewels)
text 840,45,"COINS "+str$(coins)
`till death do us part...
if lives = 0 then end
if object collision(1,15) then lives = lives-1 : delete object 15 : play sound 5 : make object plain 15,70000,70000 : Position object 15, 0,-399,0 : xrotate object 15, 90 : hide object 15 : position object 1,0,10,0
`make sure lives doesn't go beneath 0
if lives =< 0
lives =0
delete object 1
delete object 2
delete object 3
delete object 4
delete object 5
delete object 6
delete object 7
delete object 8
delete object 9
delete object 10
delete object 11
delete object 12
delete object 13
delete object 14
delete object 15
delete object 16
delete object 17
delete object 18
delete object 20
delete object 21
delete object 22
delete object 23
delete object 24
delete object 25
delete object 26
delete object 27
goto L1I:
endif
`if player collects jewels
if object collision(1,20) then jewels = jewels+1 : delete object 20 : play sound 3
if object collision(1,21) then jewels = jewels+1 : delete object 21 : play sound 3
if object collision(1,22) then jewels = jewels+1 : delete object 22 : play sound 3
if object collision(1,23) then jewels = jewels+1 : delete object 23 : play sound 3
if object collision(1,24) then jewels = jewels+1 : delete object 24 : play sound 3
if object collision(1,25) then jewels = jewels+1 : delete object 25 : play sound 3
if object collision(1,26) then jewels = jewels+1 : delete object 26 : play sound 3
if object collision(1,27) then jewels = jewels+1 : delete object 27 : play sound 3
`store old positions
oldposx#=object position x(1) : oldposy#=object position y(1) : oldposz#=object position z(1)
`controls
if upkey()=1 then move object 1,0.30
if downkey()=1 then move object 1,-0.30
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 : play sound 2
if inkey$()="p" then wait 200 : suspend for key
if inkey$()="t" then position camera 0,15,0 : point camera 0,180,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 controlled object
s#=object size y(1)/3.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#=7.5 : camhigh#=posy#+1.8 : camfade#=9.5
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
xrotate camera 10
`end loop
sync
loop
to this:
L1:
cls
`******set sync rate********
sync on : sync rate 0 : backdrop on : autocam off
`******set light and other**
set ambient light 85 : color ambient light rgb(255,255,255)
`******load sounds and music
load sound "sounds\coin.wav",1
load sound "sounds\jump.wav",2
load sound "sounds\jewel.wav",3
load sound "sounds\voidhum.wav",4
load sound "sounds\doink1.wav",5
loop sound 4
`******set up lives*********
jewels = 0 : lives = 4 : coins = 0
`******load sky box and character
load object "objects\character.x",1 : scale object 1, 50,50,50 : position object 1, 0,10,0 : set object 1, 1,0,0,0,1
load object "objects\skybox1.x",2 : scale object 2, 65555,65555,65555 : position object 2, 0,0,0 : xrotate object 2,90 : set object 2,1,0,0,0,1
`******load platforms and objects
make object box 3, 20,2,20 : position object 3, 0,0,0 : color object 3, rgb(200,100,200) : set object 3,1,0,0,0,1
objx#=object position x(3)
objy#=object position y(3)
objz#=object position z(3)
objsx#=object size x(3)/2.0
objsy#=object size y(3)/2.0
objsz#=object size z(3)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 4,2,2,20 : position object 4,0,0,20 : color object 4, rgb(200,100,200) : set object 4, 1,0,0,0,1
objx#=object position x(4)
objy#=object position y(4)
objz#=object position z(4)
objsx#=object size x(4)/2.0
objsy#=object size y(4)/2.0
objsz#=object size z(4)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 5,10,2,10 : position object 5, 0,-5,50 : color object 5, rgb(200,0,100) : set object 5,1,0,0,0,1
objx#=object position x(5)
objy#=object position y(5)
objz#=object position z(5)
objsx#=object size x(5)/2.0
objsy#=object size y(5)/2.0
objsz#=object size z(5)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 6,10,2,1 : position object 6,10,-5,50 : color object 6, rgb(200,0,100) : set object 6,1,0,0,0,1
objx#=object position x(6)
objy#=object position y(6)
objz#=object position z(6)
objsx#=object size x(6)/2.0
objsy#=object size y(6)/2.0
objsz#=object size z(6)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 7,10,2,1 : position object 7,-10,-5,50 : color object 7, rgb(200,0,100) : set object 7, 1,0,0,0,1
objx#=object position x(7)
objy#=object position y(7)
objz#=object position z(7)
objsx#=object size x(7)/2.0
objsy#=object size y(7)/2.0
objsz#=object size z(7)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 8,10,1,10 : position object 8,0,8,50 : color object 8, rgb(0,100,250) : set object 8,1,0,0,0,1
objx#=object position x(8)
objy#=object position y(8)
objz#=object position z(8)
objsx#=object size x(8)/2.0
objsy#=object size y(8)/2.0
objsz#=object size z(8)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 9, 1,1,20 : position object 9,0,-5,65 : color object 9, rgb(100,190,200) : set object 9,1,0,0,0,1
objx#=object position x(9)
objy#=object position y(9)
objz#=object position z(9)
objsx#=object size x(9)/2.0
objsy#=object size y(9)/2.0
objsz#=object size z(9)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 10,10,1,10 : position object 10,0,-5,85 : color object 10, rgb(0,100,200) : set object 10, 1,0,0,0,1
objx#=object position x(10)
objy#=object position y(10)
objz#=object position z(10)
objsx#=object size x(10)/2.0
objsy#=object size y(10)/2.0
objsz#=object size z(10)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 11,8,1,8 : position object 11,15,0,85 : color object 11, rgb(0,225,100) : set object 11,1,0,0,0,1
objx#=object position x(11)
objy#=object position y(11)
objz#=object position z(11)
objsx#=object size x(11)/2.0
objsy#=object size y(11)/2.0
objsz#=object size z(11)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 12,8,1,8 : position object 12,35,5,85 : color object 12, rgb(200,1,0) : set object 12,1,0,0,0,1
objx#=object position x(12)
objy#=object position y(12)
objz#=object position z(12)
objsx#=object size x(12)/2.0
objsy#=object size y(12)/2.0
objsz#=object size z(12)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 13,1,1,40 : position object 13,45,5,60 : color object 13, rgb(0,250,80) : set object 13,1,0,0,0,1
objx#=object position x(13)
objy#=object position y(13)
objz#=object position z(13)
objsx#=object size x(13)/2.0
objsy#=object size y(13)/2.0
objsz#=object size z(13)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 14,20,1,1 : position object 14,45,5,30 : color object 14, rgb(200,0,60) : set object 14,1,0,0,0,1
objx#=object position x(14)
objy#=object position y(14)
objz#=object position z(14)
objsx#=object size x(14)/2.0
objsy#=object size y(14)/2.0
objsz#=object size z(14)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 16,12,1,12 : position object 16,5,0,110 : color object 16, rgb(200,20,200) : set object 16,1,0,0,0,1
objx#=object position x(16)
objy#=object position y(16)
objz#=object position z(16)
objsx#=object size x(16)/2.0
objsy#=object size y(16)/2.0
objsz#=object size z(16)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 17,20,1,1 : position object 17,15,5,90 : color object 17, rgb(200,700,200) : set object 17,1,0,0,0,1
objx#=object position x(17)
objy#=object position y(17)
objz#=object position z(17)
objsx#=object size x(17)/2.0
objsy#=object size y(17)/2.0
objsz#=object size z(17)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
make object box 18,20,1,20 : position object 18,45,5,55 : color object 18, rgb(200,1,200) : set object 18,1,0,0,0,1
objx#=object position x(18)
objy#=object position y(18)
objz#=object position z(18)
objsx#=object size x(18)/2.0
objsy#=object size y(18)/2.0
objsz#=object size z(18)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
`********load jewels******************
load object "objects\jewel.x",20 : scale object 20,30,30,30 : position object 20,-14,-3,50 : xrotate object 20,90
load object "objects\jewel.X",21 : scale object 21,30,30,30 : position object 21,-12,-3,50 : xrotate object 21,90
load object "objects\jewel.x",22 : scale object 22,30,30,30 : position object 22,-10,-3,50 : xrotate object 22,90
load object "objects\jewel.x",23 : scale object 23,30,30,30 : position object 23,-8,-3,50 : xrotate object 23,90
load object "objects\jewel.x",24 : scale object 24,30,30,30 : position object 24,14,-3,50 : xrotate object 24,90
load object "objects\jewel.x",25 : scale object 25,30,30,30 : position object 25,12,-3,50 : xrotate object 25,90
load object "objects\jewel.x",26 : scale object 26,30,30,30 : position object 26,10,-3,50 : xrotate object 26,90
load object "objects\jewel.x",27 : scale object 27,30,30,30 : position object 27,8,-3,50 : xrotate object 27,90
`********make object that kills*******
make object plain 15,70000,70000 : xrotate object 15,90 : position object 15,0,-399,0 : hide object 15
`*******gravity********
playergrav#=0.0
`******main prog loop**
do
`print life and health information
ink rgb(0,50,250),0 : set cursor 0,0 : set text size 25
text 80,45,"LIVES "+str$(lives)
text 420,45,"JEWELS "+str$(jewels)
text 840,45,"COINS "+str$(coins)
`till death do us part...
if lives = 0 then end
if object collision(1,15) then lives = lives-1 : delete object 15 : play sound 5 : make object plain 15,70000,70000 : Position object 15, 0,-399,0 : xrotate object 15, 90 : hide object 15 : position object 1,0,10,0
`make sure lives doesn't go beneath 0
if lives =< 0
lives =0
delete object 1
delete object 2
delete object 3
delete object 4
delete object 5
delete object 6
delete object 7
delete object 8
delete object 9
delete object 10
delete object 11
delete object 12
delete object 13
delete object 14
delete object 15
delete object 16
delete object 17
delete object 18
delete object 20
delete object 21
delete object 22
delete object 23
delete object 24
delete object 25
delete object 26
delete object 27
goto L1I:
endif
`if player collects jewels
if object collision(1,20) then jewels = jewels+1 : delete object 20 : play sound 3
if object collision(1,21) then jewels = jewels+1 : delete object 21 : play sound 3
if object collision(1,22) then jewels = jewels+1 : delete object 22 : play sound 3
if object collision(1,23) then jewels = jewels+1 : delete object 23 : play sound 3
if object collision(1,24) then jewels = jewels+1 : delete object 24 : play sound 3
if object collision(1,25) then jewels = jewels+1 : delete object 25 : play sound 3
if object collision(1,26) then jewels = jewels+1 : delete object 26 : play sound 3
if object collision(1,27) then jewels = jewels+1 : delete object 27 : play sound 3
`store old positions
oldposx#=object position x(1) : oldposy#=object position y(1) : oldposz#=object position z(1)
`controls
if upkey()=1 then move object 1,0.30
if downkey()=1 then move object 1,-0.30
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 : play sound 2
if inkey$()="p" then wait 200 : suspend for key
if inkey$()="t" then position camera 0,15,0 : point camera 0,180,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 controlled object
s#=object size y(1)/3.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#=7.5 : camhigh#=posy#+1.8 : camfade#=9.5
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
xrotate camera 10
`end loop
sync
loop
RETURN
Ok, now you have added the RETURN to the code.
Now, put the "MENU" subroutine and the "L1I" subroutine at the bottom of the code, after the last RETURN command of the L1 subroutine.
At the start, gosub the L1, and change all he goto`s to gosub`s.
TheComet
Oooooops!!! I accidentally formated drive c.