Commit 3716c1a3 by BellCodeEditor

save project

parent e885fe9d
Showing with 6 additions and 3 deletions
...@@ -39,7 +39,7 @@ while True: ...@@ -39,7 +39,7 @@ while True:
pingmu.blit(backgroung,(0,0)) pingmu.blit(backgroung,(0,0))
pingmu.blit(apple,(apple_x,apple_y)) pingmu.blit(apple,(apple_x,apple_y))
postion.append((x,y)) postion.append((x,y))
postion.pop(0)
if heading == "Right": if heading == "Right":
pingmu.blit(right,(x,y)) pingmu.blit(right,(x,y))
...@@ -58,9 +58,12 @@ while True: ...@@ -58,9 +58,12 @@ while True:
if apple_x == x and apple_y == y: if apple_x == x and apple_y == y:
apple_x = random.randint(0,21)*30 apple_x = random.randint(0,21)*30
apple_y = random.randint(0,15)*30 apple_y = random.randint(0,15)*30
else:
postion.pop(0)
for i in range(len(postion)-1): for i in range(len(postion)-1):
pingmu.blit(body,(postion[i])) pingmu.blit(body,(postion[i]))
pygame.display.update() pygame.display.update()
fps.tick(5) fps.tick(15)
\ No newline at end of file \ 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