Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / main menu help again

Author
Message
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 19th Nov 2002 13:14
Hi i have got my menu but there is still a few problems with it the text is at the top of the screen where i put it but if u click on parts of the screen below where there is no text it goes in to the menu options and i dont know which codes to edit please help:

rem setup
sync on
sync rate 30
set window on
set window position 220,150
set window title "MAIN MENU"
LOAD 3DSOUND "PRESS.WAV",1
load music "dungeon.mid",1
wait 2000

rem make main menu
MAIN:
sync
loop music 1
rem make background
load bitmap "steel02.bmp"
ink 1,1
ink rgb(244,0,0),0
rem text
Set text font textshape$
Set text size 28

rem menu text goes here
center text 100,10,"START GAME"
center text 275,10,"PRACTICE"
center text 430,10,"OPTIONS"
center text 550,10,"QUIT"

do

rem the pattern: subtract 52, subtract 16, add 52!
rem Arcade 20, add mode!
if btn_click(15,1,175,125)
PLAY SOUND 1
gosub arcade
endif
rem PRACTICE!
if btn_click(15,1,360,177)
PLAY SOUND 1
gosub timetrial
endif
rem OPTIONS!
if btn_click(15,1,494,229)
PLAY SOUND 1
gosub options
endif
rem QUIT!
if btn_click(15,1,608,281)
PLAY SOUND 1
cls
`print ". end program ."
STOP MUSIC 1
end
endif



` use sync at the bottom of any loop near the loop statement.
` effectivly refreshing the monitors display at the end of each loop
sync
loop
return
` menu gosubs ---------------------------------------------
arcade:
cls
loop music 1
rem make bitmap
load bitmap "iron2.bmp"
ink 2,2
ink rgb(244,0,0),0
rem more menu choices! Add 52 to second number1
set text font textshape$
set text size 26
center text 320,100,"Start Game"
center text 320,204,"Load Game"
center text 320,308,"Back"
do
rem the pattern: subtract 20, add 52, subtract 16, add 52!
rem Select Car!
if btn_click(220,75,440,125)
PLAY SOUND 1
gosub select_car
endif
rem Select Track!
if btn_click(200,179,424,229)
PLAY SOUND 1
gosub load_game
endif
rem Race!
if btn_click(180,283,408,333)
PLAY SOUND 1
gosub main
endif

sync
loop
return
timetrial:
cls
cls
load bitmap "iron2.bmp"
ink 2,2
ink rgb(244,0,0),0
rem more menu choices! Add 52 to second number1
set text font textshape$
set text size 26
center text 320,100,"Start Practice"
center text 320,204,"Rules"
center text 320,308,"Back"
do
rem the pattern: subtract 20, add 52, subtract 16, add 52!
rem start practice
if btn_click(220,75,440,125)
PLAY SOUND 1
gosub start_practice
endif
rem rules
if btn_click(200,179,424,229)
PLAY SOUND 1
gosub rules
endif
rem back
if btn_click(180,283,408,333)
PLAY SOUND 1
gosub main
endif

sync
loop
return
rem




options:
cls
load bitmap "iron2.bmp"
ink 2,2
ink rgb(244,0,0),0
rem expanded options! Add 52 to second number!
set text font textshape$
set text size 28
center text 320,100,"Controller Config"
center text 320,152,"Sound And Music"
center text 320,204,"Sound Test"
center text 320,256,"Difficulty"
center text 320,308,"Return to Main Menu"
do
rem the pattern: subtract 20, add 52, subtract 16, add 52!
rem Controller Config!
if btn_click(220,75,440,125)
PLAY SOUND 1
gosub controller_config
endif
rem Sound and Music!
if btn_click(200,127,424,177)
PLAY SOUND 1
gosub sound_and_music
endif
rem Sound Test!
if btn_click(200,179,424,229)
PLAY SOUND 1
gosub sound_test
endif
rem Difficulty!
if btn_click(180,231,408,281)
PLAY SOUND 1
gosub difficulty
endif
rem Return to main menu!
if btn_click(180,283,408,333)
PLAY SOUND 1
gosub return_to_main_menu
endif
sync
loop
return
select_car:
cls
STOP MUSIC 1
print "This is where you select your car! Press any key to continue!"
suspend for key
gosub arcade
return
start_practice:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you practice u'r skills! Press any key to continue!"
suspend for key
gosub arcade
return
select_track:
cls
print "This is where you select your track! Press any key to continue!"
suspend for key
gosub arcade
return
race:
cls
load_game:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you select your track! Press any key to continue!"
suspend for key
gosub arcade
return
rules:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you select your track! Press any key to continue!"
suspend for key
gosub timetrial:
return
`print "The game starts here! Press any key to continue!"
`suspend for key
gosub main
return
controller_config:
cls
ink rgb(244,0,0),0
load bitmap "CONTROLS.bmp"
ink 2,2
ink rgb(244,0,0),0
center text 320,430,"press return to go back"
suspend for key
gosub options
return
sound_and_music:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you adjust the volume for the music and sfx! Press any key to continue!"
suspend for key
gosub options
return
sound_test:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you listen to the game's soundtrack! Press any key to continue!"
suspend for key
gosub options
return
difficulty:
cls
load bitmap "iron2.bmp"
ink 2,2
print "This is where you adjust the difficulty of the cpu! Press any key to continue!"
suspend for key
gosub options
return
return_to_main_menu:
cls
gosub main
return
` FUNCTIONS ----------------------------------------------------------
` ALBERTO MEYER's BTN CLICK FUNCTION
` tdmedia website can be found from dbtoolz.50megs.com
` wicked free DB utilities
`Button Click Function
function btn_click(x1,y1,x2,y2)
clicked=0
if mousex()>x1 and mousex()y1 and mousey()

Login to post a reply

Server time is: 2024-04-23 16:41:31
Your offset time is: 2024-04-23 16:41:31