Commit de68f055 by BellCodeEditor

save project

parent 72f08bd7
Showing with 8 additions and 2 deletions
...@@ -17,6 +17,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -17,6 +17,7 @@ hero = [pygame.image.load('hero1.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
G=5
y=400 y=400
IM='running' IM='running'
...@@ -35,13 +36,18 @@ while True: ...@@ -35,13 +36,18 @@ while True:
IM='up' IM='up'
if IM=='up': if IM=='up':
if y>150: if y>150:
y-=5 y-=2*G
G-=0.05
else: else:
IM='down' IM='down'
if IM=='down': if IM=='down':
if y<=400: if y<=400:
y+=5 y+=2*G
G+=0.2
else: else:
G=5
if y>400:
y=400
if IM!='up': if IM!='up':
IM='running' IM='running'
herorun=hero[index] herorun=hero[index]
......
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