Kelz,
Well, there are several ways to do this, depending on the method which suits your coding style best. Let me first explain how you might go about splitting up your code, in general. I, personally, like to split up my source code into
sections. These sections are groups of code, which are each wrapped into single
if statements.
Example:
if frmfocus = 0
run this group of code
endif
if frmfocus = 1
run this group of code
endif
Notice each group of code wrapped in its own
if statement. Each group of code will only run when its
if statement is true, effectively splitting the source code into sections. Using this method, if you notice the name of the variable
frmfocus meaning
form focus, each section of code is a form. For example, form number 0 may be the main menu, form number 2 the options menu, form number 3 the section of code that is the game or gameplay.
Now that I have that out of the way, I can try to have you understand a way of pressing a button, that will
switch forms.
If your button is an image, let's say a rectangle, the collision between it and the mouse is quite simple to detect. Let's now say that your button is 100 pixels wide and 50 pixels tall, and that its x and y coordinates are both placed at 0(the very top-left of the screen). To detect collision here, we need to compare the mouse coordinates to boundary coordinates of the rectangle. The left and right sides of the rectangle are both x coordinates, the bottom and top are both y coordinates. Therefore, this rectangle has a left coordinate of 0, right 100, top 0, bottom 50. Is this understandable? We are simply finding the coordinates of the left, top, right and bottom of the rectangle.
Onto collision. Simply put, if the mouse is past the left side of the rectangle(to the right of it), and is before the right side(to the left of it), and is past the top side(below it), and before the bottom side(above it), then the mouse is within the rectangle...collision.
Example:
If then, the mouse is within the rectangle, then a simple
ifstatement can be used to detect mouse clicks, and by doing so, the form focus can be changed.
Example:
REM << check if mouse is within rectangle
if mousex() => 0 and mousex() =< 100 and mousey() => 0 and mousey() =< 50
REM << check for a mouseclick, switch forms if there is one detected
if mouseclick() = 1 then frmfocus = 1
endif
Ask, if you have any specific questions, or would like to know some more advanced tips, like changing the image of a sprite when the mouse collides with it etc.

+NanoBrain+