Commit 63b06d81 by BellCodeEditor

save project

parent ec13589b
Showing with 9 additions and 1 deletions
......@@ -27,7 +27,7 @@ class Block(pygame.sprite.Sprite):
self.rect=self.image.get_rect()
self.rect.x=1000
self.rect.y=500-self.rect.height
self.score=1
class Player(pygame.sprite.Sprite):
def __init__(self,image):
super().__init__()
......@@ -99,6 +99,13 @@ while True:
gameover = pygame.image.load('gameover.png')
screen.blit(gameover,(400,200))
gamestate = False
else:
if sprite.rect.x<wukong.rect.x:
score+=sprite.score
sprite.score=0
# 刷新画面
pygame.display.update()
FPS.tick(30)
text=sss.render('SCORE:'+str(score),True,(0,0,0))
sss=pygame.font.Font('STKAITI.TTF',20)
screen.blit(text,(900,0))
\ 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