This menu system for a game I am creating does not work. When you click New Game, it should go to a new game screen - a menu with a vertical scrolling background. This is the code I have written so far. It just comes up with a black screen though.
Can anyone help me with this?
MainMenu()
goto start
newgame:
hide mouse
stop sound 1
delete sound 1
goto start
FUNCTION MainMenu()
SYNC OFF
SET GAMMA 0,0,0
load image "menu.jpg", 1
sprite 1,0,0,1
set sprite 1,0,0
LoadFadeLoop("menu.wav",1)
FadeScreenIn()
DO
if zoneclicked(293,335,366,366)=1
`startgame
FadeScreenOut()
hide sprite 1
delete image 1
delete sprite 1
SelectLevel()
endif
if zoneclicked(276,371,383,399)=1
`options
STOP SOUND 1
endif
if zoneclicked(278,410,382,439)=1
`credits
endif
if zoneclicked(298,442,359,472)=1
`exit
ExitGame(1)
endif
SYNC
LOOP
ENDFUNCTION
function zoneclicked(x1,y1,x2,y2)
{ This code works fine - it is being omitted for size purposes }
endfunction clicked
function LoadFadeLoop(Filename$, SoundNumber)
{ This code works fine - it is being omitted for size purposes }
endfunction
function ClearFadeLoop(SoundNumber)
{ This code works fine - it is being omitted for size purposes }
endfunction
function FadeScreenIn()
for x = 0 to 255 step 15
SET GAMMA x, x, x
SYNC
next x
endfunction
function FadeScreenOut()
for x = 255 to 0 step -15
SET GAMMA x, x, x
SYNC
next x
endfunction
function ExitGame(SndPlaying)
{ This code works fine - it is being omitted for size purposes }
endfunction
FUNCTION SelectLevel()
if sound exist(1) = 1 then ClearFadeLoop(1)
LoadFadeLoop("sky.design.wav",1)
load image "tilebg.jpg",2
backdrop on
texture backdrop 2
scroll backdrop 0,2
do
sync
loop
ENDFUNCTION
goto start