Commit 895caccc by BellCodeEditor

save project

parent 2503ba61
Showing with 9 additions and 9 deletions
...@@ -30,7 +30,7 @@ shan_x=0 ...@@ -30,7 +30,7 @@ shan_x=0
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
t = 60 t = 40
time=0 time=0
bl=pygame.sprite.Group() bl=pygame.sprite.Group()
while True: while True:
...@@ -46,29 +46,29 @@ while True: ...@@ -46,29 +46,29 @@ while True:
if jumpState == "up": # 起跳状态 if jumpState == "up": # 起跳状态
if t > 0: if t > 0:
y -= t y -= t
t -= 5 t -= 2
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 60: if t <= 40:
y += t y += t
t += 5 t += 2
else: else:
jumpState = "runing" jumpState = "runing"
t =60 t =40
# 悟空造型 # 悟空造型
wukong = hero[index] wukong = hero[index]
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
index += 1 index += 1
if index >= 5: if index >= 2:
index = 0 index = 0
# 将背景图画上去 # 将背景图画上去
shan_x -=8 shan_x -=1
if shan_x <-1000: if shan_x <-1000:
shan_x=0 shan_x=0
screen.blit(background, (shan_x, 0)) # 远处背景 screen.blit(background, (shan_x, 0)) # 远处背景
lu_x -=1 lu_x -=8
if lu_x <-1000: if lu_x <-1000:
lu_x=0 lu_x=0
screen.blit(road, (lu_x, 500)) # 路 screen.blit(road, (lu_x, 500)) # 路
...@@ -82,7 +82,7 @@ while True: ...@@ -82,7 +82,7 @@ while True:
bl.add(aa) bl.add(aa)
for i in bl: for i in bl:
i.rect.x -=8 i.rect.x -=8
screen.blit(aa.image, (i.rect.x, i.rect.y)) screen.blit(i.image, (i.rect.x, i.rect.y))
if i.rect.x <= 0-i.rect.width: if i.rect.x <= 0-i.rect.width:
i.kill() i.kill()
......
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