Python Forum
Adventure book of your choice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adventure book of your choice
#1
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.")
Reply
#2
I really like this game - it is like I'm in an adventure book or movie in real life
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply
#3
Not bad for a start. Maybe one day you can improve on this with a GUI or other features.
Reply
#4
I liked it a lot too oh gosh i decided left, right ;)
Reply
#5
Thank you everyone!
Reply
#6
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020