https://github.com/b3ta-blocker/treasure-island
Players make decisions at each stage, leading to different outcomes. The game includes ASCII art for visual appeal, and the player's choices determine whether they find the treasure (win) or encounter obstacles leading to a game over.
https://github.com/b3ta-blocker/treasure-island
ascii-art conditional-statements functions looping string-manipulation
Last synced: 4 months ago
JSON representation
Players make decisions at each stage, leading to different outcomes. The game includes ASCII art for visual appeal, and the player's choices determine whether they find the treasure (win) or encounter obstacles leading to a game over.
- Host: GitHub
- URL: https://github.com/b3ta-blocker/treasure-island
- Owner: B3TA-BLOCKER
- Created: 2023-08-28T08:57:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T18:43:11.000Z (about 1 year ago)
- Last Synced: 2024-12-29T06:16:12.053Z (6 months ago)
- Topics: ascii-art, conditional-statements, functions, looping, string-manipulation
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Treasure Island 🏴☠️💎
Welcome to the interactive text-based game, "Treasure Island"! Embark on a thrilling adventure, making choices that lead to different scenarios and outcomes in your quest to find the hidden treasure.
## Code Overview 🚀💻
- **Console Clearing:**
- The `system('cls')` command clears the console, providing a polished introduction to the game.- **ASCII Art:**
- ASCII art at the beginning adds a decorative touch to the game's introduction.- **Game Introduction:**
- The game begins with a warm welcome to Treasure Island, outlining your mission: discovering the treasure.- **First Choice:**
- The first choice prompts you to decide between going 'left' or 'right,' with the input stored in `choice_1`.
- `choice_1` is converted to lowercase using the `lower()` method and stored in `choice_1_lower`.
- Conditional statements based on `choice_1` dictate the next steps:
- Choosing 'left' leads to a decision at a serene lake.
- Choosing 'right' results in an immediate "Game Over" message as you fall into a hole.- **Second Choice:**
- If you chose 'left,' brace yourself for the second choice involving the lake, with a prompt like "You've come to a lake...". The input is stored in `choice_2`.
- `choice_2` is converted to lowercase and stored in `choice_2_lower`.
- Opting to 'wait' progresses you to the third choice involving vibrant colored doors on an island.- **Third Choice:**
- In the third choice, select a door color ('red,' 'yellow,' or 'blue'), with the input stored in `choice_3`.
- `choice_3` is converted to lowercase and stored in `choice_3_lower`.
- Based on `choice_3`, conditional statements unveil different outcomes:
- Choosing 'red' leads to a fiery room, resulting in a "Game Over" message.
- Opting for 'blue' takes you to a room of intimidating beasts, triggering a "Game Over" message.
- Choosing 'yellow' rewards you with discovering the treasure and winning the game.
- Any other door choice leads to a "Game Over" message.- **Unexpected Encounters:**
- Opting to 'swim' at any point brings an unexpected encounter with an angry trout and a "Game Over" message.- **Right Choice at the Beginning:**
- Choosing 'right' at the beginning results in a perilous fall into a hole and another "Game Over" message.## Conclusion 🏆
This code demonstrates the use of nested conditional statements to create a captivating, tech-savvy story-based game where your choices influence the ultimate outcome.