Coder Social home page Coder Social logo

skzhengkai / mountaintop Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

An interactive A.I. text adventure game where you play as an adventurer climbing a mountain. Your guide is an A.I. wizard who tracks your stats and responds to your input to progress the story.

License: MIT License

JavaScript 100.00%

mountaintop's Introduction

MountainTop

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.

Usage

To play MountainTop:

  1. Get a Google API key:
  2. Clone the repo
  3. Create a .env file with your API key:
    GOOGLE_APIKEY=your_api_key
    
  4. Run npm install to install dependencies
  5. Run node index.js to start the game
  6. Type your responses to the wizard's prompts to progress the story

Code Overview

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.

Contributing

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

License

This project is open source and available under the MIT License.

mountaintop's People

Contributors

skzhengkai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.