Commit 2e5c5de5 by BellCodeEditor

save project

parent c6a488f2
Showing with 17 additions and 1 deletions
......@@ -9,6 +9,8 @@ grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量
FPS = 30
index = 0
count=0
state=False
# 创建窗口
screen = pygame.display.set_mode((460, 500))
......@@ -59,6 +61,19 @@ def check(center):
return False
while True:
count+=1
if count % FPS == 0:
center[0]+=1
if check(center)==False:
center[0]-=1
state=False
if state==False:
state=True
center = [2, 8] # 第2行第8列
random_shape = shape_list[random.randint(0,len(shape_list)-1)]
shape_index = random.randint(0,len(random_shape)-1)
current_shape = random_shape[shape_index]
color = cube_colors[random.randint(0,len(cube_colors)-1)]
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
......@@ -86,7 +101,8 @@ while True:
if check(center) == False:
shape_index = old_index
current_shape = random_shape[shape_index]
# 将背景图画上去
screen.blit(background, (0, 0))
# 计算出所有小方块的行、列位置
......
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