Commit 145cddd7 by BellCodeEditor

auto save

parent b7219166
Showing with 16 additions and 2 deletions
...@@ -32,9 +32,10 @@ while True: ...@@ -32,9 +32,10 @@ while True:
if event.key == locals.K_w and state == "runing": if event.key == locals.K_w and state == "runing":
state = "up" state = "up"
if event.key == locals.K_s: if event.key == locals.K_s:
y = 500 state = "s"
if event.key == locals.K_d: if event.key == locals.K_d:
y = 400 state = "d"
if state == "up" : if state == "up" :
if t > 0: if t > 0:
y -= t y -= t
...@@ -48,6 +49,19 @@ while True: ...@@ -48,6 +49,19 @@ while True:
else: else:
state = "runing" state = "runing"
t -= 2 t -= 2
if state == "s" :
if t > 0:
y -= t
t -= 2
else:
state = "down"
if state == "d" :
if t <= 30:
y += t
t += 2
else:
state = "runing"
t -= 2
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(hero[index], (150, y)) screen.blit(hero[index], (150, 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