Commit 9606fa5a by BellCodeEditor

auto save

parent 9e85e5de
Showing with 8 additions and 3 deletions
......@@ -8,6 +8,7 @@ grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量
FPS = 30
center = [2,8]
c_s =[(0,-1),(0,0),(0,1),(0,2)]
# 创建窗口
screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块")
......@@ -32,11 +33,15 @@ while True:
center[0] = center[0]+1
# 将背景图画上去
screen.blit(background,(0,0))
# 得分
c_p = []
for i in c_s:
aa = (i[0] + center[0],i[1] + center[1]) # 得分
c_p.append(aa)
for i in c_p:
pygame.draw.rect(screen,(153,0,102),(i[1]*20-20,i[0]*20-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(i[1]*20-20,i[0]*20-20,20,20),1)
score_text = font.render(str(score),True,(0,0,0))
screen.blit(score_text,(350,70))
pygame.draw.rect(screen,(255,0,0),(center[1]*20-20,center[0]*20-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(center[1]*20-20,center[0]*20-20,20,20),1)
# 刷新画面
pygame.display.update()
clock.tick(FPS)
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