This game immerses you in a whimsical text-based adventure inspired by American McGee's Alice Madness Returns, and, more generally, Lewis Carroll's Alice in Wonderland.
- Dynamic Navigation: Moves Alice through rooms using directional commands (North, East, South, West)
- Room Visitation Tracking: Keeps track of whether a room has been visited
- Error Handling: Prevents invalid moves with feedback
- Puzzle Solving: Engage with puzzles in specific rooms
- Item Collection: Collect and manage items found in various rooms
- Launch the program.
- Enter a direction (North, East, South, West) or use abbreviations (N, E, S, W) to navigate.
- Things will look "awfully familiar" if a room is entered 2+ more times.
- Read & follow the error messages if Alice wanders to the end of the map (wrong direction).
- Solve puzzles when prompted.
- Collect items as you explore.
- Type
exitto end the game at any time. - Available Commands:
northorn: Move northeastore: Move eastsouthors: Move southwestorw: Move westpickup <item>: Pick up an itemdrop <item>: Drop an iteminspect <item>: Inspect an item in your inventoryexplore: Explore the current roominventory: View your inventoryhelp: Display available commandsexit: Exit the game
The program reads in text files "map.txt", "item.txt", and "puzzle.txt" and constructs the game world based on the input.
The map file defines the rooms and their connections.
1~false~Houndsditch Home for Wayward Youth~In the cold, gloomy halls thick with dust, she serves as a maid for orphans under Dr. Bumby's watch.~Vorpal Blade~0~0,2,3,0
2~false~Hatter's Domain~A fiery factory churning its gears with molten lava, she moves through the searing heat.~Teapot Cannon~0~0,0,4,1
3~false~Deluded Depths~Abandoned ships haunt murky waters, their decaying frames sinking as she navigates the eerie depths.~0~1~1,4,5,0
4~false~Queensland~Card towers rise against the horizon, their fragile walls teetering as she treads carefully through the towering spires.~Roses~0~2,0,6,3
5~false~Dollhouse~She dances carefully through broken dolls and crumbling dollhouses, their twisted remains haunting the forgotten space.~Misstitched Dress~0~3,6,7,0
6~false~Infernal Train~The twisted, fiery train barrels through the wreckage, its wheels screeching as she races to escape its burning grasp.~0~2~4,0,0,5
7~false~Asylum~A dark, oppressive asylum with rusted bars and flickering lights, where echoes of madness haunt every corner.~0~3~5,0,0,0```
### Item File (item.txt)
The item file lists the items that can be found in specific rooms.
#### Example:
Vorpal BladeThe Vorpal Blade is similar in appearance to a common household kitchen knife and nothing like a sword as it is called in "Jabberwocky". It has a long silver blade and a short brown wooden handle.
Teapot CannonThe Teapot Cannon looks like a teapot, or an old metal kettle. A clock face in inserted into the side of the belly of the pot, releases steam, and it shoots pocket watch-like projectiles from its large spout.
RosesRoses are the representation of Alice Liddell's health. The number of the Roses corresponds to how much health she currently has, and if her health drops to one Rose left, Hysteria becomes available and she is rendered invincible for a short amount of time.
Misstitched DressThe Misstitched Dress is based on the appearance of the Dollhouse domain, and is one of Alice's most colorful and vibrant dresses. However, it is also the most worn and torn, in accordance with the domain's ragged appearance.
### Puzzle File (puzzle.txt)
The puzzle file defines the puzzles in specific rooms.
#### Example:
1~Who has a hat and loves to chat?mad hatter
2He’s always late, with no time to wait?white rabbit
3She yells 'Off with their head!' and paints the roses red?~red queen
## Classes & Logic
### MVC Structure
The game is designed following the Model-View-Controller (MVC) pattern:
1. **Model**: Represents the data and the business logic of the application.
2. **View**: Represents the presentation layer and displays the data to the user.
3. **Controller**: Manages the communication between the Model and the View.
### Classes
#### 1. Main
- Entry Point
- Initializes the game and starts the game loop
#### 2. Player (Model)
- Alice's Current Location, Movement, and Rooms Visited
- Methods:
- `move(String direction)`: Alice's Movement Logic
- `getCurrentRoomName()` and `getCurrentRoomDescription()`: Get Room Details for Display
#### 3. GameMap (Model)
- Map Structure and All Rooms + Relationships
- Methods:
- `readRooms(String fileName)`: Loads and parses room data from a text file
- `getRoom(String roomID)`: Retrieves room by ID and throws an exception if needed
#### 4. Room (Model)
- Individual Rooms + Attributes and Room Connections
- Attributes:
- `roomID`: Unique identifier for each room
- `description`: Descriptive context for the room
- `northRoomID`, `eastRoomID`, `southRoomID`, `westRoomID`: Connections to adjacent rooms
- `isVisited`: Tracks room visitation history
- Methods:
- `getRoomID()`, `getDescription()`, `isVisited()`: Retrieve room details
- `setVisited(boolean isVisited)`: Updates the visited status
#### 5. Item (Model)
- Represents items that can be found and collected in rooms
- Attributes:
- `itemID`: Unique identifier for each item
- `name`: Name of the item
- `description`: Description of the item
- Methods:
- `getItemID()`, `getName()`, `getDescription()`: Retrieve item details
#### 6. Puzzle (Model)
- Represents puzzles that can be found in rooms
- Attributes:
- `puzzleID`: Unique identifier for each puzzle
- `description`: Description of the puzzle
- `answer`: Correct answer for the puzzle
- Methods:
- `getPuzzleID()`, `getDescription()`, `getAnswer()`: Retrieve puzzle details
- `solve(String attempt)`: Check if the provided attempt is correct
#### 7. InvalidRoomException
- Custom exception thrown with error message when attempting to access an invalid room.
#### 8. GameView (View)
- Handles the display of messages and information to the player
- Methods:
- `displayMessage(String message)`: Displays a message to the player
- `displayInventory(Player player)`: Displays the player's inventory
- `getUserInput()`: Gets input from the player
- `displayHelp()`: Displays help information
#### 9. GameController (Controller)
- Manages the game logic and flow
- Methods:
- `startGame()`: Starts the game loop and handles player commands
## Wonderland Default Map
### Version 1 (roomID) for map.txt
| | | |1|2| | | | |3|4| | | | |5|6| | | |7|
### Version 2 (name) for map.txt
| | | |Houndsditch_Home_for_Wayward_Youth|Hatter's_Domain| | | | |_ _ _ _ _ Deluded_Depths _ _ _ _ | Queensland _ | | | | |_ _ _ _ _ _ Dollhouse _ _ _ _ _ _ | Infernal_Train| | | |_ _ _ _ _ _ _ Asylum _ _ _ _ _ _ _|
## Items Map
| | |VB _TC| | | |0 _R| | | |MD 0| | | |0|
### Legend:
- VB: Vorpal Blade (Houndsditch Home for Wayward Youth)
- TC: Teapot Cannon (Hatter's Domain)
- 0: No item (Deluded Depths, Infernal Train, Asylum)
- R: Roses (Queensland)
- MD: Misstitched Dress (Dollhouse)
## Puzzles Map
| | |0 0| | | |P1 0_| | | |0 P2_| | | |P3|
### Legend:
- P1: Who has a hat and loves to chat? (Deluded Depths)
- P2: He’s always late, with no time to wait? (Infernal Train)
- P3: She yells 'Off with their head!' and paints the roses red? (Asylum)
- 0: No puzzle (Houndsditch Home for Wayward Youth, Hatter's Domain, Queensland, Dollhouse)
## Thank You & Enjoy Playing Alice's Adventures!
Emree Jensen