Commit 9ef38fae by BellCodeEditor

save project

parent c81d7066
Showing with 16 additions and 8 deletions
...@@ -14,25 +14,34 @@ food = pygame.image.load('apple.png') ...@@ -14,25 +14,34 @@ food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
FPSCLOCK=pygame.time.Clock() FPSCLOCK=pygame.time.Clock()
x,y=240,120 x,y=240,120
postltion=[(180,90),(180,120),(210,120),(x,y)]
while True: while True:
x += 30 x += 30
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
screen.blit(background, (0, 0)) postltion.append((x,y))
postltion.pop(0)
screen.blit(background,(0,0))
screen.blit(food, (360, 300))
screen.blit(right, (x,y))
for i in range(len(postltion)-1):
screen.blit(body,postltion[i])
#postltion.append((x,y))
#postltion=[(180,90),(180,120),(210,120),(x,y)]
#screen.blit(right,postltion[-1])
screen.blit(right, (x,y)) #screen.blit(background, (0, 0))
screen.blit(food, (360, 300)) #screen.blit(right, (x,y))
#screen.blit(body, (210, 120))
#screen.blit(body, (180, 120))
#screen.blit(body, (180, 90))
#
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(4) FPSCLOCK.tick(4)
#postltion=[(180,90),(180,120),(210,120),(x,y)]
\ 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