Commit fe523fcb by BellCodeEditor

save project

parent 960ab123
Showing with 8 additions and 3 deletions
...@@ -44,13 +44,13 @@ while True: ...@@ -44,13 +44,13 @@ while True:
if jumpstate == 'up': if jumpstate == 'up':
if t > 0: if t > 0:
y -= t y -= t
t -= 1.75 t -= 1.25
else: else:
jumpstate = 'down' jumpstate = 'down'
if jumpstate == 'down': if jumpstate == 'down':
if t <= 25: if t <= 25:
y += t y += t
t += 1.75 t += 1.25
else: else:
jumpstate = 'running' jumpstate = 'running'
t = 25 t = 25
...@@ -58,8 +58,12 @@ while True: ...@@ -58,8 +58,12 @@ while True:
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
screen.blit(wukong,(150,y)) screen.blit(wukong,(150,y))
screen.blit(obstacle,(rect.x,rect.y)) screen.blit(obstacle,(rect.x,rect.y))
screen.blit(road,(0,500)) screen.blit(road,(0,500))
pygame.display.update() pygame.display.update()
rect.x -= 8 rect.x -= 8
if rect.x < 0 - rect.width:
obstacle = random.choice([bush,stone,cacti,bush,stone,cacti])
rect = obstacle.get_rect()
rect.x = 1000
rect.y = 500-rect.height
fps.tick(60) 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