Commit efe0ed3c by BellCodeEditor

save project

parent 4f14d5c6
Showing with 7 additions and 2 deletions
......@@ -52,7 +52,7 @@ while True:
if jumpState == "runing":
if event.key == locals.K_SPACE:
jumpState = "up"
if gamestate==True:
if jumpState == "up": # 起跳状态
if t > 0:
y -= t
......@@ -96,8 +96,12 @@ while True:
for sprite in block_list:
sprite.rect.x -= 16
screen.blit(sprite.image, (sprite.rect.x,sprite.rect.y))
if spirte.rect.x <= 0-sprite.rect.y:
if sprite.rect.x <= 0-sprite.rect.width:
sprite.kill()
if pygame.sprite.collide_rect(wukong,sprite):
gameover=pygame.image.load('gameover.png')
screen.blit(gameover,(400,200))
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