
-----------------------------------
Velocity
Wed Dec 07, 2011 11:04 pm

back to main menu (GUI Problem)
-----------------------------------
What is it you are trying to achieve?
So once i click instructions after the person has read them i want to make it so that there can be a button inside it to return the user to the main menu.

What is the problem you are having?
Variable has not been declared. It doesnt allow me to put it there!!!!!  925 then
        x1 -= 50
    elsif x2 < 25 then
        x2 += 50
    end if
    View.UpdateArea (0, 0, maxx, maxy)
end TheGame

procedure Options

end Options

procedure Game
    TheGame
end Game

procedure Instructions
    colorback (16)
    color (48)
    cls
    drawfillbox (0, 0, maxx, maxy, 51)
    locate (4, 1) 
    put "The objective of the game is..."
    locate (7, 1)
    color (58)
    put "to destroy all of the blocks on your side of the screen (bottom)"
    locate (10, 1)
    color (73) 
    put "Before the computer destroys all of his blocks on his side of the screen (top)"
    locate (13, 1)
    color (81) 
    put "You will use the 'Left' and 'Right' Arrow keys to move left and right"
    locate (16, 1)
    color (96)
    put "Good Luck and go smash some blocks!"
    var mainMenu : int := GUI.CreateButton (maxx, 0, 0, "Back To Main Menu", TheTitleScreen)
end Instructions

procedure TheTitleScreen

    var game_Button : int := GUI.CreateButton (300, 300, 0, "Click To Play!", Game)
    var optionMenu_Button : int := GUI.CreateButton (300, 200, 0, "Options Menu", Options)
    var instructions_Button : int := GUI.CreateButton (300, 100, 0, "Learn How To Play", Instructions)
end TheTitleScreen

TheTitleScreen

loop
    exit when GUI.ProcessEvent
end loop



-----------------------------------
Velocity
Thu Dec 08, 2011 1:15 am

RE:back to main menu (GUI Problem)
-----------------------------------
karma to helper cause i was trying for 30 mins now and i cant find no  answer to it... Ima hit the sheets cus i got school tomorrow but anyone help is greatly appreciated!!!!!

-----------------------------------
Tony
Thu Dec 08, 2011 2:23 am

RE:back to main menu (GUI Problem)
-----------------------------------
think about what's on your function call stack. Start poping items off (via terminating function calls) until you are back to where you are.

Naturally, you'd find that the relavant part of the code is
[code]
TheTitleScreen 

loop 
    exit when GUI.ProcessEvent 
end loop 
[/code]
Your title menu had to exit for the GUI loop to start.

By the time the game starts, the main menu is off the stack. There is nothing to get back to.

-----------------------------------
Velocity
Thu Dec 08, 2011 8:36 am

RE:back to main menu (GUI Problem)
-----------------------------------
so there is no need for a GUI.ProcessEvent?

-----------------------------------
Velocity
Thu Dec 08, 2011 8:43 am

RE:back to main menu (GUI Problem)
-----------------------------------
anyways thanks for trying, i gave you karma anyways.

EDIT: I mean thanks for helping me, although i am to stupid to realize what you meant, i guess my mind cant comprehend the knowledge that you put forth...

-----------------------------------
Tony
Thu Dec 08, 2011 2:10 pm

RE:back to main menu (GUI Problem)
-----------------------------------
I was talking about http://en.wikipedia.org/wiki/Stack-based_memory_allocation

Once you exit your game's loop, where will the control flow end up?

-----------------------------------
Velocity
Thu Dec 08, 2011 7:43 pm

RE:back to main menu (GUI Problem)
-----------------------------------
Well i got it to work thanks alot guys :) but i have a new problem! With my flickering.
