Commit 27b7e4f2 by BellCodeEditor

auto save

parent e684427a
Showing with 13 additions and 93 deletions
...@@ -30,9 +30,10 @@ heroLength = len(hero) ...@@ -30,9 +30,10 @@ heroLength = len(hero)
state = "runing" state = "runing"
y = 400 y = 400
t = 30 t = 30
d = 34 d = 30
f = 30 f = 30
ob = Block(bush,cacti ,bush) g = 30
ob = Block(background,cacti ,bush)
road_x = 0 road_x = 0
bg_x = 0 bg_x = 0
while True: while True:
...@@ -87,101 +88,20 @@ while True: ...@@ -87,101 +88,20 @@ while True:
#d #d
if state == "d" : if state == "d" :
if d > 0: if d > 0:
y += d y -= d
d -= 2
else:
state = "q"
if state == "q" :
if d <= 34:
y -= t
d += 2
f -= 2
else:
state = "f"
if state == "f" :
if f <= 30:
y += f
f += 2
else:
y = 400
state = "d"
if state == "d" :
if d > 0:
y += d
d -= 2
else:
state = "q"
if state == "q" :
if d <= 34:
y -= t
d += 2
f -= 2
else:
state = "f"
if state == "f" :
if f <= 30:
y += f
f += 2
else:
y = 400
state = "d"
if state == "d" :
if d > 0:
y += d
d -= 2
else:
state = "q"
if state == "q" :
if d <= 34:
y -= t
d += 2
f -= 2
else:
state = "f"
if state == "f" :
if f <= 30:
y += f
f += 2
else:
y = 400
state = "d"
if state == "d" :
if d > 0:
y += d
d -= 2
else:
state = "q"
if state == "q" :
if d <= 34:
y -= t
d += 2
f -= 2
else:
state = "f"
if state == "f" :
if f <= 30:
y += f
f += 2
else:
y = 400
state = "d"
if state == "d" :
if d > 0:
y += d
d -= 2 d -= 2
else: else:
state = "q" state = "q"
if state == "q" : if state == "q" :
if d <= 34: if d <= 0:
y -= t
d += 2 d += 2
f -= 2 f -= 2
else: else:
state = "f" state = "g"
if state == "f" : if state == "g" :
if f <= 30: if g <= 30:
y += f y -= g
f += 2 g += 2
else: else:
y = 400 y = 400
state = "runing" state = "runing"
...@@ -191,13 +111,13 @@ while True: ...@@ -191,13 +111,13 @@ while True:
screen.blit(hero[index], (150, y)) screen.blit(hero[index], (150, y))
bg_x -= 1 bg_x -= 1
if bg_x <= -2000: if bg_x <= -1000:
bg_x = 0 bg_x = 0
road_x -= 8 road_x -= 8
if road_x <= -2000: if road_x <= -1000:
road_x = 0 road_x = 0
if ob.rect.x < 0-ob.rect.width: if ob.rect.x < 0-ob.rect.width:
ob = Block(bush,cacti ,bush) ob = Block(background,cacti ,bush)
ob.rect.x -= 8 ob.rect.x -= 8
screen.blit(ob.image,(ob.rect.x , ob.rect.y)) screen.blit(ob.image,(ob.rect.x , ob.rect.y))
......
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