Commit 746b7a4b by BellCodeEditor

save project

parent 8b9dc27e
Showing with 2 additions and 2 deletions
...@@ -51,7 +51,7 @@ bg_x = 0 ...@@ -51,7 +51,7 @@ bg_x = 0
road_x = 0 road_x = 0
a=True a=True
score=0 score=0
spen=8
block_list=pygame.sprite.Group() block_list=pygame.sprite.Group()
# 创建障碍物 # 创建障碍物
#obstacle = Block(bush,cacti,stone) #obstacle = Block(bush,cacti,stone)
...@@ -107,7 +107,7 @@ while True: ...@@ -107,7 +107,7 @@ while True:
obstacle=Block(bush,cacti,stone) obstacle=Block(bush,cacti,stone)
block_list.add(obstacle) block_list.add(obstacle)
for sprite in block_list: for sprite in block_list:
sprite.rect.x -=8 sprite.rect.x -=spen
screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y) screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y)
if sprite.rect.x <= 0-sprite.rect.width: if sprite.rect.x <= 0-sprite.rect.width:
sprite.kill() sprite.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