A cyberpunk text adventure game built with vanilla JavaScript, featuring an AI-powered narrator and centralized text management system.
Oracle Pathways is an interactive text adventure that takes place in a digital realm.
This is an ongoing project. Look at this as a proof of concept at this stage.
/
├── index.html # Main HTML structure
├── styles.css # Terminal-style CSS
├── favicon.png # Game icon
└── js/
├── main.js # Application entry point and UI initialization
├── game.js # Core game logic and state management
├── commands.js # Command parsing and execution
├── rooms.js # Room definitions and descriptions
├── narrator.js # Local and AI-powered narration system
├── ui.js # User interface management
├── storage.js # Save/load functionality
├── utils.js # Utility functions
└── texts.js # Centralized text management system
Text Management System
- All hardcoded strings centralized in
texts.js - Dynamic text population via JavaScript
- Template support for variable substitution
- Easy localization and maintenance
Game State Management (Ongoing)
- Player statistics (health, attack, energy, knowledge)
- Inventory system
- Room exploration and mapping
- Game flags and progression tracking
Command System
- Natural language command parsing
- Context-aware responses
- Item interaction and usage
- Knowledge-based progression
- Clone or download the project files
- Serve the files using a local web server (required for ES6 modules)
- Open the application in a browser
# Using Python 3
python -m http.server 8000
# Using Node.js (if you have http-server installed)
npx http-server
# Using PHP
php -S localhost:8000go [direction]- Move north, south, east, or westlook- Examine current roomtake [item]- Pick up itemsinspect [target]- Examine items or room featuresuse [item]- Use items (with optional target)inventory- View carried items and statsrest- Recover health and energydecode- Decode knowledge fragments (requires 30+ knowledge)end- Trigger game endinghelp- Display available commands
- Click the "AI" button in the interface
- Enter your Groq API key when prompted
- Get a free API key at console.groq.com
- The AI narrator will provide dynamic commentary on your actions
- Use the save slot dropdown to select a slot (1-3)
- Click "Save" to store your current progress
- Click "Load" to restore a saved game
- Game state is stored in browser localStorage
Knowledge is gained through:
- Inspecting rooms and items
- Taking specific items (datachip, book)
- Using items in specific locations
- Decoding fragments
The game features four different endings based on knowledge level:
- Ascension (80+ knowledge): Become one with the Oracle
- Liberation (50+ knowledge): Break free with understanding
- Partial Knowledge (25+ knowledge): Leave with fragments of truth
- Forgotten (<25 knowledge): Fade into background noise
- Each action costs 2 energy points
- Resting recovers 40 energy and 10 health
- Energy affects gameplay progression
New Rooms
- Add room definition to
rooms.js - Update room connections and exits
- Add room-specific text to
texts.jsif needed
New Commands
- Add command parsing logic to
commands.js - Implement command functionality
- Add command help text to
texts.js
New Text Content
- Add text constants to
texts.js - Use
formatText()for dynamic content - Use
getRandomText()for varied responses
- ES6 modules with import/export
- Consistent error handling with null checks
- Centralized text management
- Functional programming approach
- Clear separation of concerns
- Modern browsers with ES6 module support
- Chrome 61+, Firefox 60+, Safari 10.1+, Edge 16+
- Local server required for development
This project is open source. Feel free to modify and distribute according to your needs.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues or questions:
- Check the browser console for error messages
- Ensure you're serving files from a local server
- Check that all JavaScript modules are loading correctly
