Commit 5cd56acd by BellCodeEditor

save project

parent 4f2aa763
Showing with 6 additions and 0 deletions
...@@ -63,6 +63,8 @@ while True: ...@@ -63,6 +63,8 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if gameover=True:
gameover=False
if event.key == locals.K_a: # 向左 if event.key == locals.K_a: # 向左
center[1] = center[1] - 1 # 左移1列 center[1] = center[1] - 1 # 左移1列
if check(center) == False: if check(center) == False:
...@@ -144,6 +146,10 @@ while True: ...@@ -144,6 +146,10 @@ while True:
if gameover==True: if gameover==True:
text=font_restard.render("游戏失败,按任意键开始",True,(0,0,0)) text=font_restard.render("游戏失败,按任意键开始",True,(0,0,0))
screen.blit(text,(20,250)) screen.blit(text,(20,250))
score=0
num_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