Commit 0687e059 by BellCodeEditor

auto save

parent 65909506
Showing with 10 additions and 0 deletions
......@@ -123,6 +123,16 @@ while True:
(cube[1] * 20-20, cube[0] * 20-20, 20, 20), 0)
pygame.draw.rect(screen, (255, 255, 255),
(cube[1] * 20-20, cube[0] * 20-20, 20, 20), 1)
# 创建一个1-25的列表进行遍历(记录行的位置)
for i, row in zip(range(1, 26), num_list):
# 创建一个1-15的列表进行遍历(记录列的位置)
for j, colors in zip(range(1, 16), row):
if colors != 0: # if判断每一个格子对应的值不等于0
# 用pygame.draw.rect()方法画出小方块
pygame.draw.rect(screen, colors,
(j * 20-20, i * 20-20, 20, 20))
pygame.draw.rect(screen, (255, 255, 255),
(j * 20-20, i * 20-20, 20, 20), 1)
# 得分
text_surface = font.render(str(score), True, (0, 0, 0))
screen.blit(text_surface, (350,70))
......
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