Commit d926af67 by BellCodeEditor

save project

parent 82d836af
Showing with 14 additions and 5 deletions
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
import pygame import pygame
from pygame import locals from pygame import locals
x,y=150,180 x,y=150,180
position=[(90,150),(90,180),(120,180),(x,y)]
# 载入图片 # 载入图片
bg = pygame.image.load('bg.png') bg = pygame.image.load('bg.png')
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
...@@ -17,14 +20,19 @@ while True: ...@@ -17,14 +20,19 @@ while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
x+=30 x+=30
position.append((x,y))
position.pop(0)
# 渲染图片 # 渲染图片
srceen.blit(bg,(0,0)) srceen.blit(bg,(0,0))
srceen.blit(right,(x,y))
srceen.blit(apple,(540,420)) srceen.blit(apple,(540,420))
srceen.blit(body,(120,180))
srceen.blit(body,(90,180)) srceen.blit(right,position[-1])
srceen.blit(body,(90,150)) for i in range(len(position)-1):
srceen.blit(body,position[i])
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) 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