I wrote this little RPG in Python. It still needs a good battle system and real enemies, but since it's my first attempt to create a rather "big" project, I'm happy with the result. Everything is under 1 single file since I dunno how to split it into multiple ones.

# By Luca Savoini

from random import randint
import time

# Player variables
playername = input("What's your name? ")
playerlevel = 1
hp = 50 + playerlevel
strenght = 10 + playerlevel + randint(1, playerlevel)
money = 100

# Enemy variables
dummyhealth = 100
playerdamage = dummyhealth - strenght

# Intro
print(playername + ', Welcome to Lootia! Here you will fight for glory,'
               '\ncreate powerful weapons and discover ancient secrets!')
print("You will fight many evil creatures, so kill this dummy to prove me you are worth giving a weapon")

# Player input
print("\nEnemy health=" + str(dummyhealth))
print("1=Sword attack\n2=Run")
playerinput = input("What do you want to do? ")

# Fight!
if hp < 0:
    if playerinput == 1:
        print("You did " + playerdamage + "damage. That's a lotta damage!")
        dummyhealth - playerdamage
    elif playerinput == 2:
        moneyonrun = money - (money / 100)
        print("You are dead!")
  • \$\begingroup\$ Are you sure it works? \$\endgroup\$ – hjpotter92 Jun 18 '18 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.