Untitled
unknown
plain_text
a year ago
1.4 kB
8
Indexable
def main():
print("Welcome to The Lost Temple!")
# Character creation
player_name = input("What is your name? ")
print(f"Hello, {player_name}!")
# Game loop
current_location = "entrance"
while True:
print(f"You are in the {current_location}.")
# Display available actions
print("What do you want to do?")
print("1. Look around")
print("2. Go north")
print("3. Go south")
print("4. Inventory")
# Get player input
choice = input("Enter your choice: ")
# Process input
if choice == "1":
print("You look around and see a narrow passage leading north.")
elif choice == "2":
if current_location == "entrance":
current_location = "corridor"
print("You enter the corridor.")
else:
print("There's no way to go north from here.")
elif choice == "3":
if current_location == "corridor":
current_location = "entrance"
print("You return to the entrance.")
else:
print("There's no way to go south from here.")
elif choice == "4":
print("Your inventory is empty.")
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
Editor is loading...
Leave a Comment