Commit 03fbea74 by BellCodeEditor

auto save

parent 333a95af
Showing with 30 additions and 2 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name=name
self.hp = hp
self.attack = attack
yase = Hero("亚瑟",300,20)
libai = Hero("李白",400,35)
print("亚瑟的血量为:",yase.hp)
print("李白的血量为:",libai.hp)
\ No newline at end of file
...@@ -2,6 +2,24 @@ import pygame ...@@ -2,6 +2,24 @@ import pygame
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
background = pygame.image.load('bg.png')
background1 = pygame.image.load('right.png')
background2 = pygame.image.load('body.png')
background4 = pygame.image.load('body.png')
background3 = pygame.image.load('apple.png')
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660,480)) screen = pygame.display.set_mode((660,480))
\ No newline at end of file
while True:
for event in pygame.event.get():
if event.type == 12:
exit()
screen.blit(background,(0,0))
screen.blit(background1,(90,120))
screen.blit(background2,(90,150))
screen.blit(background4,(90,180))
screen.blit(background3,(220,250))
pygame.display.update()
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