Commit d57ad405 by BellCodeEditor

save project

parent 5d496c2d
Showing with 6 additions and 0 deletions
......@@ -42,6 +42,7 @@ time=0
road_x=0
bg_x=0
wukong=wukong(hero[0])
gameState=True
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -66,6 +67,7 @@ while True:
jumpState = "runing"
t =30
if gameState==True:
# 悟空造型
wukong.image = hero[index]
if jumpState == "runing": # 跑步状态下
......@@ -96,6 +98,9 @@ while True:
screen.blit(obstacle.image, (obstacle.rect.x,obstacle.rect.y))
if obstacle.rect.x <= 0- obstacle.rect.width:
obstacle.kill()
if pygame.sprite.collide_rect(wukong,obstacle):
gameOver=pygame.image.load('gameover.png'
gameState=False
# 刷新画面
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