Ignor the first post.
This would work tho:
Function RegionClicked(254, 97, 386, 103)
Clicked=0
If (MouseX()>=X1) AND (MouseX()=<X2)
If (MouseY()>=Y1) AND (MouseY()=<Y2)
If MouseClick()=1 Then Clicked=1
Endif
Endif
If Clicked=1 Then goto QuitGame
QuitGame:
end
EndFunction Clicked
Functions are totally separated from the rest of your code. Say for example you set a variable
clicked = 1. Then go to a function and print
clicked. It would print a 0. Even know they have the same name the function is separate and will not reconize variables from the rest of your code. Same with Subs. It doesn't reconize Subs out side of the Function. So you could place the Sub inside the Function or return the value of a variable of the Function to the main code.
Ex.
Do
If Mouseclick()=1 Then RegionClicked(x,x,x,x)
If Clicked=1 Then goto QuitGame
Loop
Function RegionClicked(254, 97, 386, 103)
Clicked=0
If (MouseX()>=X1) AND (MouseX()=<X2)
If (MouseY()>=Y1) AND (MouseY()=<Y2)
If MouseClick()=1 Then Clicked=1
Endif
Endif
EndFunction Clicked
QuitGame:
end
Hope that helps
If it's yellow let it mellow. If it's brown flush it down.