This project is a simple, browser-based text adventure game inspired by Dungeons & Dragons (D&D). It features a choice-based narrative with dice rolling mechanics for skill checks and combat scenarios. The game is built using HTML, CSS, and JavaScript, making it easy to host on platforms like GitHub Pages.
- Text-based adventure gameplay
- D&D-inspired dice rolling mechanics
- Simple inventory and stat tracking
- Branching narrative based on player choices
- Easy to customize and expand
You can play the game here: [Your GitHub Pages URL]
To set up this game on your own GitHub Pages:
- Fork this repository to your GitHub account.
- Clone the forked repository to your local machine.
- Ensure the main HTML file is named
index.html. - Push your changes to GitHub.
- Go to your repository settings on GitHub.
- Scroll down to the GitHub Pages section.
- Set the source to the main branch and save.
Your game should now be live at https://[your-username].github.io/[repository-name]/.
To add new scenes to the game:
- Open
index.htmlin a text editor. - Locate the
scenesobject in the JavaScript section. - Add a new scene following this template:
yourNewScene: {
text: "Description of the scene",
choices: [
{ text: "Choice 1", nextScene: "sceneForChoice1" },
{ text: "Choice 2", nextScene: "sceneForChoice2" }
],
effect: () => {
// Optional: Add any effects that should occur when entering this scene
}
}- Link your new scene from existing scenes by updating their
nextSceneproperties.
- To change dice rolling mechanics, modify the
rollDicefunction. - To alter character stats, update the variables at the top of the script (e.g.,
playerHealth,playerStrength). - To change how dice rolls affect gameplay, modify the
effectfunctions in relevant scenes.
Contributions to improve the game are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
This project is open source and available under the MIT License.
- Inspired by Dungeons & Dragons and classic text adventure games.
- Built with vanilla JavaScript, HTML, and CSS.
[Your Name] - [Your Email/Contact Information]
Project Link: https://github.com/your-username/your-repo-name