“librogame (Italian term for gamebooks / interactive fiction)”
A powerful, feature-rich engine for creating interactive text-based adventures and gamebooks (choose-your-own-adventure games) using vanilla HTML, CSS, and JavaScript.
- Character creation with name, stats, and perks
- 2d6 dice tests with animation, sound, and automatic failure nodes
- Conditional branching based on items, flags, perks, and stats
- Inventory system with descriptions, images, usage, and capacity
- Colored text and dialogue boxes
- Multi-language stories with runtime language switching
- Light and dark themes, responsive layout, and collapsible sidebars
- Background music, sound effects, and persistent audio settings
- Save and load through
localStorage - Markdown story converter included in
tools/
-
Clone the repository
git clone https://github.com/Z4RD0Z/librogame-engine.git cd librogame-engine -
Add your audio files
Place
dice.mp4insrc/music/and add any background tracks you want. -
Customize your story
Edit
story.json, or write in Markdown and convert it with the bundled Story Converter:python3 tools/story-converter/md2storyconvert.py \ tools/story-converter/story.md -o story.json
-
Launch the game
python -m http.server
Then open
http://localhost:8000. No build process is required.
Full documentation is available at z4rd0z.github.io/librogame-engine:
librogame-engine/
├── index.html # Main HTML file
├── styles.css # Engine styling
├── story.json # Story content, items, perks, and translations
├── js/
│ ├── main.js # Game engine logic
│ └── purify.min.js # DOMPurify – HTML sanitization library
├── src/
│ ├── images/ # Story and item images
│ └── music/ # Background music and sound effects
├── tools/
│ └── story-converter/ # Optional Markdown authoring tool
└── website/ # Docusaurus documentation site
The engine release archive contains only index.html, js/, styles.css, story.json, and LICENSE. The documentation site and the story converter are not included.
The repository ships with a complete example adventure, "L'Antica Cripta" / "The Ancient Crypt", demonstrating character creation, stat tests, inventory, conditional branches, music, one-shot choices, multiple endings, images, and colored text.
Contributions are welcome: bug reports, feature suggestions, pull requests, story templates, and translations.
See the Contributing guide for details.
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub Issues: Create an issue
- Email: send email
Built with ❤️ for storytellers and game creators
🎮 Happy adventuring! 🎲
