Commit 8710d1c0 by BellCodeEditor

save project

parent b3042f5b
Showing with 453 additions and 4 deletions
...@@ -5,10 +5,459 @@ class hero: ...@@ -5,10 +5,459 @@ class hero:
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
ys=hero("垭瑟",30,1000,60) def upgrade(self):
he=hero("后羿",40,999,149) self.hp=self.hp+50
print(ys.name,ys.age,ys.level,ys.hp,ys.attack) self.level=self.level+1
print(he.name,he.age,he.level,he.hp,he.attack) self.attack=self.attack+20
hy=hero("后羿",12,1,100,40)
hy.upgrade()
hy.upgrade()
print(hy.hp)
#he=hero("后羿",40,999,149)
#print(ys.name,ys.age,ys.level,ys.hp,ys.attack)
#print(he.name,he.age,he.level,he.hp,he.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