Commit 92c7bc5a by BellCodeEditor

save project

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