hi all
i just starte to learen darkbasic,and i want to make a simpel menu.
Now i have my code and is see the text of my menu but i can not move wiht my keys that implement to through my menu
here is the code
Rem Project: menu
Rem Created: Tuesday, April 14, 2009
Rem ***** Main Source File *****
rem sync beeld
sync on : sync rate 60
rem fullschreen
`Set full screen mode on
set window off
`Set screen size
set display mode 1400,800,32
rem Gosub
Gosub mnuVars
rem do and loop menu code and keystament
do
if selecteItem <> 0
ink white,white
center text screen width ()/2,200,mnuItems$(0)
Else
ink red, red
center text screen width ()/2, 200, mnuItems$(0)
Endif
if selecteItem <> 1
ink white,white
center text screen width ()/2,220,mnuItems$(1)
Else
ink red, red
center text screen width ()/2, 220, mnuItems$(1)
Endif
if selecteItem <> 2
ink white,white
center text screen width ()/2,240,mnuItems$(2)
Else
ink red, red
center text screen width ()/2, 240, mnuItems$(2)
Endif
if selecteItem <> 3
ink white,white
center text screen width ()/2,260,mnuItems$(3)
Else
ink red, red
center text screen width ()/2, 260, mnuItems$(3)
Endif
if selecteItem <> 4
ink white,white
center text screen width ()/2,280,mnuItems$(4)
Else
ink red, red
center text screen width ()/2, 280, mnuItems$(4)
Endif
rem keymove code
if upkey()=0 and up = 1
up = 0
Endif
if upkey() = 1 and up = 0
selectedItem = selectedItem - 1
up = 1
Endif
if downkey() = 0 and down = 1
down = 0
Endif
if downkey () = 1 and down = 0
selectedItem = selectedItem + 1
down = 1
Endif
if selectedItem < 0
selectedItem = 4
Endif
if selectedItem > 4
selectedItem = 0
Endif
sync
loop
rem menu text
mnuVars:
dim mnuItems$ (5)
mnuItems$(0)= "New game"
mnuItems$(1)= "Load game"
mnuItems$(2)= "Save game"
mnuItems$(3)= "Options"
mnuItems$(4)= "Exit"
selectedItem = 0
up = 0
down = 0
red = RGB(255,0,0)
white = RGB(255,255,255)
return
rem end