Commit 037d66e9 by BellCodeEditor

save project

parent 62b93d2f
Showing with 8 additions and 6 deletions
......@@ -16,7 +16,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
t = 30
num = 0
index = 0
jumpState = "run"
......@@ -29,15 +29,17 @@ while True:
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
jumpState = "up"
jumpState = "up"
if jumpState == "up":
if y > 150:
y -= 5
if t > 0:
y -= t
t -= 2
else:
jumpState = "down"
if jumpState == "down":
if y < 400:
y += 5
if t <= 30:
y += t
t += 2
else:
jumpState = "runing"
......
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