Commit 43b0dbb1 by BellCodeEditor

save project

parent ef447be1
Showing with 10 additions and 4 deletions
......@@ -9,7 +9,7 @@ grid_num_height = 25 # 纵向格子数量
FPS = 30
center = [2,7]
t_1 = [(0,-1),(0,0),(-1,0),(0,1)]
# 创建窗口
screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块")
......@@ -32,10 +32,16 @@ while True:
if event.key == locals.K_LEFT:
if center[1] >1:
center[1] -=1
# 将背景图画上去
screen.blit(background,(0,0))
pygame.draw.rect(screen,(225,0,0),(center[1]*20-20,center[0]*20-20,20,20,),0)
pygame.draw.rect(screen,(225,225,225),(center[1]*20-20,center[0]*20-20,20,20,),1)
# 将背景图画上去
fangkuai_xy=[]
for t in t_1:
aa = (center[0]+t[0],center[1]+t[1])
fangkuai_xy.append(aa)
for t in fangkuai_xy:
pygame.draw.rect(screen,(225,0,0),(t[1]*20-20,t[0]*20-20,20,20,),0)
pygame.draw.rect(screen,(225,225,225),(t[1]*20-20,t[0]*20-20,20,20,),1)
# 得分
fonta = font.render(str(score),True,(0,0,0))
screen.blit(fonta,(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