Adventure book of your choice - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: General (https://python-forum.io/forum-1.html) +--- Forum: Code Review (https://python-forum.io/forum-46.html) +--- Thread: Adventure book of your choice (/thread-27166.html) |
Adventure book of your choice - foksikrasa - May-28-2020 This has been my latest activity in a python learning course and it turned out sooooooooooooo well that I decided to share it with the community I really appreciate your attention. Thanks, foksikrasa. import time delay = int(input("How many seconds would you like to wait between each quote?")) def print_with_delay(text): print(text) time.sleep(delay) def choose(option1, option2): choice = input(option1 + " or " + option2 + "?").lower() if choice == option1: return option1 elif choice == option2: return option2 else: return None print_with_delay("Chapter one, the way to The Country Of Talking Animals\n------------------------------------------------------") name = input("\nEnter your name, traveler:") print_with_delay(str(name) + " I've been looking all over for you!") print_with_delay("Today I've bought this nekclace but it is special...") print_with_delay("It is a nekclace that will let you transform.") print_with_delay("I've bought it for you, " + str(name)) print_with_delay("It will help you on your adventure now choose. There are two paths.") direction = choose("left", "right") print("Bye traveler!") if direction == "left": print_with_delay("You have decided to save a magic country from the evil wich!") print_with_delay("You travel long and far to come to the magic land surrounded by vast deserts and cold oceans.") print_with_delay("But which way? there are two paths, both are dangerous to choose:") direction = choose("left", "right") if direction == "right": print("You shall set sail in the morning.") elif direction == "left": print("Get ready, for tomorrow might be your last day to live.") else: print("That is not a direction.") elif direction == "right": print("You walk into thick woods but oh no! You find a Goblin, he notices you, and begins to chase you.\n You try to run away but he is too fast for you.") print("GAME OVER the Goblin ate you :(") else: print("That is not a direction.") RE: Adventure book of your choice - pyzyx3qwerty - May-31-2020 I really like this game - it is like I'm in an adventure book or movie in real life RE: Adventure book of your choice - Knight18 - May-31-2020 Not bad for a start. Maybe one day you can improve on this with a GUI or other features. RE: Adventure book of your choice - Calli - May-31-2020 I liked it a lot too oh gosh i decided left, right ;) RE: Adventure book of your choice - foksikrasa - Jun-17-2020 Thank you everyone! RE: Adventure book of your choice - BitPythoner - Jul-16-2020 Where the goblin tries to eat me, can you at least make a choice of trying to use the necklace to kill the goblin or something of that sort? Overall, great game. You should turn it into GUI with some pictures and music. |