Commit a0ccb805 by BellCodeEditor

save project

parent 40ea9dd6
Showing with 5 additions and 4 deletions
...@@ -6,13 +6,14 @@ class Hero: ...@@ -6,13 +6,14 @@ class Hero:
self.attack = attack self.attack = attack
def upgrade(): def upgrade():
ganjing.level = ganjing.level + 1 ganjing.level = ganjing.level + 1
ganjing.hp = ganjing.hp + 10
ganjing.attack = ganjing.attack + 10
ganjing = Hero('赶紧',20,1000) ganjing = Hero('赶紧',20,1000)
shandiao = Hero('删掉',2000,1) shandiao = Hero('删掉',2000,1)
#print('ganjing Hp:',ganjing.hp) #print('ganjing Hp:',ganjing.hp)
#print('ganjing attack:',ganjing.attack) #print('ganjing attack:',ganjing.attack)
#print('shandiao Hp:',shandiao.hp) #print('shandiao Hp:',shandiao.hp)
#print('shandiao attack:',shandiao.attack) #print('shandiao attack:',shandiao.attack)
print('赶紧的初始血量为:',ganjing.level) print('赶紧的初始血量为:',ganjing.hp)
upgrade() upgrade()
print('升级一次后的血量为:',ganjing.level) print('升级一次后的血量为:',ganjing.hp)
\ No newline at end of file \ 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