from time import * from random import * import os,sys, random def setup (): global name global HP global MP name = input("What is your name warrior? ") HP = randint (5,20) MP = randint(5,20) clear_screen() title() castle() setup() global name global HP global MP global move global EnemyHP print("Welcome to Middle Earth, " + name) sleep(2) print("\nYour health is" + " " + str(HP)) print("Your magic skill is " + " " + str(MP)) print("Would you like to venture out into the land?" "Press y then enter to continue") if input () == "y": print ("You are in your home, with a roaring fireplace in front of you, above the fire you can see your sword and shield") print ("Would you like to take your sword and shield? Press y then enter to continue") if input () == "y": weapons = [] weapons.append("sword") weapons.append("shield") print("You are now carrying your" + " " + weapons[0] + " " + "and your" + weapons[1] + "you swing open the door to your home and see a green valley gleaming in the sunshine.") print ("Armed with your " + weapons[0] + " " + "and " + weapons[1] + "") else: print ("You choose not to take your weapons") print("Armed with your sense of humour, you swing open the door to see a green valley full of opportunity awaiting you.") else : print("You stay at home, sat in your favourite chair watching the fire grow colder. Middle Earth no longer has a hero.") print("Game Over") sys.exit(0) def clear_screen(): os.system('cls' if os.name=='nt' else 'clear') def title(): print (" __ _ __ ") print (" / / ___ __ _ ___ _ __ __| | ___ / _| /\ /\___ _ __ ___ ___ ___ ") print (" / / / _ \/ _` |/ _ \ '_ \ / _` | / _ \| |_ / /_/ / _ \ '__/ _ \ / _ \/ __|") print ("/ /__| __/ (_| | __/ | | | (_| | | (_) | _| / __ / __/ | | (_) | __/\__ \ ") print ("\____/\___|\__, |\___|_| |_|\__,_| \___/|_| \/ /_/ \___|_| \___/ \___||___/") def castle(): print ("* |>>> + ") print ("+ * | * +") print (" |>>> _ _|_ _ * |>>> ") print (" * | |;| |;| |;| | *") print (" + _ _|_ _ \\. . / _ _|_ _ +") print (" * |;|_|;|_|;| \\: + / |;|_|;|_|;|") print (" \\.. / ||:+++. | \\. . / *") print (" + \\. , / ||:+++ | \\: . /") print (" ||:+ |_ _ ||_ . _ | _ _||:+ | *") print (" * ||+++.|||_|;|_|;|_|;|_|;|_|;||+++ | +") print (" ||+++ ||. . . . ||+++.| *") print ("+ * ||: . ||:. . . . , ||: | *") print (" * ||: ||: , + . ||: , | +") print (" * ||: ||:. +++++ . ||: | *") print (" + ||: ||. +++++++ . ||: . | +") print (" + ||: . ||: , +++++++ . . ||: | +") print (" ||: . ||: , +++++++ . . ||: | *") print (" ||: . ||: , +++++++ . . ||: |")