Commit 7ef95a0d by BellCodeEditor

auto save

parent 34c24f70
Showing with 7 additions and 6 deletions
......@@ -35,8 +35,7 @@ t = 30
road_x = 0
background_x = 0
obstacle = Block(bush,stone,cacti)
block_list = pygame.sprite.Group()
while True:
for event in pygame.event.get():
......@@ -78,10 +77,11 @@ while True:
background_x = 0
screen.blit(wukong, (150, y))
if obstacle.rect.x <= 0-obstacle.rect.width:
obstacle = Block(bush,stone,cacti)
obstacle.rect.x -= 8
screen.blit(obstacle.image,(obstacle.rect.x,obstacle.rect.y))
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))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ 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