How do you make a main menu thingamagigo?

Started by , Sun 08/05/2005 08:52:18

Previous topic - Next topic

freekingmaniac

In my game, I want it so that you can go back to the main menu at any time in the game. Is this possible, coz i don't wanna have to put a 'GO back to main menu' Object on each level.

TerranRich

Add an opton to whatever GUI you're using.

For example, if you're using the Sierra style drop-down GUI, have a button that says "Back to Main Menu" or something like that. Then that will bring the player back to that room #.
Status: Trying to come up with some ideas...

freekingmaniac


Gilbert

Just make a GUI with a button which go back to the room where the main menu is in.

freekingmaniac

So, all i have to do is call the button 'Go back to main menu'? i don't have to edit the scripting or anytihng? wow.

freekingmaniac

wut the? can someone tell me it a bit simpler. how do i "name the button"?

Mozesh

Ehm have you thought about reading at least a word in thà  manual?
Here if you add another button to the standard icon bar:
This is the original code for that bar (in my game that is)
Code: ags

if (interface == ICONBAR) {
    if (button == 4) {  // show inventory
      show_inventory_window();
    }
    else if (button == 5) {   // use selected inventory
      if (character[ GetPlayerCharacter() ].activeinv >= 0)
        SetCursorMode(4);
    } 
    else if (button == 6)    // save game
      SaveGameDialog();
    else if (button == 7)   // load game
      RestoreGameDialog();
    else if (button == 8)   // quit
      QuitGame(1);
    else if (button == 9)    // about
      Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones");
  }

And this is what you should have when added another button:
Code: ags

if (interface == ICO) {
    if (button == 4) {  // show inventory
      show_inventory_window();
    }
    else if (button == 5) {   // use selected inventory
      if (character[ GetPlayerCharacter() ].activeinv >= 0)
        SetCursorMode(4);
    } 
    else if (button == 6)    // save game
      SaveGameDialog();
    else if (button == 7)   // load game
      RestoreGameDialog();
    else if (button == 8)   // quit
      QuitGame(1);
    else if (button == 9)    // about
      Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones");
    else if (button == 10)   // main menu
      NewRoom(99);
  }

Atleast if the new button is numbered 10.
and the main menu room is numbered 99.
But my advice is: read the manual, please do.
(this is made for AGS 2.62, I wasn't able to check it since Im somewhere else but I don't think I made a typo)

TerranRich

Read the manual starting from the beginning. Do the tutorials available on the main page. There is a difference between asking questions about problems you're running into, and not even knowing where to begin.
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk