Commit 91aa2a44 by BellCodeEditor

save project

parent 33a9a8a1
Showing with 14 additions and 1 deletions
...@@ -19,12 +19,25 @@ while True: ...@@ -19,12 +19,25 @@ while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
if event.type == locals.KEYDOWN:
if event.key == locals.KEY_SPACE:
jiumState == "up"
if jiumState == "up":
if y > 150:
y -=5
else:
jiumState == "down"
if jiumState == "down":
if y > 150:
y -=5
else:
jiumState == "runing"
exit() exit()
if i>4: if i>4:
i=0 i=0
wukong=hero[i] wukong=hero[i]
i+=1 i+=1
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(wukong, (150, 400)) screen.blit(wukong, (150, 400))
......
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