Commit 0e73d311 by BellCodeEditor

save project

parent ea1dbe45
Showing with 8 additions and 6 deletions
......@@ -13,26 +13,27 @@ screen = pygame.display.set_mode((660,480))
FPSCLOCK=pygame.time.Clock()
stwzx=240
stwzy=120
sdwz=[(180,90),(180,120),(210,120),(stwzx,stwzy)]
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到推出时间后退出
exit()
stwzx += 30
sdwz.append((stwzx,stwzy))
sdwz.pop(0)
# 将背景画上去
screen.blit(background,(0,0))
# 将蛇头画上去
screen.blit(right,(stwzx,stwzy))
screen.blit(right,sdwz[-1])
# 将身体画上去
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(180,90))
for i in range(len(sdwz)-1):
screen.blit(body,sdwz[i])
# 将果实画上去
screen.blit(food,(360,300))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
FPSCLOCK.tick(2)
\ 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