From 45394c490970eb62f2b5159d96a6886e6c1b0628 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Wed, 12 Jul 2023 17:56:49 +0800 Subject: [PATCH] save project --- snake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snake.py b/snake.py index b2da0ff..835d8c9 100644 --- a/snake.py +++ b/snake.py @@ -64,6 +64,9 @@ while True: else: position.pop(0) position.append((x, y)) + if x<0 or x>630 or y<0 or y>480: + exit() + # 将背景图画上去 screen.blit(background, (0, 0)) # 将贪吃蛇的头画上去 -- libgit2 0.25.0