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

Administrator / pygame_lesson5_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_lesson5_diy1
  • 1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 4cf7e9c7
    BellCodeEditor committed 2 years ago
    4cf7e9c7
1.py 736 Bytes
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
class wgzl:
    def __init__(self,name,Hp,Gj):
        self.name=name
        self.Hp=Hp
        self.Gj=Gj
    def Sj(self):
        self.Hp=self.Hp+50
        self.Gj=self.Gj+10
Lk=wgzl("林克",1500,180)
Serd=wgzl("塞尔达",1100,80)
Gn=wgzl("加侬多夫",8000,900)
bkbl=wgzl("波克布林",100,50)
a=input("请输入想查询英雄名字")
if a =='Lk':
    print(Lk.name,"血量",Lk.Hp,"攻击",Lk.Gj)
if a =='Serd':
    print(Serd.name,"血量",Serd.Hp,"攻击",Serd.Gj)
if a =='Gn':
    print(Gn.name,"血量",Gn.Hp,"攻击",Gn.Gj)
if a =='bkbl':
    print(bkbl.name,"血量",bkbl.Hp,"攻击",bkbl.Gj)
Serd.Sj()
print("血月升起,已升级该英雄")
print(Serd.name,"血量",Serd.Hp,"攻击",Serd.Gj)