Commit 390e7fa9 by BellCodeEditor

auto save

parent 3bb2e58c
Showing with 8 additions and 1 deletions
...@@ -51,6 +51,7 @@ gamestate = True ...@@ -51,6 +51,7 @@ gamestate = True
block_list =pygame.sprite.Group() # 创建精灵组 block_list =pygame.sprite.Group() # 创建精灵组
bacis_fout=pygame.fout.Font()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -114,7 +115,12 @@ while True: ...@@ -114,7 +115,12 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束 gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200)) screen.blit(gameover, (400, 200))
gamestate = False gamestate = False
else:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
score+=sprite.score
sprite.score=0
scoreSurf=basic_font.render('分数:'+str(score),True,(120,134,25))
screen.blit(scoreSurf,(880,20))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ No newline at end of file
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