From 569c05107a7507445d2bb8ee4d7226e3c2002c2a Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 17 Oct 2021 14:27:23 +0800 Subject: [PATCH] save project --- snake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snake.py b/snake.py index ea5b520..d7889e0 100644 --- a/snake.py +++ b/snake.py @@ -1,6 +1,6 @@ import pygame from pygame import locals - +import random # 初始化pygame,为使用硬件做准备 pygame.init() @@ -56,8 +56,8 @@ while True: # 将背景图画上去. screen.blit(background, (0, 0)) if x ==apple_x and y==apple_y: - num1==random.randint(0,21) - num2==random.randint(0,15) + num1=random.randint(0,21) + num2=random.randint(0,15) apple_x=num1*30 apple_y=num2*30 # 将贪吃蛇的头画上去 -- libgit2 0.25.0