Commit c8c9e2c4 by BellCodeEditor

save project

parent a89f568f
Showing with 9 additions and 1 deletions
...@@ -20,6 +20,8 @@ index = 0 ...@@ -20,6 +20,8 @@ index = 0
y=400 y=400
jumpState="runing" jumpState="runing"
t=30 t=30
road_x=0
background_x=0
obstacle=random.choice([apple,stone,cacti]) obstacle=random.choice([apple,stone,cacti])
rect=obstacle.get_rect() rect=obstacle.get_rect()
rect.y=500-rect.height rect.y=500-rect.height
...@@ -63,7 +65,13 @@ while True: ...@@ -63,7 +65,13 @@ while True:
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) road_x-=8
if road_x<=-1000:
road_x=0
background_x-=2
if background_x<=-1000:
background_x=0
screen.blit(road, (road_x, 500))
screen.blit(wukong, (150, y)) screen.blit(wukong, (150, y))
if rect.x<=0-rect.width: if rect.x<=0-rect.width:
......
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