Commit 92c7bc5a by BellCodeEditor

save project

parent 0d4cc6e1
Showing with 9 additions and 7 deletions
......@@ -25,10 +25,11 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_SPACE:
jump="UP"
if jump=="running":
if event.key==locals.K_SPACE:
jump="UP"
if jump=="UP":
if t>0:
y-=t
......@@ -36,7 +37,7 @@ while True:
else:
jump="down"
if jump=="down":
if t<30:
if t<=30:
y+=t
t+=2
else:
......@@ -45,9 +46,10 @@ while True:
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
Q+=1
if Q>4:
Q=0
if jump=="running":
Q+=1
if Q>4:
Q=0
screen.blit(hero[Q], (150, y))
# 刷新画面
pygame.display.update()
......
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