Commit 5efe2cb0 by BellCodeEditor

auto save

parent f2c5a2f4
Showing with 11 additions and 15 deletions
class Hero: import pygame
def __init__(self,name,level,hp,attack): from pygame.locals import *
self.name=name from sys import exit
self.level=level pygame.init()
self.hp=hp screen = pygame.display.set_mode((400,800))
self.attack=attack while True:
def upgrade(self): screen.fill(0)
self.level=self.level+1 screen.blit(screen,(0,0))
self.hp=self.hp+50 for event in pygame.event:
self.attack=self.attack+4 if
yase=Hero("亚瑟",1,300,20) \ No newline at end of file
yase.upgrade()
print(yase.hp)
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