Commit c2c62116 by BellCodeEditor

save project

parent efee8bf2
Showing with 3 additions and 7 deletions
...@@ -7,7 +7,7 @@ grid_size = 20 # 格子大小 ...@@ -7,7 +7,7 @@ grid_size = 20 # 格子大小
grid_num_width = 15 # 横向格子数量 grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量 grid_num_height = 25 # 纵向格子数量
FPS = 30 FPS = 30
center=[2,8]
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((460, 500)) screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块") pygame.display.set_caption("俄罗斯方块")
...@@ -20,12 +20,8 @@ while True: ...@@ -20,12 +20,8 @@ while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.key == locals.KEYDOWN: pygame.draw.rect(background,(255,0,0),(160,20,20,20),0)
if event.key == lo pygame.draw.rect(background,(0,0,0),(160,20,20,20),1)
center[0]=center[0]+1
pygame.draw.rect(background,(255,0,0),(center[1],center[0],20,20),0)
pygame.draw.rect(background,(0,0,0),(center[1],center[0],20,20),1)
# 将背景图画上去 # 将背景图画上去
screen.blit(background,(0,0)) screen.blit(background,(0,0))
# 得分 # 得分
......
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