Commit 0d7fabcc by BellCodeEditor

save project

parent 022ec8df
Showing with 23 additions and 2 deletions
......@@ -19,6 +19,28 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
juspState == "up"
if juspState == "up":
if t > 0:
y -= t
t -= 2
else:
jumpState = "down"
if jumpState == "down":
if t <= 30:
y += t
t += 2
else:
jumpState = "runing"
t = 30
wukong = hero[index]
if jumpState == "runing":
index += 1
if index == 5:
# 将背景图画上去
screen.blit(background, (0, 0))
......@@ -26,4 +48,4 @@ while True:
screen.blit(hero, (150, 400))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
FPS.tick(60)
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