Commit ba7deddb by BellCodeEditor

save project

parent 3411f53d
Showing with 20 additions and 2 deletions
...@@ -4,9 +4,26 @@ from pygame import locals ...@@ -4,9 +4,26 @@ from pygame import locals
pygame.init() pygame.init()
sgreen=pygame.display.set_mode((600,480)) sgreen=pygame.display.set_mode((600,480))
background=pygame.image.load('bg.png')
right=pygame.image.load('right.png')
food=pygame.image.load('apple.png')
body=pygame.image.load('body.png')
FPSCLOCK=pygame.time.Clock()
x,y=240,120
while True: while True:
for e in locals.e: for event in pygame.event.get():
if e.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
# 创建一个窗口 # 创建一个窗口
x+=30
sgreen.blit(background,(0,0))
sgreen.blit(right,(x,y))
sgreen.blit(body,(210,120))
sgreen.blit(body,(180,120))
sgreen.blit(body,(180,90))
sgreen.blit(food,(360,300))
pygame.display.update()
FPSCLOCK.tick(3)
\ 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