Here's a simple interactive text adventure game based in a high fantasy setting:
def display_intro():
print("Welcome to the Kingdom of Eldoria!")
print("You are a young adventurer, ready to embark on a quest to save the kingdom from an ancient evil.")
print("You find yourself at a crossroads.")
def crossroads():
print("\nYou are at a crossroads. To the north lies a dense forest, to the east is a towering mountain range, and to the west is a vast desert.")
choice = input("Which direction do you choose? (north/east/west): ")
if choice == "north":
forest()
elif choice == "east":
mountains()
elif choice == "west":
desert()
else:
print("Invalid choice. Please try again.")
crossroads()
def forest():
print("\nYou enter the dense forest. The trees loom over you, and strange sounds echo in the distance.")
print("As you venture deeper, you come across a hidden cave.")
choice = input("Do you enter the cave? (yes/no): ")
if choice == "yes":
print("\nYou discover an ancient artifact inside the cave. It radiates with magical energy.")
print("Congratulations! You have found the artifact needed to save the kingdom!")
elif choice == "no":
print("\nYou decide to avoid the cave and continue through the forest.")
print("After hours of wandering, you realize you are lost. You must find your way back to the crossroads.")
crossroads()
else:
print("Invalid choice. Please try again.")
forest()
def mountains():
print("\nYou begin your ascent up the mountain range. The path is treacherous, and the air grows thin.")
print("As you reach a high peak, you spot a mysterious temple in the distance.")
choice = input("Do you approach the temple? (yes/no): ")
if choice == "yes":
print("\nYou enter the temple and find a wise sage. They offer you guidance on your quest.")
print("With newfound knowledge, you descend the mountains and return to the crossroads.")
crossroads()
elif choice == "no":
print("\nYou decide to avoid the temple and continue exploring the mountains.")
print("After days of exploration, you find no leads. You must return to the crossroads.")
crossroads()
else:
print("Invalid choice. Please try again.")
mountains()
def desert():
print("\nYou enter the scorching desert. The sun beats down on you, and the sand stretches endlessly.")
print("In the distance, you see a shimmering oasis.")
choice = input("Do you approach the oasis? (yes/no): ")
if choice == "yes":
print("\nAs you reach the oasis, you realize it was just a mirage. Exhausted and lost, you collapse in the sand.")
print("Game over!")
elif choice == "no":
print("\nYou decide to avoid the oasis and press on through the desert.")
print("After days of wandering, you find an ancient map that leads you back to the crossroads.")
crossroads()
else:
print("Invalid choice. Please try again.")
desert()
# Start the game
display_intro()
crossroads()
This game presents the player with a high fantasy setting where they must make choices to progress through the story. The player starts at a crossroads and can choose to explore a forest, mountains, or a desert. Each choice leads to different scenarios and outcomes.
The game uses functions to represent different locations and scenarios, and the player's choices determine which function is called next. The game continues until the player either finds the ancient artifact in the forest, gets lost in the desert, or chooses to quit.
Feel free to expand upon this basic structure and add more choices, locations, and scenarios to create a more immersive and engaging text adventure game!