Commit 310076c7 by BellCodeEditor

save project

parent 3bb2e58c
Showing with 13 additions and 2 deletions
......@@ -49,6 +49,7 @@ bg_x = 0
time = 0
gamestate = True
block_list =pygame.sprite.Group() # 创建精灵组
while True:
......@@ -68,6 +69,7 @@ while True:
if index >= 5:
index = 0
if gamestate == True:
if jumpState == "up": # 起跳状态
if t > 0:
......@@ -85,19 +87,23 @@ while True:
jumpState = "runing"
t =30
# 将背景图画上去
bg_x -= 1
if bg_x<=-1000:
bg_x = 0
screen.blit(background, (bg_x, 0)) # 远景
road_x -= 8
if road_x<=-1000:
road_x = 0
screen.blit(road, (road_x, 500)) # 道路
screen.blit(wukong.image, (150, y)) # 悟空
time += 1
if time >= 60: # 创建障碍物精灵
time = 0
......@@ -114,7 +120,13 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
else:
if sprite.rect.x+sprite.rect:
score+=prop.score
prop.score=0
scoreSorf=basic_font.render('分数:'+str(score),True,(225,225,225))
screen.blit(scoreSurf,880)
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ 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