Commit 514d0306 by BellCodeEditor

save project

parent b292f681
Showing with 5 additions and 5 deletions
...@@ -20,7 +20,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -20,7 +20,7 @@ hero = [pygame.image.load('hero1.png'),
index = 0 index = 0
y = 400 y = 400
t = 30 t = 35
road_x = 0 road_x = 0
beijing_x = 0 beijing_x = 0
jump = "running" jump = "running"
...@@ -45,12 +45,12 @@ while True: ...@@ -45,12 +45,12 @@ while True:
else: else:
jump = "down" jump = "down"
if jump == "down": if jump == "down":
if t <= 30: if t <= 35:
y += t y += t
t += 2 t += 2
else: else:
jump = "running" jump = "running"
t = 30 t = 35
wukong = hero[index] wukong = hero[index]
if jump == "running": if jump == "running":
index += 1 index += 1
...@@ -61,7 +61,7 @@ while True: ...@@ -61,7 +61,7 @@ while True:
if beijing_x <= -1000: if beijing_x <= -1000:
beijing_x = 0 beijing_x = 0
screen.blit(background, (beijing_x, 0)) screen.blit(background, (beijing_x, 0))
road_x -= 7 road_x -= 8
if road_x <= -1000: if road_x <= -1000:
road_x = 0 road_x = 0
screen.blit(road, (road_x, 500)) screen.blit(road, (road_x, 500))
...@@ -72,7 +72,7 @@ while True: ...@@ -72,7 +72,7 @@ while True:
rect.x = 1000 rect.x = 1000
rect.y = 455 - rect.width rect.y = 455 - rect.width
else: else:
rect.x -= 7 rect.x -= 8
screen.blit(obstacle,(rect.x, rect.y)) screen.blit(obstacle,(rect.x, rect.y))
# 刷新画面 # 刷新画面
pygame.display.update() 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