Commit dcbc2b2f by BellCodeEditor

auto save

parent 6459c64f
Showing with 31 additions and 0 deletions
import pygame
from pygame import locals
pygame.init()
screen=pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
print(event)
if event.type==locals.QUIT:
exit()
\ No newline at end of file
class Hero:
def __init__(s,name,hp,attack):
s.level=1
s.name=name
s.hp=hp
s.attack=attack
def up(self):
self.level=self.level+1
self.hp=self.hp*1.1
self.attack=self.attack*1.1
yase=Hero("亚瑟",300,20)
luban=Hero("鲁班七号",200,40)
luban.up()
yase.up()
print(yase.name)
print(yase.hp)
print(yase.attack)
print(luban.name)
print(luban.hp)
print(luban.attack)
\ 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