8000 GitHub - aeqz/cli-game-engine
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aeqz/cli-game-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Game Engine

A CLI game engine that plays simple games defined in YAML:

cabal run play -- example/game.yml

Although games can be provided in YAML, this is a sketch of their model:

-- A game consists of an optional introductory section and a set of stages
data Game =
  Game
    { intro  :: Maybe Section,
      stages :: Set Stage
    }

-- A stage is a sequence of sections
data Stage =
  Stage
    { sections :: [Section]
    }

-- A section is a sequence of steps with a game progress requirement
-- (i.e. dependencies from other stage sections)
data Section = Section
  { requirements :: Progress,
    steps        :: [Step]
  }

-- A step can be one of the following:
data Step
  = Speak String String -- A character telling something
  | StoryTeller String  -- The storyteller telling something
  | Decision [Choice]   -- The player has to decide among some options

-- An option can be correct or not, and it can lead to more steps
data Choice =
  Choice
    { correct  :: Bool,
      text     :: String,
      subSteps :: [Step]
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0