Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions TextBasedGame/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
spell=magic+" Bullet"



def intro():
print("Hello there!!!")
t.sleep(0.5)
Expand Down Expand Up @@ -41,7 +40,7 @@ def displayQuest(name):

def playQuest():
global health,reward
health=int(100)
health = 100
print("Your Primary Weapon is : ",weapon)
print("Magic Spell is : ",spell)
print("To use Any Attack name the attack ")
Expand All @@ -57,8 +56,8 @@ def playQuest():
exit()

t.sleep(0.5)
if health<0:
health=int(0)
if health < 0:
health = 0
print("Enemy health is now ",health)

else:
Expand All @@ -68,18 +67,18 @@ def playQuest():
print("Job Completed")
t.sleep(0.5)
print("You Earned a reward")
reward=int(50)
reward = 50
t.sleep(0.5)
print("Your Reward is ",reward)

print("_____________________________________________________________")

ch="Yes"
while ch=="yes" or ch=="y" or ch=="Y" or ch=="Yes":
ch = "yes"
while ch == "yes" or ch == "y":
choice=intro()
name=play(choice)
displayQuest(name)
playQuest()
ch=input("Do you want to play again??(Yes/Y) : ")
ch=input("Do you want to play again??(Yes/Y) : ").lower()