Commit 1dd98da4 by BellCodeEditor

save project

parent 938d72b4
Showing with 6 additions and 1 deletions
# 英雄角色类 import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.level = 1 self.level = 1
...@@ -20,6 +20,10 @@ class Hero(object): ...@@ -20,6 +20,10 @@ class Hero(object):
class player(): class player():
def__init__(self,name): def__init__(self,name):
super().__init__(name) super().__init__(name)
self.hp=250
self.attack=50
print("角色"+self.name+" ")
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) yase.combat(houyi)
print("當片等級,血量,攻擊力分別為:",houyi,)
\ 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