making a start menu

Started by Terrorcell, Sun 08/07/2007 06:08:50

Previous topic - Next topic

Terrorcell

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?

monkey0506

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:

Code: ags
gStartMenu.Visible = false;

GUI.Visible

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

Code: ags
player.ChangeRoom(1);

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.

Terrorcell

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.

Khris

You'll want both of the above then.
Turn off the GUI, then call ChangeRoom().

SMF spam blocked by CleanTalk