Commit de20ed43 by BellCodeEditor

save project

parent 9ae59211
Showing with 5 additions and 5 deletions
......@@ -39,7 +39,7 @@ y = 400
jumpState = "runing"
t = 30
road_x=0
gamestate=0
gamestate= True
time=0
bg_x=0
......@@ -64,14 +64,14 @@ while True:
if jumpState == "up": # 起跳状态
if t > 0:
y -= t
wukong.rect.y=y
wukong.rect.y = y
t -= 2
else:
jumpState = "down"
if jumpState == "down": # 降落状态
if t <= 30:
y += t
wukong.rect.y=y
wukong.rect.y = y
t += 2
else:
jumpState = "runing"
......@@ -87,7 +87,7 @@ while True:
road_x=0
screen.blit(road,(road_x,500))
screen.blit(wokong.image,(150,y))
screen.blit(wukong.image,(150,y))
time+=1
......@@ -102,7 +102,7 @@ while True:
screen.blit(sprite.image, (sprite.rect.x,sprite.rect.y))
if sprite.rect.x<=0-sprite.rect.width:
sprite.kill()
if pygame.sprite.collide_rect(wokong,sprite):
if pygame.sprite.collide_rect(wukong,sprite):
gameover=pygame.image.load("gameover.png")
screen.blit(gameover,(400,200))
gamestate=False
......
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