Commit 8524ca7a by BellCodeEditor

save project

parent 45ae3bab
Showing with 6 additions and 3 deletions
...@@ -2,7 +2,7 @@ import pygame ...@@ -2,7 +2,7 @@ import pygame
from pygame import locals from pygame import locals
pygame.init() pygame.init()
screen = pygame.display.set_mode((660, 480)) screen = pygame.display.set_mode((660, 480))
FPSCLOCK=pygame.time.clock() FPSCLOCK=pygame.time.Clock()
background = pygame.image.load('bg.png') background = pygame.image.load('bg.png')
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
...@@ -11,7 +11,7 @@ down = pygame.image.load('down.png') ...@@ -11,7 +11,7 @@ down = pygame.image.load('down.png')
left = pygame.image.load('left.png') left = pygame.image.load('left.png')
up = pygame.image.load('up.png') up = pygame.image.load('up.png')
x,y=240,120 x,y=240,120
positipon= positipon=[(90,120),(180,120),(210,120),(x,y)]
setheading='rignt' setheading='rignt'
snake_head = right snake_head = right
while True: while True:
...@@ -39,8 +39,11 @@ while True: ...@@ -39,8 +39,11 @@ while True:
y+=30 y+=30
else: else:
y-=30 y-=30
positipon.append((x,y))
positipon.pop(0)
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(right, (240, 120)) screen.blit(snake_head,positipon[-1])
#screen.blit(right, (240, 120))
screen.blit(body, (210, 120)) screen.blit(body, (210, 120))
screen.blit(body, (180, 120)) screen.blit(body, (180, 120))
screen.blit(body, (180, 90)) screen.blit(body, (180, 90))
......
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