This is my code; its the function i got problems with!
Do
If Button(20,55,"New Game")=1 then Goto New_Game
If Button(20,95,"Continue")=1 then goto Continue
If Button(20,135,"Option")=1 then goto Option
If button(20,175,"Credits")=1 then goto credits
If button(20,215,"Quit")=1 then goto Quit
loop
New_Game:
Cls
Continue:
CLs
Option:
CLs
Credits:
Cls
Quit:
cls
Set cursor 520,350
Do
If Button(500,350,"Yes")=1 then Goto Yes
If Button(560,350,"No")=1 then goto No
loop
Yes:
End
No:
goto mainmenu
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
Check the closet an extra time, i might be in there!