Commit d1499c01 by BellCodeEditor

save project

parent 16f0d60e
Showing with 14 additions and 2 deletions
import pygame
from pygame import locals
x,y=240,120
# 初始化pygame,为使用硬件做准备
pygame.init()
......@@ -12,7 +12,11 @@ background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
T=playgame.time
she=[(180,90),(180,120),(210,120),(x,y)]
x+=30
she.append((x,y))
she.pop(0)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -28,5 +32,12 @@ while True:
screen.blit(body, (180, 90))
# 将果实画上去
screen.blit(food, (360, 300))
for i in range(len(she)[-1]):
screen.blit(body,she[i])
# 刷新画面
pygame.display.update()
T.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