Commit b4788772 by BellCodeEditor

save project

parent 080ee70a
Showing with 11 additions and 2 deletions
...@@ -20,6 +20,8 @@ hero = [pygame.image.load('hero1.png'), ...@@ -20,6 +20,8 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
index = 0 index = 0
y = 400 y = 400
SB = 0
SB1 = 0
jumpState = "runing" jumpState = "runing"
t = 30 t = 30
obstacle = random.choice([bush, stone, cacti]) obstacle = random.choice([bush, stone, cacti])
...@@ -58,8 +60,15 @@ while True: ...@@ -58,8 +60,15 @@ while True:
if index >= 5: if index >= 5:
index = 0 index = 0
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) # 远处背景 SB -= 8
screen.blit(road, (0, 500)) # 路 if SB < -1000:
SB = 0
SB1 -= 2
if SB1 < -1000:
SB1 = 0
screen.blit(background, (SB1, 0)) # 远处背景
screen.blit(road, (SB, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wukong, (150, y)) # 悟空
if rect.x <= 0-rect.width: # 障碍物消失 if rect.x <= 0-rect.width: # 障碍物消失
......
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