An interactive text adventure game where you play as an adventurer climbing a mountain. Your guide is a wizard who tracks your stats and responds to your input to progress the story.
To play MountainTop:
- Get a Google API key:
- Go to https://developers.generativeai.google/tutorials/setup
- Click "Get an API key" and join the waitlist
- Once approved, copy your API key
- Clone the repo
- Create a .env file with your API key:
GOOGLE_APIKEY=your_api_key
- Run
npm install
to install dependencies - Run
node index.js
to start the game - Type your responses to the wizard's prompts to progress the story
The main game logic is handled in index.js. It initializes the user stats and contains the input loop.
Functions for generating AI responses are in palm.js.
Message history and stats are tracked in messagemanager.js.
User input is retrieved with readline.js.
Initial prompts are defined in prompt-maker.js.
The game uses ANSI escape codes to colorize output.
Contributions welcome! Feel free to open issues and submit pull requests.
Some ideas for improvements:
- Add more story content
- Expand the combat system instead of replying on the AI to handle it by itself.
- Implement an inventory system instead of replying on the AI to remember it itself. Similar to how the health/gold/hunger stats is currently implemented.
- Add side quests?
- Improve the text parser
This project is open source and available under the MIT License.