Commit fc8a0426 by BellCodeEditor

save project

parent bf26f828
Showing with 4 additions and 4 deletions
...@@ -3,7 +3,7 @@ from pygame import locals ...@@ -3,7 +3,7 @@ from pygame import locals
import random import random
pygame.init() # 初始化 pygame.init() # 初始化
sss=pygame.font.Font('neuropol.ttf',20) sss=pygame.font.Font('STKAITI.TTF',20)
class Block(pygame.sprite.Sprite): # 障碍物精灵类 class Block(pygame.sprite.Sprite): # 障碍物精灵类
def __init__(self,image1,image2,image3): def __init__(self,image1,image2,image3):
super().__init__() super().__init__()
...@@ -116,11 +116,11 @@ while True: ...@@ -116,11 +116,11 @@ while True:
screen.blit(gameover, (400, 200)) screen.blit(gameover, (400, 200))
gamestate = False gamestate = False
else: else:
if sprite.rect.x<0-wukong.rect.x: if sprite.rect.x+sprite.rect.width<wukong.rect.x:
fs+=sprite.fs fs+=sprite.fs
sprite.fs=0 sprite.fs=0
text=sss.render('SCORE'+':'+str(fs),True,(0,0,0))
screen.blit(text,(00,0))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
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