Commit 43a375b4 by BellCodeEditor

save project

parent 3416cc36
Showing with 2 additions and 7 deletions
...@@ -5,7 +5,7 @@ class Hero: # 英雄类 ...@@ -5,7 +5,7 @@ class Hero: # 英雄类
self.hp = 250 self.hp = 250
self.attack = 40 self.attack = 40
self.max_hp = self.hp self.max_hp = self.hp
print("英雄"+self.name+"\nself.attack=49,+""") print("英雄"+"英雄类型"+self.name+"\n"+str(self.attack)+str(self.hp))
def combat(self, enemy): # 攻击功能 def combat(self, enemy): # 攻击功能
...@@ -23,11 +23,6 @@ class Hero: # 英雄类 ...@@ -23,11 +23,6 @@ class Hero: # 英雄类
exit() exit()
class Player(): # 玩家英雄
def __init__(self,name):
player = Hero("后羿")
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.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