Commit 577da707 by BellCodeEditor

save project

parent 63b06d81
Showing with 8 additions and 7 deletions
......@@ -20,6 +20,8 @@ hero = [pygame.image.load('hero1.png'),
number = 0
y = 400
t = 30
score = 0
sss=pygame.font.Font('STKAITI.TTF',20)
class Block(pygame.sprite.Sprite):
def __init__(self,image1,image2,image3):
super().__init__()
......@@ -28,6 +30,7 @@ class Block(pygame.sprite.Sprite):
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__()
......@@ -100,12 +103,11 @@ while True:
screen.blit(gameover,(400,200))
gamestate = False
else:
if sprite.rect.x<wukong.rect.x:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
score+=sprite.score
sprite.score=0
# 刷新画面
pygame.display.update()
text=sss.render('SCORE:'+str(score),True,(0,0,0))
screen.blit(text,(0,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