Commit fec051cf by BellCodeEditor

save project

parent dc3c0ed8
Showing with 3 additions and 1 deletions
...@@ -27,10 +27,11 @@ while True: ...@@ -27,10 +27,11 @@ while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN and jumpstate == 'running':
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpstate = 'up' jumpstate = 'up'
wukong = hero[int(index)] wukong = hero[int(index)]
if jumpstate == 'running':
index += 0.25 index += 0.25
while index >= 5: while index >= 5:
index -= 5 index -= 5
...@@ -47,6 +48,7 @@ while True: ...@@ -47,6 +48,7 @@ while True:
t += 2 t += 2
else: else:
jumpstate = 'running' jumpstate = 'running'
t = 30
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
screen.blit(wukong,(150,y)) screen.blit(wukong,(150,y))
screen.blit(road,(0,500)) screen.blit(road,(0,500))
......
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