Commit ea23e728 by BellCodeEditor

save project

parent 4131aa66
Showing with 11 additions and 1 deletions
...@@ -98,7 +98,7 @@ while True: ...@@ -98,7 +98,7 @@ while True:
if check(center) == False: if check(center) == False:
index = old_index index = old_index
current_shape = shape[index] current_shape = shape[index]
if gameover == False:
if states == False: if states == False:
states = True states = True
center = [2, 8] # 第2行第8列 center = [2, 8] # 第2行第8列
...@@ -149,9 +149,19 @@ while True: ...@@ -149,9 +149,19 @@ while True:
else: else:
score += 1 score += 1
num_list = new_list num_list = new_list
if num_list[1][7]!=0:
gameover = True
# 得分 # 得分
text_surface = font.render(str(score), True, (0, 0, 0)) text_surface = font.render(str(score), True, (0, 0, 0))
screen.blit(text_surface, (350,70)) screen.blit(text_surface, (350,70))
if gameover == True:
text = font_restart.render("游戏失败,按任意键重新开始",True,(0,0,0))
screen.blit(text,(20,250))
score = 0
new_list = []
for i in range(25):
num_list.append([0]*15)
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
clock.tick(FPS) 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