Commit e2e8d469 by BellCodeEditor

save project

parent 58fdfeee
Showing with 5 additions and 4 deletions
......@@ -17,6 +17,7 @@ down = pygame.image.load('down.png')
body = pygame.image.load('body.png')
setheading ="right"
snake_head =right
text=pygame.
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -42,15 +43,12 @@ while True:
y-=30
elif setheading =="down":
y+=30
p.append((x,y))
p.append((x,y))
if x==apple_x and y==apple_y:
num1=random.randint(1,22)
num2=random.randint(1,16)
apple_x=30*num1-30
apple_y=30*num2-30
else:
p.pop(0)
screen.blit(background, (0, 0))
......@@ -58,5 +56,7 @@ while True:
for i in range(len(p)-1):
screen.blit(body,p[i])
screen.blit(food, (apple_x, apple_y))
info="Store"
pygame.display.update()
fps.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