Commit d00f7717 by BellCodeEditor

save project

parent cd054447
Showing with 12 additions and 6 deletions
......@@ -9,6 +9,7 @@ grid_num_height = 25 # 纵向格子数量
FPS = 30
number=0
kun=[2,7]
shape=[(0,0),(0,0),(0,0),(0,0)]
# 创建窗口
screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块")
......@@ -21,15 +22,18 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN and kun[0]<25:
if event.key == locals.K_LEFT and kun[1]>1:
if event.type == locals.KEYDOWN and kun[0]<25 :
if event.key == locals.K_LEFT and kun[1]>1 and number<1000000000:
kun[1]=kun[1]-1
if event.key == locals.K_RIGHT and kun[1]<15:
if event.key == locals.K_RIGHT and kun[1]<15 and number<1000000000:
kun[1]=kun[1]+1
if event.key == locals.K_DOWN:
if event.key == locals.K_DOWN and number<1000000000:
kun[0]=25
if event.key == locals.K_UP:
number=10000
if event.key == locals.K_SPACE:
if number >= 1000000000:
number=0
else:
number=1000000000
# 将背景图画上去
......@@ -44,5 +48,7 @@ while True:
if number==20:
kun[0]+=1
number=0
if number>=1000000000:
screen.blit(font.render("暂停",True,(0,0,0)),(90,200))
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