Commit 1281c425 by BellCodeEditor

save project

parent 5e618b4c
Showing with 9 additions and 5 deletions
...@@ -65,22 +65,25 @@ while True: ...@@ -65,22 +65,25 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
# 悟空造型 # 悟空造型
wukong = Player(hero[index]) wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
index = 0
if game_state: if game_state:
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
index = 0
if jumpState == "up": # 起跳状态 if jumpState == "up": # 起跳状态
if t > 0: if t > 0:
y -= t y -= t
wukong.rect.y = y
t -= 2 t -= 2
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 30: if t <= 30:
y += t y += t
wukong.rect.y = y
t += 2 t += 2
else: else:
jumpState = "runing" jumpState = "runing"
...@@ -114,5 +117,5 @@ while True: ...@@ -114,5 +117,5 @@ while True:
game_state = False game_state = False
# 刷新画面 # 刷新画面
display.update() display.update()
TIME().tick() TIME().tick(55)
\ 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