Commit 38b7fa8d by BellCodeEditor

save project

parent df8786a3
Showing with 10 additions and 1 deletions
......@@ -45,8 +45,17 @@ cube_colors = [
(153, 0, 51), (204, 255, 102), (255, 153, 0)]
center = [2, 8] # 第2行第8列
current_shape = [(0, -1), (0, 0), (0, 1), (-1, 0)]
shape = random.choice(shape_list)
index = random.randint(0len(shape)-1)
current-shape = shape[index]
color = random.choice(cube_colors)
def check(center):
for cube in current_shape:
cube = (cube[0] + center[0],cube[1] + center[1])
# 当前的小方块超出网格的行,列,就返回false
if cube[0] < 1 or cube[1] >grid _num_width:
return False
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......
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