From 45c0082199dbfe5ac4377ed7b48fd9156ba42d44 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Wed, 9 Aug 2023 10:55:59 +0800 Subject: [PATCH] save project --- my_Tetris.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/my_Tetris.py b/my_Tetris.py index 8711234..0728e89 100644 --- a/my_Tetris.py +++ b/my_Tetris.py @@ -1,5 +1,6 @@ import pygame from pygame import locals +import random pygame.init() # 初始化 score = 0 @@ -44,8 +45,9 @@ cube_colors = [ (255, 204, 0), (204, 0, 51),(255, 0, 51), (0, 102, 153), (153, 0, 51), (204, 255, 102), (255, 153, 0)] +color=random.choice(cube_colors) center = [2, 8] # 第2行第8列 -current_shape = [(0, -1), (0, 0), (0, 1), (-1, 0)] +current_shape = random.choice(shape_list[random.randint(0,6)]) while True: for event in pygame.event.get(): -- libgit2 0.25.0