Commit 8c04f2ba by BellCodeEditor

auto save

parent e2a94ff5
Showing with 17 additions and 6 deletions
......@@ -38,11 +38,22 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if jumpState == 'running':
if event.key == locals.K_SPACE:
jumpState = 'up'
# 悟空造型
if jumpState == 'up':
if y > 150:
y-=0.5
else:
jumpState = 'down'
if jumpState == 'down':
if y < 400:
y+=0.1
else:
jumpState = 'running'
wukong = hero[index]
if jumpState == "runing": # 跑步状态下
index += 1
......@@ -68,4 +79,4 @@ while True:
screen.blit(aa.image, (aa.rect.x, aa.rect.y))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
FPS.tick(15)
\ 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