Hi everyone! i have a problem.
I have got this menu
`main menu
main_menu:
ink rgb(255,255,255),0
text 20,120,"New Game"
text 20,160,"Load"
text 20,200,"Options"
text 20,240,"Credits"
text 20,280,"Exit"
`Make Words change colour when mouse moves over them
repeat
if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 110) and (mousey() <=130))) then ink rgb(255,255,0),0 : text 20,120,"New Game"
if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 110) or (mousey() >130))) then ink rgb(255,255,255),0 : text 20,120,"New Game"
if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 110) and (mousey() <=130))) and (mouseclick()=1)) then Gosub Level_1
if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 150) and (mousey() <=170))) then ink rgb(255,255,0),0 : text 20,160,"Load"
if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 150) or (mousey() >170))) then ink rgb(255,255,255),0 : text 20,160,"Load"
if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 150) and (mousey() <=170))) and (mouseclick()=1)) then Gosub level_password
if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 190) and (mousey() <=210))) then ink rgb(255,255,0),0 : text 20,200,"Options"
if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 190) or (mousey() >210))) then ink rgb(255,255,255),0 : text 20,200,"Options"
if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 190) and (mousey() <=210))) and (mouseclick()=1)) then Gosub Options
if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 230) and (mousey() <=250))) then ink rgb(255,255,0),0 : text 20,240,"Credits"
if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 230) or (mousey() >250))) then ink rgb(255,255,255),0 : text 20,240,"Credits"
if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 230) and (mousey() <=250))) and (mouseclick()=1)) then Gosub Credits
if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 270) and (mousey() <=290))) then ink rgb(255,255,0),0 : text 20,280,"Exit"
if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 270) or (mousey() >290))) then ink rgb(255,255,255),0 : text 20,280,"Exit"
if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 270) and (mousey() <=290))) and (mouseclick()=1)) then end
until false
`Level Password
level_Password:
Level1$="Level1"
Level2$="Level2"
Level3$="Level3"
INPUT "Which Level would you like to load? Level1, Level2 or Level3? (please dont use spaces): ", Selection$
If Selection$=Level1$
gosub Level_1_password
endif
If Selection$=Level2$
gosub Level_2_password
endif
If Selection$=Level3$
gosub Level_3_password
endif
`Password Loops
Level_1_password:
L1password$="pass1"
INPUT "please type the password: ",userpassword1$
IF userpassword1$=L1password$
set text size 20
center text 320,240, "Access to level 1 Granted"
Gosub level_1
ELSE
set text size 20
center text 320,240, "Access to level 1 Denied"
ENDIF
Level_2_password:
L2password$="pass2"
INPUT "Please type the password: ",userpassword2$
IF userpassword2$=L2password$
set text size 20
center text 320,240, "Access to level 2 Granted"
Gosub level_2
ELSE
set text size 20
center text 320,240, "Access to level 2 Denied"
ENDIF
Level_3_password:
L3password$="pass3"
INPUT "Please type the password: ", userpassword3$
IF userpassword3$=L3password$
set text size 20
center text 320,240, "Access to level 3 Granted"
Gosub Level_3
ELSE
set text size 20
center text 320,240, "Access to level 3 Denied"
end
ENDIF
`Credits
Credits:
REPEAT
PRINT "Blah Blah Blah Blah Blah"
GOSUB main_menu
UNTIL False
`Options
Options:
print "blah,blah,blah"
print "blah,blah,blah"
print "blah,blah,blah"
print "blah,blah,blah"
gosub main_menu
`Levels
Level_1:
print "You are now in level 1"
end
Level_2:
print "You are now in level 2"
end
Level_3:
print "You are now in level 3"
end
it's all pretty good except when i go into an option (load is probably the most complicated so far) the main menu still appears so text may overlap it. i would like to change this so that as soon as i click on load the main menu goes away.
my idea is to close down the subroutine, but im not sure if you can do that.(the main menu is a subroutine.)
Thanks to anyone who can help,
cya later
Axelman
CURRENT PROJECT: Enemy At The Gates