A simple text adventure game engine that lets you play JSON-based games and create your own adventures.
- Click "Manage Games" to open the game selection menu
- Either:
- Select a game from the dropdown and click "Load"
- Upload your own game JSON file
- Use text commands to play:
look
- Look around the current locationexamine [item]
- Look at a specific itemget [item]
- Pick up an iteminventory
- Check your inventoryuse [item]
- Use an item from your inventorygo [direction]
- Move in a direction (north, south, east, west)
Games are defined in JSON files stored in the games/ directory. Add your game file to scripts/config.js to make it appear in the game selection menu.
{
"type": "object",
"required": [
"game",
"locations",
"interactables",
"startingLocation",
"initialMessage"
],
"properties": {
"game": {
"type": "string",
"description": "The title of the game"
},
"locations": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"required": ["description", "exits", "interactables"],
"properties": {
"description": {
"type": "string",
"description": "Description of the location"
},
"exits": {
"type": "object",
"patternProperties": {
".*": {
"type": "string",
"description": "Direction mapped to destination location name"
}
}
},
"interactables": {
"type": "array",
"items": {
"type": "string",
"description": "Names of interactable items in this location"
}
}
}
}
}
},
"interactables": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"required": ["textResponse"],
"properties": {
"textResponse": {
"type": "string",
"description": "Description when examining the item"
},
"actionResponse": {
"type": "string",
"description": "Optional response when using the item"
}
}
}
}
},
"startingLocation": {
"type": "string",
"description": "Name of the location where the player starts"
},
"initialMessage": {
"type": "string",
"description": "Message shown when the game starts"
}
}
}