Commit f98ef8e1 by BellCodeEditor

save project

parent 4c5f74d3
Showing with 11 additions and 8 deletions
...@@ -4,14 +4,17 @@ class Hero: ...@@ -4,14 +4,17 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attact=attact self.attact=attact
yase=Hero('yase',4958,25) def upgrade(self):
def upgrade(): self.level=self.level+1
yase.level=yase.level+1 self.attact=self.attact+20
yase.attact=yase.attact+20 self.hp=self.hp+189
yase.hp=yase.hp+189 yase=Hero('亚瑟',4968,30)
upgrade() yase.upgrade()
print(yase.hp)
print('亚瑟的生命值:'+str(yase.hp)) print(yase.level)
print(yase.attact)
......
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