Commit 92fdf7ef by BellCodeEditor

save project

parent 686c5f10
Showing with 3 additions and 1 deletions
File added
......@@ -40,7 +40,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
basic_font = pygame.font.Font('STKAITI.TTF',32)
basic_font = pygame.font.Font('Roboto-Black.ttf',32)
index = 0
y = 400
jumpState = "runing"
......@@ -49,6 +49,7 @@ road_x = 0
bg_x = 0
time = 0
gamestate = True
score=0
block_list =pygame.sprite.Group() # 创建精灵组
......@@ -111,6 +112,7 @@ while True:
screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y))
if sprite.rect.x <= 0-sprite.rect.width:
sprite.kill()
score+=1
if pygame.sprite.collide_rect(wukong, sprite): # 精灵碰撞检测
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
......
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