Commit a16c35ee by BellCodeEditor

save project

parent 9a55b757
Showing with 6 additions and 5 deletions
...@@ -82,11 +82,12 @@ while True: ...@@ -82,11 +82,12 @@ while True:
screen.blit(road, (road_x, 500)) screen.blit(road, (road_x, 500))
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wukong, (150, y)) # 悟空
# ++++++++++++++++++++++ obstacle = Block(bush,cacti,stone) # 创建障碍物
if obstacle.rect.x <= 0-obstacle.rect.width: block_list.add(obstacle)
obstacle = Block(bush,cacti,stone) for sprite in block_list:
obstacle.rect.x -= 8 sprite.rect.x -= 8
# ++++++++++++++++++++++ screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y))
screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y)) screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
......
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