Hi, now its a new problem
everything works fine expect that when I'am in the game and press the escapepkey it does nothing, how do I make it so that when i press escapkey one time it shows menu and when I press it secend time it hides it
REM Project: Game menu
REM Created: 01/07/2009 12:50:45
REM
REM ***** Main Source File *****
REM
Set display mode 1024,768,32
Sync on
Sync rate 60
Autocam off
Backdrop on
Color backdrop 0
Set camera range 0.5,100000000
Disable escapekey
Global mx as float, my as float, mc as boolean, sw, sh
sw = screen width()/2
sh = screen height()/2
Game_menu:
set window on
set window layout 0,0,0
set window size 500,500
set window position 200,150
Dim menu$(4)
menu$(0) = "NEW GAME"
menu$(1) = "LOAD GAME"
menu$(2) = "SAVE GAME"
menu$(3) = "OPTIONS"
menu$(4) = "EXIT"
Make object cube 1,1
Position object 1,-1,0,4
Repeat
mx = mousex()
my = mousey()
mc = mouseclick()
Rotate object 1,wrapvalue(object angle x(1)+.8),wrapvalue(object angle y(1)+.8),0
Text screen width()/2,300,menu$(0)
Text screen width()/2,320,menu$(1)
Text screen width()/2,340,menu$(2)
Text screen width()/2,360,menu$(3)
Text screen width()/2,380,menu$(4)
If mx > sw and mx < sw + text width(menu$(0)) and my > 300 and my < 300 + text height(menu$(0))
ink rgb(128,128,128),0
Text screen width()/2,300,menu$(0)
ink rgb(255,255,255),0
Text screen width()/2,320,menu$(1)
Text screen width()/2,340,menu$(2)
Text screen width()/2,360,menu$(3)
Text screen width()/2,380,menu$(4)
If mc = 1
Goto Game
Endif
Else
ink rgb(255,255,255),0
Endif
If mx > sw and mx < sw + text width(menu$(4)) and my > 380 and my < 380 + text height(menu$(4))
ink rgb(128,128,128),0
Text screen width()/2,380,menu$(4)
ink rgb(255,255,255),0
Text screen width()/2,300,menu$(0)
Text screen width()/2,320,menu$(1)
Text screen width()/2,340,menu$(2)
Text screen width()/2,360,menu$(3)
If mc = 1
end
endif
Else
ink rgb(255,255,255),0
Endif
Sync
Until menu_end = 1
Game:
Set window off
Make object cube 2,40
Color object 2,rgb(0,255,0)
Make matrix 1,10000,10000,100,100
Do
If rightkey()=1 then yrotate object 2,wrapvalue(object angle y(2)+4)
If leftkey()=1 then yrotate object 2,wrapvalue(object angle y(2)-4)
If upkey()=1 then move object 2,4
If downkey()=1 then move object 2,-4
Set camera to follow object position x(2),object position y(2),object position z(2),object angle y(2),250.0,150.0,50.0,1
IF escapekey()=1
show_menu = 1
Viewmenu()
Endif
Sync
Loop
Function Viewmenu()
clear camera view 0
IF escapekey()=1 and show_menu=1
exitFunction
Endif
Endfunction
Thanx for the help