Commit 57430781 by BellCodeEditor

save project

parent ae5ed95e
Showing with 4 additions and 10 deletions
......@@ -16,7 +16,6 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png'),]
index = 0
jumpStste = "runing"
y = 400
......@@ -30,25 +29,20 @@ while True:
if event.key == locals.K_SPACE:
jumpStste ="up"
if jumpStste =="up":
if t>0:
y -=t
t -=2
if y > 150:
y -=5
else:
jumpStste = "down"
if jumpStste =="down":
if t<=30:
y += t
t +=2
if y < 400:
y +=40
else:
jumpStste = "runing"
t = 30
wukong = hero[index]
index +=1
if index == 5:
index =0
if jumpStste == "up" or jumpStste =="down":
index = 0
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
......
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