Skip to main content

A minimal engine for choose-your-own-adventure games.

Project description

:fried_shrimp: shrimpy

A minimal engine for choose-your-own-adventure games.

Install

Installing shrimpy is easy. To install shrimpy on your computer, open your terminal and enter:

sudo pip3 install shrimpy

About

In shrimpy, a game is simply a folder that contains scene files. Scene files are written in JSON.

Create

To create your first shrimpy game, make a new folder somewhere on your computer. Name your new folder hello-shrimpy.

Next, create a new file called start.json inside hello-shrimpy. Copy the following code into start.json:

{
  "id": "start",
  "text": "You lose!",
  "options": [
    {
      "text": "What? Already?",
      "scene": "end"
    }
  ]
}

Once you have saved start.json inside of the hello-shrimpy folder, create a second file in hello-shrimpy and name it end.json. Copy the following code into end.json:

{
  "id": "end",
  "text": "GAME OVER. Enter q to quit.",
  "options": [
    {
      "text": "(play again)",
      "scene": ""
    }
  ]
}

At this point, you should have a folder called hello-shrimpy that contains two files: start.json and end.json.

That's it! Your new shrimpy game is finished and ready to play.

Play

To play the game you just created, navigate into the hello-shrimpy folder and run:

shrimpy play

Quit

To quit playing a shrimpy game, you can always enter q when prompted for an option number.

Update

Shrimpy keeps getting better. To update shrimpy to the latest version, enter:

sudo pip3 install shrimpy -U

Uninstall

Down with shrimpy! To uninstall shrimpy from your computer, enter:

sudo pip3 uninstall shrimpy

Scene Schema

For your reference, the following JSON schema is used to validate scene files:

{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"type": "object",
	"properties": {
		"id": {
			"type": "string"
		},
		"text": {
			"type": "string"
		},
		"options": {
			"type": "array",
			"items": [
				{
					"type": "object",
					"properties": {
						"text": {
							"type": "string"
						},
						"scene": {
							"type": "string"
						}
					},
					"required": [
						"text",
						"scene"
					]
				}
			]
		}
	},
	"required": [
		"id",
		"text",
		"options"
	]
}

To learn more about JSON Schema, click here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shrimpy-0.1.13.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

shrimpy-0.1.13-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file shrimpy-0.1.13.tar.gz.

File metadata

  • Download URL: shrimpy-0.1.13.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-40-generic

File hashes

Hashes for shrimpy-0.1.13.tar.gz
Algorithm Hash digest
SHA256 3ffb578bc585d3bb0064ac1e30c6eaa7238f0dfc210595c29ed3c8126b3dbccb
MD5 08c601fe09452990505cd95e2eb792d9
BLAKE2b-256 0bb842808f365c1ba86c73a7d4d615ce642bddf3b98f60ba17c9861bbc25c84b

See more details on using hashes here.

File details

Details for the file shrimpy-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: shrimpy-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-40-generic

File hashes

Hashes for shrimpy-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 d375b10a1d43cef5e4bbd6b9047c08e8a88ab8290965868a1df30c363dc981c9
MD5 41e3f3064c2abb96fa3cf071273e6b91
BLAKE2b-256 6fbc654584b517aa1d2157d420aa64a4ebbf8d07dcb13b0c1f3d725640d647dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page