Skip to content

A module for writing simple state based text adventure games for the web.

Notifications You must be signed in to change notification settings

Halfwake/web-adventure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

A library for making choose-your-own-adventure games for the web. Just write the the states and run. The library will automatically build a working website for you!

The server is stateless so saving a game can be done by saving the link and the back and forward buttons always work.

Here's an example game.

Lets go inside.

Charge on!

...and we died.

Here are what the death definitions look like.

;; Excerpt from the example game.
(define-deaths "Dungeons and Dodecahedrons" start-journey
  run-away "You have shamfeully failed. Care to try again?"
  eaten-by-grue "You have been eaten by a glutounous grue. Care to try again?"
  ...rest-of-code-goes-here...)

;; Form of death definitions.
(define-deaths title-text the-start-state-so-we-can-try-again
  one-possible-death text-for-that-death
  ...)

Here are what state definitions look like.

;; Excerpt from the example game.
(define-states "Dungeons and Dodecahedrons"
  (start-journey "You see a dark cave."
                 "Enter" enter-cave
                 "Flee" run-away)
  (enter-cave "You are in a dark tunnel."
              "Proceed" eaten-by-grue
              "Light a Torch" view-cave)
  ...rest-of-code-goes-here...)

;; Form of state definitions.
(define-states title-text
  (name-of-state description-text
                 choice-text state-to-jump-to
                 ...)
  ...)

Full example code is available in test1.rkt

Things left to do: add formatting

About

A module for writing simple state based text adventure games for the web.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages