Commit 2589dcfe by BellCodeEditor

save project

parent bfc36784
Showing with 9 additions and 7 deletions
...@@ -24,9 +24,10 @@ while True: ...@@ -24,9 +24,10 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type==locals.KEYDOWN: if jump=="run":
if event.key==locals.K_SPACE: if event.type==locals.KEYDOWN:
jump="up" if event.key==locals.K_SPACE:
jump="up"
if jump=="up": if jump=="up":
if y>150: if y>150:
y-=5 y-=5
...@@ -46,6 +47,7 @@ while True: ...@@ -46,6 +47,7 @@ while True:
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(100) FPS.tick(100)
index+=1 if jump=="run":
if index>4: index+=1
index=0 if index>4:
\ No newline at end of file index=0
\ No newline at end of file
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