Cave
by William Stott (2004)
Genres: Cave crawl


action: %
response: Dragonflies hum and hover, and you hear the occasional splash of feeding fish. There is a little path winding between dense trees towards the south.
You can go south (further into the trees).

You can see some long reeds and a large iron key here.
action: About yourself
response: You are wearing the traditional clothing of an adventurer.
action: You examine the reeds
response: You see a mass of reeds that sway gently in the shallow water.
Looking in the reeds, you find a sack. There is something inside...
action: You take the sack
response: Taken.
action: You examine the key
response: You see a large, dull iron key that must be for an ancient door.
action: You open the sack
response: You see a hessian sack.
Inside is a reed flute...
action: You examine the flute
response: The flute is made of elaborately-carved wood.
action: You go south
response: The twisting path leads east deeper into the forest and continues north, winding into the trees. There is an old tree-stump next to the path where once a great oak tree must have stood. It seems to be hollow in the centre.
You can go north (along a path to a lake) or east (further into the forest).

You can see a hollow tree stump here.
action: You examine the stump
response: You look carefully in the hollow tree stump and. find a box of matches...
action: You look at the matches
response: You see a box of matches. It's nearly full.
action: Inventory
response: You are carrying:
a large iron key
a brown hessian sack
a reed flute
action: You take the matches
response: Taken.
action: You play flute
response: OK... squeeeak...
(You don't know how to play it properly - perhaps you need an instruction booklet...)
action: Go east
response: The opening to a deep cave leads eastwards into darkness, and the path winds west into the forest.
You can go west (to the forest) or east (into the dark cave).

You can see a small candle stub (unlit) and an ancient silver coin here.
action: Info
response: Cave (a short demo using sounds and pictures in Glulx)

a good idea to read both of these first.

I've put comments in the accompanying source code to help explain what's going on. Please feel free to borrow any ideas. All the trickier stuff is taken straight from the examples in the Gull documentation, where it's explained fully.

The pictures and sounds used here have been borrowed from the children's game Dragon Adventure (also in the IF Archive). The game was originally written in BASIC for RISC OS computers, and I wanted to use the same pictures and sound files in the Glulx version. The various picture sizes were chosen to fit the 640 x 480 VGA screen of the original version. At higher screen resolutions the pictures appear smaller, and remain with a fixed offset from the left side of the main window. I haven't found a way round this with Glulx.

effect samples. This gives links to thousands of AU, AIFF and (mostly) WAV samples (I found 106 elephant sounds, for instance), though you need to check the copyright status before using anything.

You'll probably also need an editor for trimming and changing the volume of sound samples. One good one is Audacity, a freeware open source editor for Windows, Linux and the Mac (from

conversion to AIFF. 8-bit mono at 11 or 16KHz seems to be about the best compromise between file length and quality for basic game sound effects.

rival Photoshop. It's available for Windows, Linux and the Mac, and, once you get the hang of it, is useful for both image creation and manipulation.

Like its parent game, this demo has a built-in picture map on screen which shows the places visited (type 'map'). Sound effects can be turned off or on by 'sound off/on'. It's also possible to see briefly inside the dark cave by striking a match, and 'listen' will replay the sound heard by the lake. The demo has no set game ending (in case anyone tries to find one!).

William Stott, June 2004

(Type LOOK or L to see where you are in the game)
action: You examine the coin
response: The coin is very old and made of silver. On one side you see the portrait of an ancient king, on the other there is a picture of a galloping horse. It looks quite valuable.
action: Light candle
response: OK... you light the candle using the matches...
action: Go east
response: The cave floor is moist from condensation, and your flickering candle casts pools of pallid light which sway and dance through the shadows. The cave exit is to the west.

You can see a mouldy old boot here.
action: You look at it
response: You see an old, mouldy boot.
action: Inventory
response: You are carrying:
a mouldy old boot
an ancient silver coin
a small, burning candle stub (providing light)
a box of matches
a large iron key
a brown hessian sack
a reed flute
action: Look around
response: The cave floor is moist from condensation, and your flickering candle casts pools of pallid light which sway and dance through the shadows. The cave exit is to the west.
action: Dig
response: What do you want to dig?
action: You go west
response: The opening to a deep cave leads eastwards into darkness, and the path winds west into the forest.
You can go west (to the forest) or east (into the dark cave).
action: Go west
response: The twisting path leads east deeper into the forest and continues north, winding into the trees. There is an old tree-stump next to the path where once a great oak tree must have stood. It seems to be hollow in the centre.
You can go north (along a path to a lake) or east (further into the forest).

You can see a hollow tree stump (which is empty) here.
action: Go north
response: Dragonflies hum and hover, and you hear the occasional splash of feeding fish. There is a little path winding between dense trees towards the south.
You can go south (further into the trees).

You can see some long reeds here.
action: You take the reeds
response: They're fixed in place.
action: You look at the lake
response: You see a mass of reeds that sway gently in the shallow water.
You see nothing special about the long reeds.
action: You drop the boot
response: Dropped.
action: You look around
response: Dragonflies hum and hover, and you hear the occasional splash of feeding fish. There is a little path winding between dense trees towards the south.
You can go south (further into the trees).

You can see a mouldy old boot and some long reeds here.
action: You wear the boot
response: (first taking the mouldy old boot)
You can't wear that!
action: You look
response: Dragonflies hum and hover, and you hear the occasional splash of feeding fish. There is a little path winding between dense trees towards the south.
You can go south (further into the trees).

You can see some long reeds here.
action: You listen
response: You hear the occasional splash of fish feeding near the surface.