Commit f8a4469f by BellCodeEditor

save project

parent c36adb3f
Showing with 13 additions and 14 deletions
...@@ -3,27 +3,26 @@ from pygame import locals ...@@ -3,27 +3,26 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body1 = pygame.image.load('body.png')
body2 = pygame.image.load('body.png')
body3 = pygame.image.load('body.png')
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((800,600)) screen=pygame.display.set_mode((800,600))
bg=pygame.image.load('bg.png')
rt=pygame.image.load('right.png')
fd=pygame.image.load('apple.png')
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type==locals.QUIT:
exit() exit()
screen.blit(background,(0,0))
screen.blit(right,(240,120)) screen.blit(bg,(0,0))
screen.blit(food,(360,300)) screen.blit(rt,(240,120))
screen.blit(body1,(210,120)) screen.blit(fd,(360,300))
screen.blit(body2,(210,90))
screen.blit(body3,(210,60))
pygame.display.update() 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