https://github.com/wolfadex/questing
https://github.com/wolfadex/questing
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/wolfadex/questing
- Owner: wolfadex
- Created: 2017-12-30T14:48:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-31T00:45:48.000Z (over 8 years ago)
- Last Synced: 2025-03-13T19:50:41.115Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# questing
### Install:
`yarn add questing` or `npm install --save questing`
### Use:
`gameData.json`
```JSON
{
"title": "Brief",
"author": "Wolfgang Schuster",
"inventory": [],
"location": "start",
"items": {
"pebble": "A tiny stone, not sure it could be used for anything"
},
"spaces": {
"start": {
"description": "A small white room with a red door and a steel gate.",
"exits": {
"red_door": {
"destination": "end",
"locked": "pebble"
},
"steel_gate": {
"destination": "other",
"locked": false
}
},
"items": []
},
"other": {
"description": "A circular room with a steel gate.",
"exits": {
"steel_gate": {
"destination": "start",
"locked": false
}
},
"items": [
"pebble"
]
},
"end": {
"description": "A large open field, you've won the game!",
"exits": {
"red_door": {
"destination": "start",
"locked": false
}
},
"items": []
}
}
}
```
`myGame.js`
```JavaScript
const questing = require('./index');
const gameData = require('./gameData.json');
questing(gameData);
```
Then just `node ./myGame` from a terminal!