Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- # This function adds two numbers
- def add(x, y):
- return x + y
- # This function subtracts two numbers
- def subtract(x, y):
- return x - y
- player_health = 60
- enemy_health = 50
- print("Current Player Health:",player_health)
- print("Current Enemy Health:",enemy_health)
- #set of abilities that a player could user:
- punch = random.randint(10,20)
- kick = random.randint(5,10)
- slap = random.randint(15,25)
- print("\n1. Punch")
- print("2. Kick")
- print("3. Slap")
- decision = input("\nWhat ability would you like to use?")
- if decision == "1":
- print("You hit the enemy for:" ,punch)
- print("The current health of the enemy is: " ,subtract(enemy_health,punch))
- elif decision == "2":
- print("You hit the enemy for:" ,kick)
- print("The current health of the enemy is: " ,subtract(enemy_health,kick))
- elif decision == "3":
- print("You hit the enemy for:" ,slap)
- print("The current health of the enemy is: " ,subtract(enemy_health,slap))
- else:
- print("\nThat is not a valid move. Please try again.")
- #how do I go about automating the enemy to attack the player?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement