Commit 0848f8bb by BellCodeEditor

save project

parent 9dbfe3f0
Showing with 2 additions and 1 deletions
...@@ -13,7 +13,7 @@ screen = pygame.display.set_mode((460, 500)) ...@@ -13,7 +13,7 @@ screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块") pygame.display.set_caption("俄罗斯方块")
clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入素材 # 载入素材
pos = []
new_pos1 = [(0,-1),(0,0),(0,1),(-1,0)] new_pos1 = [(0,-1),(0,0),(0,1),(-1,0)]
background = pygame.image.load('bg.png') background = pygame.image.load('bg.png')
font = pygame.font.Font('STKAITI.TTF', 60) # 字体 font = pygame.font.Font('STKAITI.TTF', 60) # 字体
...@@ -34,6 +34,7 @@ while True: ...@@ -34,6 +34,7 @@ while True:
elif event.key == locals.K_DOWN: elif event.key == locals.K_DOWN:
if rect[0]<25: if rect[0]<25:
rect[0]+=1 rect[0]+=1
pos = []
for cube in new_pos1: for cube in new_pos1:
new_pos2=(cube[0]+rect[0],cube[1]+rect[1]) new_pos2=(cube[0]+rect[0],cube[1]+rect[1])
pos.append(new_pos2) pos.append(new_pos2)
......
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