Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys import exit
- def startPlay(): #Code for asking to play the game
- play=""
- playCheck=""
- while play not in ["Y", "N"]: #Y represents Yes and N represents No
- play = input ("Do you want to play (Y or N)? ").upper()
- while playCheck not in ["Y","N"]: #Giving an option of Yes or No
- playCheck = input("Do you want to play (Y or N)? ").upper()
- if playCheck != play:
- print("Your answers do not match, re-enter") #Code for asking for re-entering the answer as the answer submitted is not an option
- playCheck()
- if play=="Y":
- print("A strange tingle trickles across your skin. You feel lightheaded and sit down. Feeling better you stand up again and notice your reflection in a window.")
- print("\033[0;37;46mYou notice that your Game Changer (Jewel) is missing\033[0m")
- nameInput()
- else:
- print ("The only way to win the game is to not play it")
- quit() #This quits the code
- def nameInput (): #This makes a function called “nameInput” which asks for proper name and verification
- global name
- name = "" #sets name as none
- nameCheck = "" #This sets the variable “nameCheck” as none.
- while name == "" or len(name) > 25 or not name.isalpha(): #This code sets username character limit to 25
- name = input("Enter your name: ").capitalize() #Setting the variable 'name'a value.
- while nameCheck == "" or len(nameCheck) > 25 or not nameCheck.isalpha(): # This checks for username to be less than 25
- nameCheck = input("Enter name again to verify: ").capitalize() #Giving a value in nameCheck. Actually used for doublechecking the 'name' value
- if nameCheck != name:
- nameInput ()
- else:
- roadChoice()
- life = 1
- def grab ():
- if inventory == "" and invenObject == "" :
- print ("You can't grab that!")
- elif inventory == "" and invenObject == "sword" or "map" or "costume" or "pots of healing" or "hello shield" or "game changer":
- inventory = inventory + invenObject
- elif inventory != "":
- inventory = inventory + " and " + invenObject
- else:
- print ""
- def room1 ():
- map
- startPlay()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement