Commit a16c35ee by BellCodeEditor

save project

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