Commit 8de9d5c4 by BellCodeEditor

save project

parent 9ded14c8
Showing with 5 additions and 5 deletions
......@@ -56,8 +56,6 @@ num_list=[]
for i in range(25):
num_list.append([0]*15)
def check(center):
for cube in current_shape:
if num_list[cube[0]-1][cube[1]-1]!=0:
return False
......@@ -108,16 +106,18 @@ while True:
shape = random.choice(shape_list)
index = random.randint(0, len(shape)-1) # 随机形状索引
current_shape = shape[index]
color = random.choice(cube_colors) # 随机选取一种颜色
color = random.choice(cube_colors)
# 随机选取一种颜色
count += 1
if count % FPS == 0: # 降落速度的算式
center[0] = center[0] + 1
print(check(center))
if check(center) == False:
center[0] = center[0] - 1
states = False
for cube in current_pos:
num_list[cube[0]-1][cube[1]-1]=color
print(num_list)
# 将背景图画上去
screen.blit(background, (0, 0))
......@@ -153,7 +153,7 @@ while True:
if tttt==False:
new_list[row_index]=num_list[i]
row_index-=1
num_list=new_list
else:
score+=1
num_list=new_list
# 得分
......
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