`Steps
NumberOfSteps = 8
for t=0 to NumberOfSteps-1
make object box t+7,100,20,100
make object collision box t+7,-50,-10,-50,50,10,50,0
position object t+7,0,5+(t*20),100+(t*100)
texture object t+7,4
next t
`Steps
NumberOfExtraSteps = 8
for g=0 to NumberOfExtraSteps-1
make object box 700+g,100,20,100
make object collision box 700+g,-50,-10,-50,50,10,50,0
position object 700+g,-60+(g*-100),145+(g*20),800
texture object 700+g,4
next g
`Fruits
NumberOfFruits = 41
FruitColor = 0
for t = 1 to NumberOfFruits
if FruitColor = 0
r = 255 : g = 0
endif
if FruitColor = 1
r = 255 : g = 255
endif
if FruitColor = 2
r = 0 : g = 255
endif
if FruitColor = 3
r = 255 : g = 125
endif
FruitColor = FruitColor + 1
if FruitColor = 4 then FruitColor = 0
make object sphere t + NumberOfFruits ,50
color object t + NumberOfFruits , rgb(r,g,0)
position object t + NumberOfFruits ,Rnd(1900)-950,30,Rnd(1900)-950
make object collision box t + NumberOfFruits ,-25,-25,-25,25,25,25,0
next t
`The Cavity
make object sphere 200,100
texture object 200,1
position object 200 ,0,250,900
make object collision box 200,-50,-50,-50,50,50,50,0
`SCREEN DISPLAY
cls 0
backdrop on
`TEXT
`HEADS-UP DISPLAY (HUD)
`OBJECT CREATION
`Player Character
make object cylinder 1,50
texture object 1,1
position object 1,0,26,0
make object collision box 1,-25,-35,-25,25,35,25,0
`LOAD MODELS
`SET LIGHTS
`SET CAMERA
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
`Check Timer
if MyTimer = 0 : rem If the game is over
for x = 1 to 100 : rem Check all the game object
if object exist(x) = 1 then delete object x
next x
backdrop off
if MyScore <= 4000 then goto EndSection
if MyScore > 5000 then goto ExtraCongratsSection
if MyScore > 4000 then goto CongratulationsSection
endif
if MyTimer > 0 then MyTimer = MyTimer - 1 : rem Timer countdown
`CAMERA ORIENTATIONS
cpX# = camera position X()
cpY# = camera position Y()
cpZ# = camera position Z()
caX# = camera angle X()
caY# = camera angle Y()
caZ# = camera angle Z()
`MOVE CAMERA
cpZ# = Newzvalue(1pZ#,1aY-180,200)
cpX# = Newxvalue(1pX#,1aY-180,200)
if cpX#<-999 then cpX#=-999
if cpZ#<-999 then cpZ#=-999
if cpX#>999 then cpX#=999
if cpZ#>999 then cpZ#=999
Position camera cpX#,1pY#+65,cpZ#
Point camera 1pX#,1pY#+35,1pZ#
`MOVE LIGHT
`REFRESH SCREEN
sync
loop
` ***
` *** STOP MAIN SECTION
` ***
` *****************************************
` ***
` *** START END SECTION
` ***
` ***
` *** END SECTION HEADER
` ***
`GAME OVER END SECTION
EndSection:
if object exist(200)=1 then delete object 200
cls 0
if sound exist(6)=1 then delete sound 6
if sound exist(7)=1 then delete sound 7
if sound exist(9)=1 then delete sound 9
stop music 1
delete music 1
load sound "sounds/powerhum.wav",5
loop sound 5
`DECLARE VARIABLES
`SCREEN DISPLAY
cls 0
ink rgb(255,255,255),0
load bitmap "images/OHH NO!! Background.bmp"
center text 320,220, "GAME OVER! YOU FAILED TO DEFEAT THE CAVITY!"
center text 320,260, "GO BACK IN TIME AND TRY AGAIN?"
center text 320,300, "(IT IS HIGHLY RECOMMENDED THAT YOU DO) 'Y'ES OR 'N'O?"
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** END SECTION LOOP (GAME OVER SECTION / CONGRATULATIONS SECTION)
` ***
`SCREEN DISPLAY
do
if scancode() = 0 then exit
loop
do
`CONTROL INPUT
if Inkey$() = "y" then goto OptionsSection
if Inkey$() = "n"
cls 0
end
endif
`REFRESH SCREEN
sync
loop
`GAME WON END SECTION
CongratulationsSection:
if object exist(200)=1 then delete object 200
cls 0
if sound exist(5)=1 then delete sound 5
if sound exist(7)=1 then delete sound 7
if sound exist(9)=1 then delete sound 9
stop music 1
delete music 1
load sound "sounds/clapping.wav",6
loop sound 6
`SCREEN DISPLAY
cls 0
load bitmap "images/WOOHOO! Background.bmp"
ink rgb(255,255,255),0
center text 320,220, "CONGRATULATIONS! YOU DEFEATED THE CAVITY!"
center text 320,260, "GO BACK IN TIME AND DO IT ALL OVER AGAIN? 'Y'ES OR 'N'O?"
do
if scancode() = 0 then exit
loop
do
`CONTROL INPUT
if Inkey$() = "y" then goto OptionsSection
if Inkey$() = "n"
cls 0
end
endif
`REFRESH SCREEN
sync
loop
`100% COMPLETION END SECTION
ExtraCongratsSection:
if object exist(200)=1 then delete object 200
cls 0
if sound exist(5)=1 then delete sound 5
if sound exist(6)=1 then delete sound 6
if sound exist(9)=1 then delete sound 9
stop music 1
delete music 1
load sound "sounds/harp.wav",7
loop sound 7
`SCREEN DISPLAY
cls 0
load bitmap "images/NICE JOB DUDE!! Background.bmp"
ink rgb(255,255,255),0
center text 320,220, "CONGRATULATIONS! YOU DEFEATED THE CAVITY!"
center text 320,240, "AND YOU HAVE COLLECTED ALL THE FRUIT!!"
center text 320,260, "YOU'RE SO AMAZING!"
center text 320,280, "GO BACK IN TIME AND DO IT ALL OVER AGAIN? 'Y'ES OR 'N'O?"
do
if scancode() = 0 then exit
loop
do
`CONTROL INPUT
if Inkey$() = "y" then goto OptionsSection
if Inkey$() = "n"
cls 0
end
endif
`REFRESH SCREEN
sync
loop
end
` ***
` *** STOP END SECTION
` ***
` *****************************************
` *****************************************
` ***
` *** START FUNCTIONS
` ***
` ***
` *** CLEAR WORLD - ClearWorld
` *** Remove all existing 3D elements from world
` ***
function ClearWorld
for x = 1 to 10000
if object exist(x) = 1 then delete object x
if matrix exist(x) = 1 then delete matrix x
if mesh exist(x) = 1 then delete mesh x
if light exist(x) = 1 then delete light x
if x <= 32
if animation exist(x) = 1 then delete animation x
endif
next x
`Static Objects
make object cube 1,5
make static object 1
delete object 1
delete static objects
fog off
backdrop off
cls 0
endfunction
` ***
` *** STOP FUNCTIONS
` ***
`***
`*** END PROGRAM
`***
`*****************************************
okay so, I run this, I get MyScore > 5000 so it goes to the ExtraCongratsSection and when it does that, and the extra steps are still present in the screen. Why isn't it clearing those steps?