Commit 63738697 by BellCodeEditor

save project

parent 95c5e914
Showing with 15 additions and 0 deletions
...@@ -5,6 +5,9 @@ from pygame import locals ...@@ -5,6 +5,9 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
background=pygame.image.load('bg.png') background=pygame.image.load('bg.png')
food=pygame.image.load('apple.png')
zhut=pygame.image.load('right.png')
fg = pygame.image.load('body.png')
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660,480)) screen = pygame.display.set_mode((660,480))
while True: while True:
...@@ -13,4 +16,15 @@ while True: ...@@ -13,4 +16,15 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(food,(30,90))
screen.blit(zhut,(270,60))
screen.blit(fg,(240,60))
screen.blit(fg,(240,30))
screen.blit(fg,(240,0))
screen.blit(fg,(210,0))
screen.blit(fg,(210,30))
screen.blit(fg,(210,60))
screen.blit(fg,(180,60))
screen.blit(fg,(180,30))
screen.blit(fg,(180,60))
pygame.display.update() pygame.display.update()
\ 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