Commit 3ffd9845 by BellCodeEditor

save project

parent 6858eede
Showing with 6 additions and 2 deletions
......@@ -35,6 +35,7 @@ road_x = 0
aa=Block(bush,cacti,stone)
obstacle = Block(bush)
time = 0
True == 0
while True:
for event in pygame.event.get():
......@@ -45,7 +46,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
......@@ -61,7 +62,7 @@ while True:
t =30
# 悟空造型
wukong = hero[index]
wukong =Plaver(hero[index])
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
......@@ -86,6 +87,9 @@ while True:
screen.blit(sprite.tmage,(sprite.rect.x,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))
# 刷新画面
pygame.display.update()
......
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