Goals, Hints, and Scores:Hintcard Longhand
Hintcards are a system for creating and displaying hints, which are managed by the HintManager. The longhand shown here offers a bit more control than the shorthand, by letting authors create hint objects directly. Longhand takes plain Javascript objects, and uses them to build hint data objects. Each hint consists minimally of a descriptive text, and a name if it's a group.
example code
MyGame.hintcard.set({
introduction: `Welcome to the hints for my awesome game. `,
hints: {
"Chapter 1": {
text: "In which our hero explores the castle. ",
active: true,
hints: {
"The Wizard's Bedroom": {
text: "In which our hero explores a magical boudoir.",
active: true,
hints: {
1: "Have you tried looking in the closet?",
2: "Have you tried looking in the chest?",
3: "Have you tried looking in the desk?",
},
},
},
},
},
});
example game
var MyGame = new adventurejs.Game("MyGame", "MyGameDisplay");
MyGame.hintcard.set({
introduction: `Welcome to the hints section for my awesome game. Hints will try to guide you gently to solutions. `,
hints: {
"Chapter 1": {
text: "In which a witch gets a switch. ",
hints: {
"The Castle": {
text: "In the old castle.",
hints: {
1: "Have you tried looking in the bedroom?",
2: "Have you tried looking in the square?",
"The Wizard's Bedroom": {
text: "In which our hero explores a magical boudoir.",
hints: {
1: "Have you tried looking in the closet?",
2: "Have you tried looking in the chest?",
3: "Have you tried looking in the desk?",
"Beneath the Bed": {
text: "Does the wizard need a housekeeper?",
hints: {
1: "Is it bigger underneath than above?",
2: "Have you shined a light beneath the bed?",
3: "Take the mirror ball from under the bed.",
},
},
},
},
"The Square": {
description: "In which etc...",
hints: {
"The Butcher's": {
description: "In which etc...",
hints: {
1: "Have you tried looking in the beef?",
2: "Have you tried looking in the chicken?",
3: "Have you tried looking in the pork?",
},
},
"The Baker's": {
description: "In which etc...",
hints: {
1: "Have you tried looking in the focaccia?",
2: "Have you tried looking in the bolo?",
3: "Have you tried looking in the pastry?",
},
},
"The Candlestick Maker's": {
description: "In which etc...",
hints: {
1: "Have you tried looking in the wax?",
2: "Have you tried looking in the oven?",
3: "Have you tried looking in the forge?",
},
},
},
},
},
},
},
},
"Chapter 2": {
description: "In which etc...",
hints: {
"The Wilds": {
description: "In which etc...",
hints: {
"The Moors": {
description: "In which etc...",
hints: {
1: "Have you tried looking in the muck?",
2: "Have you tried looking in the mud?",
3: "Have you tried looking in the silt?",
},
},
"The Forest": {
description: "In which etc...",
hints: {
1: "Have you tried looking in the tree?",
2: "Have you tried looking in the grass?",
3: "Have you tried looking in the pond?",
},
},
},
},
},
},
},
});