Commit 00e1b2bf by BellCodeEditor

save project

parent 1a8aff65
Showing with 9 additions and 7 deletions
class Hero:
def_init_(self):
self.level = 1
self.attack = 30
self.hp = 250
houyi = Hero()
print("创建了英雄后羿,等级为:"houyi.level,"功击力为:")
\ No newline at end of file
def_init_(self,name,hp,level,attack):
self.level = level
self.attack = atack
self.hp = hp
self.name = name
houyi = Hero("后羿",200,1,50)
yase = Hero("亚瑟",300,1,25)
print("英雄",houyi.level,"功击力为:")
\ 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