Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Terrorcell on Sun 08/07/2007 06:08:50

Title: making a start menu
Post by: Terrorcell on Sun 08/07/2007 06:08:50
hi, im making a start menu for my game. I have all the things like load and quit but I can't find out how to make the start button work. i want it so if you click the start button, it starts the game at room 1.
how do I do this?
Title: Re: making a start menu
Post by: monkey0506 on Sun 08/07/2007 06:31:24
It depends how you've set up your start menu. Are you using a GUI or a room? If you're using a GUI then it should be as simple as:

gStartMenu.Visible = false;
GUI.Visible (http://americangirlscouts.org/agswiki/GUI_functions_and_properties#GUI.Visible)

If you're using a room you'll have to move the player to room 1 using something like this:

player.ChangeRoom(1);
Character.ChangeRoom (http://americangirlscouts.org/agswiki/Character_functions_and_properties#Character.ChangeRoom)

You can also supply X and Y parameters to Character.ChangeRoom if you need to specify the co-ordinates the player should enter at.

I presume since you've already got things like load and quit working you're familiar with the script at least a little bit. Just put the appropriate line of code into the Click event script for the start button.
Title: Re: making a start menu
Post by: Terrorcell on Mon 09/07/2007 00:34:14
i have a room with a title as the background. i have a gui with 'start, load, exit' on it. what i wanted to know is what code do i need to use for the start button so that when you click on it, it takes you to room 1. the room with the title is room 0.
Title: Re: making a start menu
Post by: Khris on Mon 09/07/2007 00:35:17
You'll want both of the above then.
Turn off the GUI, then call ChangeRoom().