Commit f98ef8e1 by BellCodeEditor

save project

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