Commit b5fe40ab by BellCodeEditor

save project

parent 9a581ef4
Showing with 11 additions and 10 deletions
# 英雄角色类 # 英雄角色类
class Hero(object): class Hero:
def __init__(self, name): def __init__(self, name,hp,attack):
self.level = 1 self.level = 1
self.hp = 250 self.hp = hp
self.attack = 40 self.attack = attack
self.name = name self.name = name
def combat(): # 攻击 def upgrade(): # 攻击
??? qqq.level=qqq.level
yase = Hero("垭瑟") qqq = Hero("垭瑟")
houyi= Hero("后羿") sb= Hero("后羿")
yase.combat(houyi) qqq.combat(houyi)
\ 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