My code:
`*****************************************
`*****************************************
`***
`*** TITLE - Super Fruit Vs. The Cavity
`*** VERSION - 1.0 Last Updated 1.11.11
`*** DEVELOPER - Tommy Twiss
`*** COPYRIGHT - Ingenious Student Labs
`*** DATE CREATED - 1.10.2011
`***
` ***
` *** START SYSTEM SETUP SECTION
` ***
sync on
sync rate 30
autocam on
hide mouse
randomize timer()
` ***
` *** STOP SYSTEM SETUP SECTION
` ***
` ***************************************
` ***
` *** START INTRO SECTION
` ***
` ***
` *** INTRO SECTION HEADER
` ***
`DECLARE VARIABLES
`SCREEN DISPLAY
cls 0
ink rgb(255,255,255),0
center text 320,240,"Super Fruit Vs. The Cavity"
center text 320,260,"HIT ANY KEY TO BEGIN"
do
if keystate( scancode() ) = 1 then goto IntroLoopSection
load bitmap "images/Tooth 1.jpg"
if keystate( scancode() ) = 1 then goto IntroLoopSection
load bitmap "images/Tooth 2.jpg"
if keystate( scancode() ) = 1 then goto IntroLoopSection
load bitmap "images/Tooth 3.jpg"
if keystate( scancode() ) = 1 then goto IntroLoopSection
load bitmap "images/Tooth 4.jpg"
if keystate( scancode() ) = 1 then goto IntroLoopSection
load bitmap "images/Tooth 5.jpg"
if keystate( scancode() ) = 1 then goto IntroLoopSection
sync
loop
`LOAD SOUNDS
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** INTRO SECTION LOOP
` ***
IntroLoopSection:
do
`SCREEN DISPLAY
`CONTROL INPUT
if keystate( scancode() ) = 1 then goto OptionsSection
`REFRESH SCREEN
sync
loop
` ***
` *** END INTRO SECTION
` ***
` *****************************************
` ***
` *** START OPTIONS SECTION
` ***
` ***
` *** OPTIONS SECTION HEADER
` ***
OptionsSection:
`DECLARE VARIABLES
`MyTimer / sync rate = seconds on timer (approx.)
MyTimer = 1500
`How powerful gravity is
Gravity# = 1
`How strong the player can jump
MyPower = 10
`How fast the player can run
MySpeed = 9
`Starting score is 0
MyScore = 0
`Start without jumping or falling
MyAcceleration# = 0.0
`Levels
TotalLevels = 1 : `Total number of levels
LevelNumber = 1 : `Start on Level 1
`SCREEN DISPLAY
cls 0
Load Bitmap "images/Super Fruit vs The Cavity.bmp"
ink rgb(255,255,255),0
center text 320,260,"HIT THE SPACE BAR TO BEGIN"
`LOAD SOUNDS
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** OPTIONS SECTION LOOP
` ***
do
if scancode() = 0 then exit
loop
do
`SCREEN DISPLAY
`CONTROL INPUT
if spacekey()=1 then goto LevelIntroSection
`REFRESH SCREEN
sync
loop
` ***
` *** END OPTIONS SECTION
` ***
` *****************************************
` ***
` *** START LEVEL INTRO SECTION
` ***
` ***
` *** LEVEL INTRO SECTION HEADER
` ***
LevelIntroSection:
`DECLARE VARIABLES
`SCREEN DISPLAY
cls 0
ink rgb(255,255,255),0
center text 320,220, "LEVEL"
set cursor 320,240
print LevelNumber
center text 320,260, "HIT ANY KEY TO BEGIN"
`LOAD SOUNDS
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** LEVEL INTRO SECTION LOOP
` ***
do
if scancode() = 0 then exit
loop
do
`SCREEN DISPLAY
`CONTROL INPUT
if keystate( scancode() ) = 1 then goto MainSection
`REFRESH SCREEN
sync
loop
` ***
` *** END LEVEL INTRO SECTION
` ***
` *****************************************
` ***
` *** START MAIN SECTION
` ***
` ***
` *** MAIN SECTION HEADER
` ***
MainSection:
`DECLARE VARIABLES
`Player Character
`Projectiles
`Enemies
`Other
`LOAD IMAGES
load image "Super Fruit.bmp",1
load image "cave02.bmp",2
load image "steel01.bmp",3
load image "rocky01.bmp",4
`SCREEN DISPLAY
cls 0
backdrop on
`TEXT
`HEADS-UP DISPLAY (HUD)
`OBJECT CREATION
`World Map
` Walls
` North Wall
make object box 2,2000,1000,10
rotate object 2,0,0,0
position object 2, 0,500,1005
texture object 2,2
` East Wall
make object box 3,2000,1000,10
rotate object 3,0,90,0
position object 3, 1005,500,0
texture object 3,2
` South Wall
make object box 4,2000,1000,10
rotate object 4,0,180,0
position object 4, 0,500,-1005
texture object 4,2
` West Wall
make object box 5,2000,1000,10
rotate object 5,0,270,0
position object 5, -1005,500,0
texture object 5,2
` Floor
make object box 6,2000,1000,2000 : position object 6,0,-500,0 : color object 6,rgb(0,255,0)
make object collision box 6,-1000,-500,-1000,1000,500,1000,0
texture object 6,3
rem Steps
NumberOfSteps = 7
for t=0 to NumberOfSteps-1
make object box t+7,50,10,50
position object t+7,0,5+(t*20),100+(t*100)
texture object t+7,4
make object collision box t+7,-25,-5,-25,25,5,25,0
rem Fruits
NumberOfFruits = 20
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
rem Super Fruit
make object sphere 8,100
texture object 8,1
position object 8 ,0,250,900
make object collision box 100,-50,-50,-50,50,50,50,0
`Player Character
make object cylinder 1,100
texture object 1,1
`LOAD MODELS
`SET LIGHTS
`SET CAMERA
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** MAIN SECTION LOOP
` ***
do
if scancode() = 0 then exit
loop
do
`SPECIAL EFFECTS
`OBJECT ORIENTATIONS (Pre-Movement, Pre-Collision)
`Player Character
1pX# = object position X(1)
1pY# = object position Y(1)
1pZ# = object position Z(1)
1aX = object angle X(1)
1aY = object angle Y(1)
1aZ = object angle Z(1)
`Projectiles
`Enemies
`LIVE SCREEN DISPLAY
`TEXT
center text 320,440,"USE ARROW KEYS TO MOVE | PRESS 'Q' TO QUIT"
`HUD
`CONTROL INPUT
`Acceleration and Pitch
if Upkey()=1 then move object 1,10
if Downkey()=1 then move object 1,-10
`Turning and Banking
if Leftkey()=1 then Yrotate object 1,wrapvalue(1aY-5)
if Rightkey()=1 then Yrotate object 1,wrapvalue(1aY+5)
`Releasing Projectiles
`Quit Game
if Inkey$() = "q"
ClearWorld()
goto EndSection
endif
`TRANSFORM OBJECTS
`MOVE OBJECTS
`Player Character
`Projectiles
`Enemies
`OBJECT ORIENTATIONS (Post-Movement, Pre-Collision)
`Player Character
new1pX# = object position X(1)
new1pY# = object position Y(1)
new1pZ# = object position Z(1)
new1aX = object angle X(1)
new1aY = object angle Y(1)
new1aZ = object angle Z(1)
`Projectiles
`Enemies
`CHECK COLLISIONS
`Player Character
`Walls
`Pick-Ups
`Enemies
`Projectiles
`Walls
`Enemies
`Enemies
`Walls
`OBJECT ORIENTATIONS (Post-Movement, Post-Collision)
`Player Character
1pX# = object position X(1)
1pY# = object position Y(1)
1pZ# = object position Z(1)
1aX = object angle X(1)
1aY = object angle Y(1)
1aZ = object angle Z(1)
`Projectiles
`Enemies
`CHECK PLAYER EXPIRATION
`MOVE CAMERA
`MOVE LIGHT
`REFRESH SCREEN
sync
loop
` ***
` *** STOP MAIN SECTION
` ***
` *****************************************
` ***
` *** START END SECTION
` ***
` ***
` *** END SECTION HEADER
` ***
EndSection:
`DECLARE VARIABLES
`SCREEN DISPLAY
cls 0
ink rgb(255,255,255),0
center text 320,220, "GAME OVER"
center text 320,260, "PLAY AGAIN [Y/N]?"
`SOUND EFFECTS
`SPECIAL EFFECTS
`REFRESH SCREEN
sync
` ***
` *** END SECTION LOOP
` ***
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 1000
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
`***
`*****************************************
`*****************************************
When I run this code, it says "SYNTAX ERROR. NESTING ERROR AT LINE 422"
Your help is greatly appreciated, thank you to whoever can help