How can I make a 'main menu'?

KReed92
Hi guys :) Hope everyone is well.

I have probably a very simple question here but one I was just scratching my head over nontheless. At the start of my game, there is a title screen showing the name of the game and a 'press any key' message so it's like a 'press start' screen basically.

After that, I would like it to display a menu (preferably not a pop-up one) where it lists a couple of things in the centre of the screen and the player can click on them or type in the option they want. This is kind of what I had in mind:

START GAME
READ MANUAL
OTHER OPTIONS HERE
OTHER OPTIONS HERE

Then the player could click 'read manual' to have the game display the manual and then after a 'wait for a key press' script, take them back to the menu so that they could click 'start game'. I imagine this is really easy to set up but I wanted to make sure I did it correctly and efficiently :) I tried clicking the 'show a menu' thing but then it was asking for a list/dictionary and I've never worked with those before so I was a little lost with that and decided to try the above mentioned ideas instead.

Help is much appreciated :) x

jaynabonne
A simple way to do it is with CommandLink:

      msg (CommandLink("start game", "START GAME"))
msg (CommandLink("read manual", "READ MANUAL"))
msg (CommandLink("option 1", "OPTION 1"))
msg (CommandLink("option 2", "OPTION 2"))

The first param to CommandLink is the command to execute, and the second param is what to show in the link.
You'd then have to create commands for each menu choice.

  <command name="startgame">
<pattern>start game</pattern>
<script>
msg ("Your game will be starting shortly...")
</script>
</command>
<command name="readmanual">
<pattern>read manual</pattern>
<script>
msg ("As soon as I hire a writer...")
</script>
</command>

etc

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums