Working With...Scenery
Scenery assets are objects that only exist to provide descriptions of things in a scene, and are otherwise non-interactible. Many common scenery items, like the moon, the sun, and distant mountains, are available with built-in area scenery. This document instead focuses on unique pieces of scenery for specific one-off scenarios.
Demo Game
// WorkingWithScenery.js
/* global AdventureJS A WorkingWithScenery G */
var G = (WorkingWithScenery = new AdventureJS.Game(
"WorkingWithScenery",
"WorkingWithSceneryContainer"
));
// --------------------------------------------------
// Settings
// --------------------------------------------------
G.settings.set({
display: "inline",
layout: "classic",
title: "Working With Scenery",
author: "M.F.R. Puzo",
description: "Today we are Working With Scenery ",
version: "0.0.1",
debug: {
general: true,
},
log: {
all: true,
},
});
// --------------------------------------------------
// Player
// --------------------------------------------------
G.createAsset({
class: "Player",
name: "Fredo",
place: { in: "Monte Barraù" },
description: "{We're} an ordinary halfgoombahling. ",
});
// --------------------------------------------------
// Functions
// --------------------------------------------------
// We're going to ask this question a few times,
// so we'll make a little ad hock function to check.
const sees = function () {
return sighted() && seated();
};
const sighted = function () {
return G.$("One Orange Ring Pop").$is("worn");
};
const seated = function () {
return G.player.$is("on", "Seggiolone di Famiglia");
};
// --------------------------------------------------
// Rooms
// --------------------------------------------------
G.createAsset({
class: "Room",
name: "Monte Barraù",
synonyms: ["Barrau", "slope"],
descriptions: {
firstlook: `
After a long, arduous journey followed by the breaking of the Chumminess of the Ring Pop, and nearly dying at the hands of Al Neri, {we} fled to the top of {a:Monte Barraù} with the One Orange Ring Pop. The summit is capped by the wide flat family-style {a:Tavolo}, at which is placed a high chair, the {a:Seggiolone di Famiglia}.
<br/><br/>
For the sake of this demo, try {>:wear ring} and {>:sit on seat}, then {>:look}, and see what you can see.
`,
look: {
default: function () {
if (sees()) {
return `
{We} sit above the village of {a:Corleone} at the summit of {a:Monte Barraù}, upon the {a:Seggiolone di Famiglia}, with the {a:One Orange Ring Pop} on {our} finger.
Eastward {we} can see into wide uncharted lands, nameless plains, and forests unexplored. Beyond them, {a:Mount Etna} glows as orange as the Ring Pop upon {our} finger, like a bright baleful eye, or a marigold-fed egg yolk (especially good for making sheet pasta, yum).
Northward {we} can see where {a:Palermo} lays like a spray of fallen linguini spreading into the {a:Tyrrhenian Sea}, and beyond it far off {a:Isola delle Femmine}.
Westward {we} can see the {a:Mediterranean} and the tiny islands of {a:Favignana} and {a:Marettimo}, floating like meatballs in the saucey sea.
Southward {we} can see waves of hills rolling down and crashing into the {a:Mediterranean sea}, bouncing off far {a:Malta} like roiling water in a salted pan.
<br/><br/>
Everywhere {we} look {we} see signs of war. Taormina crawls with made men stockpiling gats on their way to the mattresses. Pastaios grind extra durum to supply protein for the marching troops. Winemakers on the slopes cover their vineyards with black burlap to protect against the farinaceous winds of war.
`;
} else {
return `
The summit of {a:Monte Barraù} is capped by the wide flat family-style {a:Tavolo}, at which is placed a high chair, the {a:Seggiolone di Famiglia}. For the sake of this demo, try {>:wear ring} and {>:sit on seat}, then {>:look}, and see what you can see.
`;
}
},
},
},
});
// “Soon he came out alone on the summit of Amon Hen, and halted, gasping for breath. He saw as through a mist a wide flat circle, paved with mighty flags, and surrounded with a crumbling battlement; and in the middle, set upon four carven pillars, was a high seat, reached by a stair of many steps. Up he went and sat upon the ancient chair, feeling like a lost child that had clambered upon the throne of mountain-kings.”
// “At first he could see little. He seemed to be in a world of mist in which there were only shadows: the Ring was upon him. Then here and there the mist gave way and he saw many visions: small and clear as if they were under his eyes upon a table, and yet remote. There was no sound, only bright living images. The world seemed to have shrunk and fallen silent. He was sitting upon the Seat of Seeing, on Amon Hen, the Hill of the Eye of the Men of Númenor. Eastward he looked into wide uncharted lands, nameless plains, and forests unexplored. Northward he looked, and the Great River lay like a ribbon beneath him, and the Misty Mountains stood small and hard as broken teeth. Westward he looked and saw the broad pastures of Rohan; and Orthanc, the pinnacle of Isengard, like a black spike. Southward he looked, and below his very feet the Great River curled like a toppling wave and plunged over the falls of Rauros into a foaming pit; a glimmering rainbow played upon the fume. And Ethir Anduin he saw, the mighty delta of the River, and myriads of sea-birds[…]”
// “But everywhere he looked he saw the signs of war. The Misty Mountains were crawling like anthills: orcs were issuing out of a thousand holes. Under the boughs of Mirkwood there was deadly strife of Elves and Men and fell beasts. The land of the Beornings was aflame; a cloud was over Moria; smoke rose on the borders of Lórien.”
// “Horsemen were galloping on the grass of Rohan; wolves poured from Isengard. From the havens of Harad ships of war put out to sea; and out of the East Men were moving endlessly: swordsmen, spearmen, bowmen upon horses, chariots of chieftains and laden wains. All the power of the Dark Lord was in motion. Then turning south again he beheld Minas Tirith. Far away it seemed, and beautiful: white-walled, many-towered, proud and fair upon its mountain-seat; its battlements glittered with steel, and its turrets were bright with many banners. Hope leaped in his heart. But against Minas Tirith was set another fortress, greater and more strong. Thither, eastward, unwilling his eye was drawn. It passed the ruined bridges of Osgiliath, the grinning gates of Minas Morgul, and the haunted Mountains, and it looked upon Gorgoroth, the valley of terror in the Land of Mordor. Darkness lay there under the Sun. Fire glowed amid the smoke. Mount Doom was burning, and a great reek rising. Then at last his gaze was held: wall upon wall, battlement upon battlement, black, immeasurably strong, mountain of iron, gate of steel, tower of adamant, he saw it: Barad-dûr, Fortress of[…]”
// “And suddenly he felt the Eye. There was an eye in the Dark Tower that did not sleep. He knew that it had become aware of his gaze. A fierce eager will was there. It leaped towards him; almost like a finger he felt it, searching for him. Very soon it would nail him down, know just exactly where he was. Amon Lhaw it touched. It glanced upon Tol Brandir – he threw himself from the seat, crouching, covering his head with his grey hood.”
// GODFATHER
// most scenes were not filmed in the actual town of Corleone. Instead, Coppola chose lesser-known but incredibly photogenic Sicilian villages not far from Taormina and Giardini Naxos
// Savoca is the most famous filming location from The Godfather Part I. It's where Michael Corleone begins his exile in Sicily and meets Apollonia.
// Bar Vitelli: This is where Michael asks Apollonia’s father for her hand. The bar still operates today, decorated with original film memorabilia and Godfather photos.
// Church of San Nicolò: Located just above Bar Vitelli, it served as the setting for Michael and Apollonia's wedding. San Nicolò church is opened every day the ticket cost €1.
// Savoca is a short drive from Taormina or Messina
// north: Cucco, Romissa
// south: Botte, Cantidati-Scorsonello, San Francesco di Paola
// south: Taormina, Mount Etna
// east: Ionian Sea, Reggio Calabria
// From Corleone
// north: Rocca Busambra (mountain), Palermo, Monte Pellegrino, Isola delle Femmine, Tyrrhenian Sea
// south: Sciacca, Eraclea Minoa, Mediterranean sea and Malta
// west: Marsala, the Mediterranean islands of Favignana and Marettimo
// east: Mount Etna, Ionian Sea, far off Ionian Islands
// --------------------------------------------------
// Objects
// --------------------------------------------------
G.createAsset({
class: "Chair",
name: "Seggiolone di Famiglia",
synonyms: ["seat", "high chair", "stone"],
place: { in: "Monte Barraù" },
is: { listed: false },
description: `
The {a:Seggiolone di Famiglia} is a high stone chair raised above the {a:Tavolo di Famiglia}
`,
doPlayerEnter: function () {
let msg = `{We} hoist {our} wee halfling bod up on the Seggiolone di Famiglia, a high stone chair made for the doughty goombahs of yore. `;
if (sighted()) {
msg += `At first {we} can see little. {We} seem to be in a world of schvitz. Then, like the emergency light in a steam room, the One Orange Ring Pop clears away the clouds of warm vapor; and many visions are revealed for {us} to {>:look} upon. `;
}
G.overrideOutput(msg);
},
doPlayerExit: function () {},
});
G.createAsset({
class: "Clothing",
name: "One Orange Ring Pop",
synonyms: ["chain"],
indefinite_article: "the",
place: { in: "Fredo" },
description: `{[if One Orange Ring Pop is worn]
The One Orange Ring Pop glows balefully upon {our} finger,
filling {our} mouth with the taste of blood orange.
[else]
The One Orange Ring Pop seems to pulse, dully, waiting
to be donned.
}`,
doWear: `[override]
Trembling {we} pull out the One Orange Ring Pop upon its chain and quickly slip it on {our} finger. A burst of orange flavor overwhelms {our} tastebuds.
`,
doRemove: `[override]
{We} take the One Orange Ring Pop off {our} finger. {Our} taste buds revert; all we can taste is the usual stale tacky taste of {our} own mouth and days of road food.
`,
});
// --------------------------------------------------
// Scenery Objects
// --------------------------------------------------
// Scenery - Tavolo di Famiglia
G.createAsset({
class: "Scenery",
name: "Tavolo di Famiglia",
place: { in: "Monte Barraù" },
description: `The Tavolo di Famiglia squats atop Monte Barraù, offering a wide flat surface on which to serve every course from antipasto to dolce. `,
print_on_verb_failure: `{We} don't need to worry about the Tavolo right now. `,
});
// Scenery - Mount Etna
G.createAsset({
class: "Scenery",
name: "Mount Etna",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `The distant volcanic mountain fills {us} with an overwhelming sense of dread. Like that time {we} ate a whole Neopolitan pizza covered with tainted sardines.`
: `Though {we} know that Mount Etna lies somewhere to the east, {we} can't see it from here now. `;
},
print_on_verb_failure: `
Every time {we} consider Mount Etna it just reminds {us} of that time we got screwed over by {our} insurer, Aetna. Who doesn't cover bullet wounds? Best to push it out of mind for now. `,
});
// Scenery - Corleone
G.createAsset({
class: "Scenery",
name: "Corleone",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `{Our} expanded vision pierces the schvitz to reveal the village of Corleone down the slope of Monte Barraù. On the village outskirts, a tiny black 1955 Cadillac LE explodes into flames. `
: `Though {we} know the village of Corleone to lie somewhere downslope to the north, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with the village of Corleone from here. `,
});
// Scenery - Palermo
G.createAsset({
class: "Scenery",
name: "Palermo",
definite_article: "",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
Elder mafia chieftains cavort in Palermo, nestled against the Tyrrhenian coast to the north, sending their uncouth gavoones to sea to wage vendetta after vendetta against each other.
`
: `Though {we} know that Palermo lies somewhere roughly to the north, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with Palermo from here. `,
});
// Scenery - Tyrrhenian Sea
G.createAsset({
class: "Scenery",
name: "Tyrrhenian Sea",
synonyms: ["Tyrrhenian Coast"],
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
The crashing waves of the Tyrrhenian Sea recede and in their troughs reveal the cement shoes of fallen Men from the North.
`
: `Though {we} know that the Tyrrhenian Sea lies to the north, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with the Tyrrhenian Sea from here. `,
});
// Scenery - Isola delle Femmine
G.createAsset({
class: "Scenery",
name: "Isola delle Femmine",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
Far to the west, on the small rocky island of Isola delle Femmine, thirteen Turkish maidens who were condemned for serious crimes have shipwrecked, or at least so says Stickimedia.
`
: `Though {we} know that the Isola delle Femmine lies west, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with Isola delle Femmine from here. `,
});
// Scenery - Mediterranean Sea
G.createAsset({
class: "Scenery",
name: "Mediterranean Sea",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
Far to the west, white sailed tall ships charge over the Mediterranean Sea, tacking towards conquest and perhaps a small late night dessert with just a drop of espresso.
`
: `Though {we} know that the Mediterranean Sea lies west, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with the Mediterranean Sea from here. `,
});
// Scenery - Favignana
G.createAsset({
class: "Scenery",
name: "Favignana",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
The tiny islands of Favignana and Marettimo sit like broken teeth in the mouth of the Mediterranean Sea.
`
: `Though {we} know that Favignana lies west, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with Favignana from here. `,
});
// Scenery - Marettimo
G.createAsset({
class: "Scenery",
name: "Marettimo",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
The tiny islands of Favignana and Marettimo sit like broken teeth in the mouth of the Mediterranean Sea.
`
: `Though {we} know that Marettimo lies west, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with Marettimo from here. `,
});
// Scenery - Malta
G.createAsset({
class: "Scenery",
name: "Malta",
place: { in: "Monte Barraù" },
description: function () {
return sees()
? `
To the far south, deep into the Mediterranean Sea, lies the tiny nation of Malta, like a ripe olive ready for the picking. Humongous beasts from the far south pass through it even now carried northward by fat ships on their way to distant battlefields.
`
: `Though {we} know that Malta lies somewhere to the south across the Mediterranean, it's not visible from here. `;
},
print_on_verb_failure: `{We} can't interact with Malta from here. `,
});
Demo Source files
Right-click and choose "Save as..." to download source files.
Notes:
- Demo games are set to a small size to fit doc pages. They can easily be enlarged via display settings.
- Demo games all use the same theme. Colors and fonts can be changed via custom CSS.
- Demo games don't include the core AdventureJS code. To run downloaded games locally, you'll need to also download copies of the core JS and CSS and set up this local folder structure.
AdventureJS └── js | └── adventure.js └── css | └── adventurejs.css └── games ├── demogame01 ├── demogame02 └── demogame03
Example Code
MyGame.createAsset({
class: "Scenery",
name: "Mount Doom",
description: `
The distant volcanic mountain fills you with an overwhelming sense of dread.
`,
// print_on_verb_failure will be printed for all verb failures
// so for instance "climb mount doom" will result in this
print_on_verb_failure: `
Even to consider Mount Doom fills you with a sense
of dread. Best to push it out of mind for now.
`,
});
Further Reference
- Scenery class in Reference Manual
- Working with Area Scenery