Commit 23b84b7b by BellCodeEditor

save project

parent 915cf4cd
Showing with 7 additions and 2 deletions
......@@ -71,7 +71,11 @@ while True:
elif event.key == locals.K_DOWN: # 向下
if check(center)==False:
center[0] += 1
elif event.key == locals.K_UP:
old_index=index
index+=1
if index>=len(shape):
index=0
# 将背景图画上去
screen.blit(background, (0, 0))
# 计算出所有小方块的行、列位置
......@@ -80,7 +84,8 @@ while True:
pos = (cube[0] + center[0], cube[1] + center[1])
current_pos.append(pos)
# 取出所有小方块的行、列位置,计算坐标,绘制俄罗斯方块
for cube in current_pos:
for cube in current_pos:
pygame.draw.rect(screen, color,
(cube[1] * 20-20, cube[0] * 20-20, 20, 20), 0)
pygame.draw.rect(screen, (255, 255, 255),
......
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