Create A Text Adventure In 30 Minutes

THE CAVE OF MAGIC is a tiny text adventure with JUST ONE PUZZLE, meant as a playable companion to the following tutorial video:

Location graphics are 128 x 40 pixels, and the title screen is 128 x 96 pixels.

This game is written using ADVENTURON, available at www.adventuron.io

ADVENTURON features code completion with CONTROL + SPACE, or ALT + SPACE (depending on OS).

The editor requires a DESKTOP PC, but games made with adventuron will play on mobile platforms.

The purpose of this game is to provide a minimalist demonstration of how to implement puzzles / markup and multimedia features with minimal source code.

Game / Graphics by Chris Ainsley.

Source Code (excluding graphics)


start_at                 = lakeside

locations {
   forest       : location "You are on the forest path.\nTall <TREES<4>> tower over you on both sides." ;
   outside_cave : location "You are standing outside <THE CAVE OF MAGIC<5>>" ;
   inside_cave  : location "You are inside <THE CAVE OF MAGIC<5>>" ;
   lakeside     : location "You are by the side of a <BEAUTIFUL LAKE<2>>." ;
}

objects {
   troll    : scenery "an enormous troll" start_at = "outside_cave" ;
   sleeping_troll : scenery "an enormous troll (sleeping)" ;
   apple    : object  "an apple" ;
   treasure : object  "a pile of treasure" start_at = "inside_cave" ;
}

connections {
   from, direction, to = [
      lakeside, north, forest, 
      forest, north, outside_cave, 
      outside_cave, north, inside_cave, 
   ]
}

on_startup {
   
   //: print_graphic "outside_cave" ;
   
   : print "^c^THE MAGIC CAVE AWAITS YOU" ;
   : beep millis = "100"  pitch = "0" ;
   : beep millis = "100"  pitch = "2" ;
   : beep millis = "100"  pitch = "4" ;
   : beep millis = "100"  pitch = "6" ;
   
   : press_any_key ;
   : beep millis = "100"  pitch = "6" ;
   : beep millis = "100"  pitch = "4" ;
   : beep millis = "100"  pitch = "2" ;
   : beep millis = "100"  pitch = "0" ;
}

barriers {
   block_cave : block {
      location               = inside_cave
      message                = THE TROLL IS GUARDING THE CAVE.
      block_when_exists      = troll
      show_blocked_exit      = true
   }
}


on_command {
   : match "pick apple;get apple"  {
      : if (is_at "forest" && has_not_created "apple") {
           : print "You reach up and take an apple from the tree.";
         : pocket "apple" ;
         : done;         
      }
   }
   : match "examine trees; examine tree; examine forest"  {
      : if (is_at "forest") {
         : print "Apple trees." ;
      }
   }
   : match "examine troll;talk troll"  {
      : print "<\"I'm so hungry\"<3>>, says the enormous TROLL in the deepest possible voice." ;
   }
   : match "give apple"  {
      : if (is_present "troll" && is_carried "apple") {
         : print "The troll grabs the apple from you hungrily. Unfortunately (for the troll), the apple is an <ENCHANTED APPLE<12>>, and sends the troll directly to sleep." ;
         : destroy "apple" ;
         : swap o1 = "troll"  o2 = "sleeping_troll" ;
         : press_any_key ;
         : redescribe;
      }
   }
   
   : match "eat apple"  {
      : if (is_present "apple") {
         : print "Unfortunately, the apple was an <ENCHANTED APPLE<12>>, and you will now go to sleep - forever." ;
         : print "^r^<GAME OVER<2>>" ;
         : end_game ;         
      }
   }
   
}

on_tick {

   : if (is_present "troll") {
      : beep millis = "100"  pitch = "-2" ;
      : beep millis = "100"  pitch = "-4" ;
      : beep millis = "300"  pitch = "-8" ;
      : print "The troll says, <\"THE CAVE IS MINE, GO AWAY\"<2>>." ;
   }
   
   : if (is_at "inside_cave" ) {
      : beep millis = "200"  pitch = "0" ;
      : beep millis = "400"  pitch = "10" ;
      : print "^r^CONGRATULATIONS !" ;
      : print "^r^YOU WON THE GAME !" ;
      : print "^r^YOUR RANKING IS : JUNIOR ADVENTURER !" ;
      : press_any_key ;
      : clear_screen;
      //: print_graphic "logo" ;
      
      : print "This tiny adventure was written using Adventuron." ;
      : print "Adventuron is a free text adventure creation language and development system." ;
      : print "Visit the website, and make a world of your own." ;
      : print "^r^<www.adventuron.io<12>>" ;
      : end_game ;
   }
}

Adventuron Classroom is an game building toolkit for building text adventure games -in the browser (editor requires desktop PC). 

Ideal as a introduction to coding for 8-12 year olds, Adventuron Classroom features a full course on how to develop a full retro-style text adventure game..

It features tooling to make it easy to code, right inside the browser. 

Export the game as HTML, ready to be published on Itch or other platforms.


In addition to the built-in tutorial (aimed at children), an additional video tutorial (aimed at adults) is available here:


Updated 16 days ago
Published 27 days ago
StatusReleased
PlatformsHTML5
Rating
(1)
AuthorAdventuron
GenreInteractive Fiction
Tagsadventuron, Fantasy, Text based, tuturial

Download

Download
ZX-Spectrum--The-Cave-Of-Magic-V101.tap 19 kB

Development log

Leave a comment

Log in with itch.io to leave a comment.