Commit 98b0949b by BellCodeEditor

auto save

parent 0816d79e
Showing with 11 additions and 10 deletions
......@@ -7,26 +7,27 @@ pygame.init()
pyame.display.set-mode((800,600))import pygame
from pygame import locals
FPSCLOCK=pygame.time.Clock()
# 初始化pygame,为使用pygame做准备
pygame.init()
bg=pygame.image.load("bg.png")
right=pygame.image.load("right.png")
app=pygame.image.load("apple.png")
bd=pygame.image.load("body.png")
x,y=240,120
position=[(180,90),(180,120),(210,120),(x,y)]
# 创建一个窗口
pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
x+=30
position.append((x,y))
position.pop(0)
screen.blit(bg,(0,0))
screen.blit(right,(240,120))
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(150,120))
screen.blit(food,(360,300))
screen.blit(right,position[-1])
for i in range(len(position)-1):
screen.blit(bd,
screen.blit(app,(360,300))
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