Commit 6f69ca18 by BellCodeEditor

save project

parent e3351857
Showing with 4 additions and 3 deletions
...@@ -20,13 +20,14 @@ index = 0 ...@@ -20,13 +20,14 @@ index = 0
jumpstates="running" jumpstates="running"
y=400 y=400
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.type==locals.K_SPACE: if event.key==locals.K_SPACE:
print("1") print("1")
jumpstates="up" jumpstates="up"
if jumpstates=="up": if jumpstates=="up":
...@@ -35,10 +36,10 @@ while True: ...@@ -35,10 +36,10 @@ while True:
else: else:
jumpstates="down" jumpstates="down"
if jumpstates=="down": if jumpstates=="down":
if y<400: if y>400:
y+=5 y+=5
else: else:
jumpstates="running" jumpstates="runnng"
# 将背景图画上去 # 将背景图画上去
wukong=hero[index] wukong=hero[index]
if index==len(hero)-1: if index==len(hero)-1:
......
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