From c6ece69f3f7e5aae843fd209ab9be5c360c1a7b6 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Mon, 2 May 2022 16:09:45 +0800 Subject: [PATCH] save project --- snake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snake.py b/snake.py index 537316e..b4dcf27 100644 --- a/snake.py +++ b/snake.py @@ -52,6 +52,9 @@ while True: else: y += 30 position.append((x, y)) + if x == apple_x and y == apple_y: + apple_x = random.randit(0,660) + apple_y = random.randit(0,480) position.pop(0) # 将背景图画上去 screen.blit(background, (0, 0)) -- libgit2 0.25.0