Commit d1d9fa27 by BellCodeEditor

save project

parent 5b7b6590
Showing with 6 additions and 4 deletions
......@@ -129,7 +129,8 @@ while True:
states = False
for i in current_pos:
list[i[0]-1][i[1]-1] = color
pygame.draw.rect(screen, color,(i[1]*20-20,i[0]*20-20,20,20),0)
print(i,list[i[0]-1],i[1]-1,list[i[0]-1][i[1]-1],color )
print(list)
# 将背景图画上去
screen.blit(background, (0, 0))
# 计算出所有小方块的行、列位置
......@@ -145,13 +146,14 @@ while True:
(cube[1] * 20-20, cube[0] * 20-20, 20, 20), 1)
for i,row in zip(range(1,26),list):
for j color in zip(range(1,16),row):
if color != 0:
pygame.draw.rect(screen, color,
for j,colors in zip(range(1,16),row):
if colors != 0:
pygame.draw.rect(screen, colors,
(j * 20-20, i * 20-20, 20, 20), 0)
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