Commit a38267f5 by BellCodeEditor

save project

parent 7322e026
Showing with 19 additions and 10 deletions
......@@ -20,6 +20,7 @@ index = 0
pygame.display.set_caption(" 顶级大傻的跑酷")
jumpS = "run"
y = 400
yy=5
while True:
for event in pygame.event.get():
......@@ -28,18 +29,25 @@ while True:
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
if y == 400:
if jumpS == "run":
jumpS = "up"
# if jumpS == "up":
# if y>150:
# y-=5
# else:
# jumpS = "down"
# if jumpS == "down":
# if y<400:
# y+=5
# else:
# jumpS = "run"
if jumpS == "up":
if y>150:
y-=5
else:
jumpS = "down"
if jumpS == "down":
y-=1
if y<400:
y+=5
y-=yy
yy-=0.1
else:
jumpS = "run"
jumpS = "run"
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
......@@ -47,4 +55,6 @@ while True:
# 刷新画面
pygame.display.update()
FPS.tick(60)
index=(index+1)%5
\ No newline at end of file
if jumpS == "run":
index=(index+1)%5
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