Commit a20cec2a by BellCodeEditor

save project

parent 3cb11759
Showing with 7 additions and 5 deletions
......@@ -3,7 +3,7 @@ from pygame import locals
import random
pygame.init() # 初始化
basic_font=pygame.font.Font("STKAITI.TTF",18)
class Block(pygame.sprite.Sprite): # 障碍物精灵类
def __init__(self,image1,image2,image3):
super().__init__()
......@@ -40,6 +40,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
index = 0
y = 400
jumpState = "runing"
......@@ -115,11 +116,13 @@ while True:
screen.blit(gameover, (400, 200))
gamestate = False
else:
if (sprite.rect.x+sprite.rect.width)<.rect.x:
if (sprite.rect.x+sprite.rect.width)<wukong.rect.x:
score+=sprite.score
sprite.score=0
print(score)
scoreSurf=basic_font.render("分数:"+str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,20))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
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