Commit 51f85eb3 by BellCodeEditor

save project

parent 459e6e97
Showing with 7 additions and 2 deletions
......@@ -14,6 +14,7 @@ cacti = pygame.image.load('cacti.png') # 仙人掌
apple = pygame.image.load('bush.png') # 灌木丛
hero=['hero1.png','hero2.png','hero3.png','hero4.png','hero5.png']
index = 0
x=0
y=400
jumpstart="run"
while True:
......@@ -25,16 +26,20 @@ while True:
if event.key ==locals.K_SPACE:
if jumpstart == "run":
jumpstart="up"
x=30
if jumpstart == "up":
if y>150:
y-=5
y-=x
x-=2
else:
jumpstart="down"
if jumpstart == "down":
if y<400:
y+=5
y+=x
x+=2
else:
jumpstart="run"
y=400
wukong=pygame.image.load(hero[index])
if jumpstart == "run":
index+=1
......
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