Commit b2e27d64 by BellCodeEditor

save project

parent c996bf3e
Showing with 6 additions and 6 deletions
...@@ -36,7 +36,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -36,7 +36,7 @@ hero = [pygame.image.load('hero1.png'),
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
t = 30 t = 40
block_list = pygame.sprite.Group() block_list = pygame.sprite.Group()
time = 0 time = 0
road_x = 0 road_x = 0
...@@ -60,15 +60,15 @@ while True: ...@@ -60,15 +60,15 @@ while True:
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 30: if t <= 40:
wukong.rect.y += t wukong.rect.y += t
t += 2 t += 2
else: else:
jumpState = "runing" jumpState = "runing"
t =30 t =40
if gameState == True: if gameState == True:
# 悟空造型 # 悟空造型
` wukong.image = hero[index] wukong.image = hero[index]
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
index += 1 index += 1
if index >= 5: if index >= 5:
...@@ -101,4 +101,4 @@ while True: ...@@ -101,4 +101,4 @@ while True:
screen.blit(gameOver,(400,200)) screen.blit(gameOver,(400,200))
gameState = False gameState = False
pygame.display.update() pygame.display.update()
FPS.tick(60)` FPS.tick(60)
\ No newline at end of file \ 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