This document was created by GitHub A.I. Read with caution...
A text adventure game inspired by Disney's Haunted Mansion attraction, featuring atmospheric audio and faithful recreation of the mansion's iconic locations and mysteries. Originally built as a Java applet in 2002, now modernized with JavaScript ES6 and enhanced with advanced interactive features. The engine is now configurable and reusable for creating different text adventure games.
java/- Original 2002 Java applet implementation with CSV data and .au audio filesjavascript/- Modern 2025 JavaScript version with JSON data, MP3 audio, configurable game system, and enhanced featuresjava-to-javascript-conversion/- Development notes and conversion documentation
HauntedMansionMap.png- Original visual layout of the mansionGameMap.md- Detailed ASCII art map with room connections and analysisInteractiveMap.html- Interactive web-based map with clickable rooms
The mansion contains 52 rooms across 3 floors (plus attic), with complex vertical connections via staircases. Key areas include the Grand Ballroom complex, mysterious Seance Room, hidden Secret Rooms, and the final Attic confrontation with the Ghostly Bride.
This interactive text adventure allows players to explore a virtual version of Disney's Haunted Mansion, complete with the famous rooms, supernatural encounters, and eerie atmosphere that makes the attraction so memorable. Originally built as a Java applet in 2002, the game has been modernized with JavaScript ES6, featuring enhanced interactive systems, data-driven configuration, and improved user experience.
- Portrait Gallery - Watch portraits age before your eyes
- Foyer - Experience the flickering candles and organ music
- Grand Ballroom - Witness the ghostly dancing and hear the phantom organ
- Attic - Explore the mansion's mysterious upper levels
- Seance Circle - Encounter supernatural phenomena
- Graveyard - Navigate the outdoor cemetery areas
- And many more iconic locations from the attraction
- Text-based Commands - Traditional adventure game interface with modern enhancements
- ActionItem System - Advanced item interactions with verb/noun combinations
- Dynamic World - Items can unlock doors, reveal secrets, and modify the game world
- Hidden Item System - Pre-defined items revealed through searching and exploration
- Inventory System - Collect and use items throughout the mansion
- Atmospheric Audio - Location-specific background sounds and music with user control
- Puzzle Elements - Solve mysteries, unlock doors, and uncover secrets
- Exploration - Navigate freely between connected rooms with dynamic exits
- Background Audio - Authentic atmospheric sounds for each location with MP3 support
- Audio Control - Player-controlled sound on/off with dynamic zone management
- Silent Rooms - Strategic audio design with dramatic silence for atmospheric effect
- Modern Web Interface - JavaScript-based game running in modern browsers
- Error Handling - In-game feedback for configuration issues and loading errors
javascript/js/Adventure.js- Main game engine with enhanced command processing and ActionItem integrationjavascript/js/CreateWorld.js- World generation, JSON data loading, and hidden item managementjavascript/js/Item.js- Enhanced item class with ActionItem functionality and action trackingjavascript/js/Location.js- Room management with dynamic exit modification supportjavascript/js/Parse.js- Command parsing and natural language processing
java/Adventure.java- Original applet class and game controllerjava/CreateWorld.java- World generation and data loading systemjava/Player.java- Player state and inventory managementjava/Parse.java- Command parsing and natural language processing
java/Location.java- Individual room/area implementationjava/Exit.java- Movement connections between locationsjava/SpecialLocation.java- Locations with unique behaviorsjava/SpecialExit.java- Exits with special conditions or effects
java/Item.java- Base item class for objects in the gamejava/Inventory.java- Player inventory managementjava/ActionItem.java- Items with special behaviorsjava/carryable.java- Items that can be picked up
javascript/js/SoundPlayer.js- Modern web audio controller with MP3 support and user interaction compliancejavascript/js/SoundList.js- Audio resource management and caching- Data-driven Audio - JSON configuration for flexible audio zone management
java/SoundPlayer.java- Audio playback controllerjava/SoundLoader.java- Sound file loading and cachingjava/SoundList.java- Audio resource management
java/Display.java- Text output and formattingjava/GUI.java- Graphical user interface components
javascript/data/hm_map.json- Room definitions, connections, and descriptions in structured JSONjavascript/data/hm_items.json- Enhanced item system with ActionItem support, hidden items, and complex interactionsjavascript/data/hm_audio.json- Data-driven audio zone configuration with silent room supportjavascript/data/hm_config.json- Game configuration for customizable messages, titles, and file paths
javascript/data/ITEMS-README.md- Complete guide to the item system, ActionItem capabilities, and smart matchingjavascript/data/LOCATIONS-README.md- Room design guide, navigation system, and best practices
java/hm_map.csv- Original room definitions, connections, and descriptionsjava/hm_items.csv- Original item locations, properties, and descriptionsjava/audiolist.txt- Original sound assignments documentation
RoomID,N,S,W,E,U,D,Name,Description
2,0,0,0,0,0,0,Foyer,"You are standing in the foyer of the Mansion..."
3,1,0,12,0,0,Portrait Gallery,"You are in a large portrait gallery..."LocationID,ItemName,ShortDesc,LongDesc,Carryable
9,"book","a hardback book","Edgar Allan Poe collection...",true- Foyer - Haunting organ music
- Ballroom - Mad waltz and phantom dancing
- Attic - Creaking floorboards and mysterious sounds
- Graveyard - Ghostly choir and supernatural effects
- Loading Zone - Spectral winds and ghostly bells
javascript/audio/foyer.mp3- Foyer background musicjavascript/audio/ballroom.mp3- Ballroom dancing musicjavascript/audio/attic.mp3- Attic ambient soundsjavascript/audio/atticledge.mp3- Attic ledge overlook atmospherejavascript/audio/storm.mp3- Thunder and lightning effectsjavascript/audio/doors.mp3- Creaking door soundsjavascript/audio/load.mp3- Loading area atmosphere
java/foyer.au- Original foyer background musicjava/ballroom.au- Original ballroom dancing musicjava/attic.au- Original attic ambient soundsjava/atticledge.au- Original attic ledge atmospherejava/storm.au- Original thunder and lightning effectsjava/doors.au- Original door sound effectsjava/load.au- Original loading area atmosphere
N, NORTH - Move north
S, SOUTH - Move south
E, EAST - Move east
W, WEST - Move west
U, UP - Go upstairs
D, DOWN - Go downstairs
LOOK - Examine current location
EXAMINE item - Look at specific item (fallback support for any item)
SEARCH item - Search items for hidden objects (fallback support for any item)
GET/TAKE - Pick up items (supports GET ALL)
DROP item - Drop items from inventory (supports DROP ALL)
INVENTORY (I)- Show carried items
VERBOSE ON/OFF - Toggle detailed descriptions
SOUND ON/OFF - Control atmospheric audio
HELP - Display command reference
QUIT - Exit game with confirmation (YES/NO/RESTART options)
READ book - Read books and documents
SEARCH book - Find hidden bookmarks and secrets
UNLOCK door - Use keys to unlock doors
LOCK door - Lock doors with keys
CLIMB ladder - Use ladder in specific rooms
MOVE/PUSH painting - Reveal hidden safes
OPEN safe - Open safes with required items
LISTEN door/raven - Atmospheric audio interactions
PLAY organ - Complex puzzle interactions that modify multiple rooms
USE relic - Banish ghosts and transform room descriptions
ACTIVATE lever - Trigger mansion-wide mechanical changes
GOTO <room> - Teleport to any room by number (debug mode)
For troubleshooting and development, several functions are available in the browser console:
debugAudio() - Display comprehensive audio system status and diagnostics- L - LOOK
- I - INVENTORY
- N/S/E/W/U/D - Direction shortcuts
- Created: November 22, 2002
- Language: Java (J2SE 1.4.1 era)
- Platform: Java Applet for web browsers
- Author: Allen Huffman
- Technical Assistance: Vaughn Cato
- Uses CSV data files for easy content modification
- Implements classic text adventure parsing
- Includes multimedia capabilities rare for text adventures of the era
- Designed for cross-platform web deployment
- Java Development Kit (JDK 1.4.1 or later)
- Web browser with Java applet support
- Audio system for
.aufile playback
Adventure.jar - Compiled applet archive
adventure.html - Game launcher page
HauntedMansionMap.png - Visual map reference
*.java - Source code files
*.csv - Game data files
*.au - Audio assets
- Start a local web server in the JavaScript directory:
cd javascript python3 -m http.server 8080 - Open
http://localhost:8080in any modern web browser - Click anywhere to enable atmospheric audio
- Type commands in the text field and explore the mansion!
- Navigate to the Java directory and open
adventure.htmlin a Java-enabled web browser (legacy browsers only)cd java # Open adventure.html in legacy browser
- Wait for the applet to load
- Type commands in the text field
- Explore the mansion!
- ✅ No Java required - Runs in any modern web browser
- ✅ MP3 audio support - Compatible with current audio standards
- ✅ Enhanced error handling - In-game feedback for configuration issues
- ✅ Improved user experience - Better command fallbacks and help system
- ✅ Data-driven design - Easy content modification through JSON files
- ✅ Configurable game system - Reusable engine for different adventure games
The JavaScript engine now supports creating different text adventure games by modifying the configuration file:
{
"title": "Pirate Adventure",
"welcome_message": "Ahoy matey! Welcome to Pirate's Treasure Adventure!",
"quit_message": "Fair winds and following seas!",
"restart_message": "Setting sail on a new voyage...",
"continue_message": "Back to the high seas!",
"version_fallback": "Pirate Adventure - JavaScript Version",
"data_files": {
"map": "data/pirate_map.json",
"items": "data/pirate_items.json",
"audio": "data/pirate_audio.json"
}
}- Modify
hm_config.json- Update title, messages, and file paths - Create custom data files - Design your own map, items, and audio zones
- Add game assets - Include custom audio files and images
- Test and iterate - Use the same engine with your custom content
The engine automatically adapts to different game themes while maintaining all interactive features!
The game now uses a centralized ConfigManager class for robust configuration management:
Key Features:
- Type-Safe Access - Dedicated getter methods with validation and fallbacks
- Schema Validation - Runtime validation of configuration structure and data types
- Centralized Loading - Single point of configuration loading with error handling
- Debug Support - Comprehensive debugging methods for development
- Graceful Degradation - Fallback values ensure game continues even with config errors
Usage in Code:
// Type-safe access with validation
const title = window.configManager.getTitle();
const welcomeMsg = window.configManager.getWelcomeMessage();
const mapFile = window.configManager.getDataFile('map');
// Debug configuration status
window.configManager.debug();Benefits:
- Eliminates scattered
window.gameConfigaccess throughout codebase - Provides consistent error handling and validation
- Enables easy debugging and configuration inspection
- Supports future configuration extensions without code changes
- Reusable Engine - Single codebase supports multiple adventure games through configuration
- Customizable Messages - Welcome, quit, restart, and system messages configurable per game
- Dynamic File Paths - Map, items, and audio file locations configurable for different games
- Theme Adaptation - Easy conversion between game genres (haunted house, pirate adventure, space exploration, etc.)
- Fallback Support - Graceful degradation if configuration files are missing
- Consistent Architecture - Maintains existing code patterns while enabling flexibility
- Multiple Verb Support - Single actions respond to multiple verbs:
"PUSH,PULL,MOVE" - Complex Interactions - Items can respond to multiple verbs (READ, SEARCH, UNLOCK, CLIMB, etc.)
- Room-Specific Actions - Items behave differently in different locations
- Requirement System - Actions can require specific items in inventory
- Once-Only Actions - Prevent repetition with custom messages for already-performed actions
- Dynamic World Changes - Items can unlock doors, reveal hidden items, and modify descriptions
- Room Modification System - Advanced
modifyLocationAPI for complex puzzle mechanics - Ghost Banishment -
hideItemfunctionality for making entities disappear from the world
- Smart Item Matching - Whole-word matching system finds items by any word in their name
- Multi-word Item Support - Commands like "look stone key" and "get blue key" work naturally
- Consistent Handler Behavior - Both ExamineHandler and ItemHandler use same smart matching logic
- Fallback Support - EXAMINE and SEARCH work on any item, even without custom actions
- Grammar Intelligence - Automatic article stripping for better message grammar
- Command Shortcuts - Single-letter shortcuts (N, S, E, W, U, D, I, L)
- Comprehensive Help - Built-in HELP command with complete command reference
- Graceful Quit - QUIT command with confirmation options (YES/NO/RESTART)
Hidden Item System
- Pre-defined Secrets - Items stored in "limbo" (room 0) awaiting discovery
- Search Mechanics - Find hidden bookmarks, keys, and mysterious objects
- Debug Support - Hidden items visible with GOTO 0 command for testing
- Reveal Tracking - Items properly move from hidden state to active locations
- Data-Driven Configuration - JSON-based audio zone assignments
- User Control - SOUND ON/OFF command with immediate feedback
- Silent Rooms - Strategic silence for dramatic atmospheric effect
- Modern Format Support - MP3 audio instead of deprecated .au format
- Smart Stopping - Audio stops in silent rooms, resumes with new zones
- In-Game Error Messages - JSON parsing errors displayed to players
- Graceful Degradation - Game continues even with configuration errors
- Real-Time Validation - Console feedback for debugging and development
- User-Friendly Messages - Clear instructions and helpful feedback
- Unified Command Processing - All handlers (Examine, Item, Action) use consistent multi-word matching
- Secret Items - Hidden objects that advance the story
- Portrait Mystery - Dueling gentlemen paintings
- Seance Circle - Supernatural communication
- Birthday Cake - Dining room mysteries
- Cryptic Scroll - Navigation puzzles with directional clues
- Dynamic Descriptions - Portraits that age and change
- Environmental Storytelling - Each room tells part of the mansion's story
- Interactive Objects - Examine furniture, paintings, and mansion details
- Supernatural Events - Ghostly manifestations and mysterious occurrences
This game faithfully recreates many elements from Disney's Haunted Mansion attraction:
- 999 Happy Haunts theme and atmosphere
- Portrait Gallery stretching room concept
- Ballroom dancing ghosts scene
- Attic mysterious bride storyline
- Graveyard singing busts and ghostly residents
Experience the chills and thrills of Disney's most beloved haunted attraction from the comfort of your computer. Will you uncover all the mansion's mysteries, or will you become its 1000th happy haunt?