Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson3_diy1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • pygame_lesson3_diy1
  • 3e3e4.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · d71aeeb7
    BellCodeEditor committed 2 years ago
    d71aeeb7
3e3e4.py 552 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class hero:
    def __init__(self,name):
        self.a = 1
        self.name = name
        self.c = 200
        self.d = 50

class player(hero):
    def __init__(self,name,hero_type):
        super().__init__(name)
        self.a = 200
        self.b = 50
        self.hero_type = hero_type
        print('角色'+self.name+'创建成功,英雄类为:',self.hero_type)
        print('当前,血量,攻击力分别为:',self.a,self.b)
y= player('yang','刺客')
print(y.d)
houyi= player('后裔','射手')
yase = hero('jing')