Commit 2f50dcce by BellCodeEditor

auto save

parent 16f0d60e
Showing with 5 additions and 0 deletions
......@@ -6,6 +6,7 @@ pygame.init()
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
FPSCLOCK=pygame.time.Clock()
# 背景
background = pygame.image.load('bg.png')
......@@ -18,6 +19,10 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if setheading()==right:
x=x+30
if setheading()==left:
x=x-30
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
......
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