Commit 8d02bf03 by BellCodeEditor

auto save

parent c6188a1e
Showing with 23 additions and 2 deletions
......@@ -4,4 +4,25 @@ import pygame
pygame.init()
# 创建一个窗口
??
\ No newline at end of file
screen= pygame.display.set_mode((660,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')
left=pygame.image.load('left.png')
up=pygame.image.load('up.png')
down=pygame.image.load('down.png')
x,y = 60,60
position=[(30,60),(30,90),(60,90),(x,y)]
screen= pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
screen.blit(background,(0,0))
screen.blit(food,(120,240))
#screen.blit(snake_head,position[-1])
for i in range(len(position)-1):
screen.blit(body,position[i])
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