Commit ca801dc3 by BellCodeEditor

save project

parent 1f26f1cc
Showing with 11 additions and 5 deletions
class Hero:
def __init__(self):
self.level = 1
self.hp= 300
self.attack= 20 # attack:攻击
def __init__(self,name,hp,attack):
self.name=name
self.hp= hp
self.attack= attack # attack:攻击
yase = Hero()
yase=Hero("亚瑟",30000000000,123456712345612345)
hoyi=Hero("后裔",1,1)
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
print("yase的血量值为:",yase.hp)
print("yase的攻击力为:",yase.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