Tip: you can use rooms as "menus" for your game.

Kln

As you may have noticed, the game throws you directly into the action. However, it may be nice for the player to have the time to check what they are jumping into (I'm thinking especially to the people making horror games or adult games), modify some options, or just reload a game without having to go through the intro again.

The solution I found is to use one or several rooms as "menu screens".

Step 1: create your room

createRoom("mainMenu", {
  alias: "Main menu",
  desc: "This is the main menu. Examine the "New Game" item present in the room to start the game. Flip the switch to enable the hard mode."
});

Step 2: create the items which will act as placeholders for your menu
1: the hard mode switch

createItem("hardMode", SWITCHABLE(false, "enabled") {
  loc: "mainMenu",
  alias: "Hard mode",
  examine: "Use the switch command to enable or disable hard mode."
}

2: the new game. Notice that when the player confirms, he is "teleported" to the real game with world.setRoom()

createItem("newGame", {
  alias: "New Game",
  loc: "mainMenu",
  examine: function() {
    showYesNoMenu("Start a new game?", (answer) => {
      if (answer === "Yes") {
         return world.setRoom(game.player, "lounge");
      }
    })
  })

Kln

()


That's pretty cool.

Pixie has an old Quest example where this same method is used to emulate an in-game computer system, too. (If I could find, I'd drop a link.)


This is what I did with Quest 5:
https://github.com/ThePix/quest/wiki/Modelling-a-computer-system

Quest 6 is rather more flexible, you could just use an array of dictionaries for example. I appreciate if you are just starting out "array of dictionaries" may not mean anything to you, and I have to say it is great you can get stuff working like this anyway.


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

Support

Forums