Commit 052e7bce by BellCodeEditor

save project

parent 417f60d7
Showing with 75 additions and 0 deletions
...@@ -9,4 +9,15 @@ yuyi = Hero("雨衣",10000,10000) ...@@ -9,4 +9,15 @@ yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000) chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack)) print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack))
yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack))
yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack)) print(yuyi.name+"攻击力:"+str(yuyi.attack))
\ No newline at end of file
class Hero:
def __init__(self):
self.level = 1
self.name = name
self.hp = hp
self.attack = a
class Hero:
def __init__(self):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack))
class Hero:
def __init__(self):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
def upgrade():
chenshi.level = chenshi.level + 1
chenshi.hp = chenshi.hp + 50
chenshi.attack = chenshi.attack +4
chenshi = Hero("chenshi",300,20)
print(chenshi.name+"一级攻击力是:"+str(chenshi.attack))
upgarde()
upgarde()
upgarde()
print(chenshi.name+"一级攻击力是:"+str(chenshi.attack))
\ No newline at end of file
class Hero:
def __init__(self):
self.level = 1
self.name = name
self.hp = hp
self.a
chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment