Commit dc3c0ed8 by BellCodeEditor

save project

parent 8b032bfd
Showing with 7 additions and 4 deletions
...@@ -21,6 +21,7 @@ fps = pygame.time.Clock() ...@@ -21,6 +21,7 @@ fps = pygame.time.Clock()
index = 0 index = 0
jumpstate = 'running' jumpstate = 'running'
y = 400 y = 400
t = 30
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -35,13 +36,15 @@ while True: ...@@ -35,13 +36,15 @@ while True:
index -= 5 index -= 5
if jumpstate == 'up': if jumpstate == 'up':
if y > 150: if t > 0:
y -= 10 y -= t
t -= 2
else: else:
jumpstate = 'down' jumpstate = 'down'
if jumpstate == 'down': if jumpstate == 'down':
if y < 400: if t <= 30:
y += 10 y += t
t += 2
else: else:
jumpstate = 'running' jumpstate = 'running'
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
......
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