Commit 8fed18c6 by BellCodeEditor

save project

parent 118c7838
Showing with 4 additions and 3 deletions
File added
......@@ -14,6 +14,7 @@ class Block(pygame.sprite.Sprite): # 障碍物精灵类
# 障碍物绘制坐标
self.rect.x = 1000
self.rect.y = 500 - self.rect.height
self.g=1
class Player(pygame.sprite.Sprite): # 悟空
def __init__(self, image):
......@@ -117,11 +118,11 @@ while True:
gamestate = False
else:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
g+=1
print(g)
g+=sprite.g
sprite.g=0
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
scoreSurf = basic_font.render("分数:"+str(g),True,(255,0,0))
screen.blit(scoreSurf,(850,20))
# 刷新画面
......
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