Commit 9ea247d1 by BellCodeEditor

save project

parent 6b36d060
Showing with 12 additions and 9 deletions
...@@ -4,15 +4,18 @@ class Hero: ...@@ -4,15 +4,18 @@ class Hero:
self.name = name self.name = name
self.hp= hp self.hp= hp
self.attack= attack self.attack= attack
def upgrade(): def unpgrade():
yase.level=yase.level+1 self.level=yase.level+1
yase.hp=yase.hp+50 self.hp=yase.hp+50
yase.attack=yase.attack+4 self.attack=yase.attack+4
yase = Hero("亚瑟",300,20) houyi = Hero("后羿",240,23)
print("亚瑟初始血:",yase.hp) houyi.unpgrade()
upgrade() print("等级:",houyi.)
upgrade() print("血量:",houyi.hp)
print("生级2此后,亚瑟初始血:",300,20) print("攻击力:",houyi.attack)
......
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