Commit 67344082 by BellCodeEditor

save project

parent f17a1cb4
Showing with 8 additions and 4 deletions
...@@ -18,6 +18,7 @@ apple = pygame.image.load('bush.png') # 灌木丛 ...@@ -18,6 +18,7 @@ apple = pygame.image.load('bush.png') # 灌木丛
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
index = 0 index = 0
t=30
y=400 y=400
jumpstate="running" jumpstate="running"
while True: while True:
...@@ -30,15 +31,18 @@ while True: ...@@ -30,15 +31,18 @@ while True:
jumpstate="up" jumpstate="up"
if jumpstate=="up": if jumpstate=="up":
if y>=150: if t>0:
y-=5 y-=t
t-=5
else: else:
jumpstate="down" jumpstate="down"
if jumpstate=="down": if jumpstate=="down":
if y<=400: if t<=30:
y+=5 y+=t
t+=5
else: else:
jumpstate="running" jumpstate="running"
t=30
index+=1 index+=1
if index>4: if index>4:
......
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