Commit 8adedd28 by BellCodeEditor

save project

parent 4ffc3a06
Showing with 8 additions and 6 deletions
......@@ -67,6 +67,8 @@ while True:
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN:
if gameover == True:
gameover = False
if event.key == locals.K_LEFT: # 向左
center[1] = center[1] - 1 # 左移1列
if check(center) == False:
......@@ -94,7 +96,7 @@ while True:
if check(center) == False:
index = old_index
current_shape = shape[index]
if event
# 生成新俄罗斯方块
if num_list[1][7]!=0:
gameover=True
......@@ -114,8 +116,7 @@ while True:
states = False
for cube in current_pos:
num_list[cube[0]-1][cube[1]-1] = color
if num_list[1][7]!=0:
gameover=true
# 将背景图画上去
screen.blit(background, (0, 0))
# 计算出所有小方块的行、列位置
......@@ -157,11 +158,12 @@ while True:
text_surface = font.render(str(score), True, (0, 0, 0))
screen.blit(text_surface, (350,70))
if gameover==True:
text_surface = font.render(str("anjian", True, (0, 0, 0))
screen.blit(text_surface, (20,250))
text_surface1 = font1.render("anjian", True, (0, 0, 0))
screen.blit(text_surface1, (20,250))
num_list=[]
for i in range(25):
num_list.append([0]*15)
score
score=0
# 刷新画面
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