Commit cd60744e by BellCodeEditor

save project

parent b9a3d89b
Showing with 3 additions and 2 deletions
...@@ -60,14 +60,15 @@ while True: ...@@ -60,14 +60,15 @@ while True:
ya = n2 * 30 ya = n2 * 30
else: else:
position.pop(0) position.pop(0)
if x < 0 or x > 630 or y < 0 or y > 450:
exit()
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(snake_head, position[-1]) screen.blit(snake_head, position[-1])
for i in range(len(position)-1): for i in range(len(position)-1):
screen.blit(body, position[i]) screen.blit(body, position[i])
screen.blit(food, (xa,ya)) screen.blit(food, (xa,ya))
info = "Score:" + str(score) info = "Score:" + str(score)
text = font.render(info,True,(0,0,0)) text = font.render(info,True,(0,0,0))
......
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