Commit bdc8cf12 by BellCodeEditor

save project

parent ec2ffa0b
Showing with 9 additions and 12 deletions
......@@ -81,23 +81,20 @@ while True:
screen.blit(road, (road_x, 500))
screen.blit(wukong, (150, y)) # 悟空
time+=1
if time>=60
time+=1
if time>=60:
r=random.randint(0,50)
if >40
if r >40:
obstacle =Block(stone,cacti,bush)
block_list.add(obstacle)
time(0)
time=0
# ++++++++++++++++++++++
for sprite in block_list:
sprite.rect_x-=8
screen.blit(sprite.imapge(sprite.rect_x,sprite,rect_y))
if obstacle.rect.x <= 0-obstacle.rect.width:
for sprite in block_list:
sprite.rect.x-=8
screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y))
if sprite.rect.x <= 0-sprite.rect.width:
sprite.kill()
if obstacle.rect.x <= 0-obstacle.rect.width:
obstacle = Block(bush,cacti,stone)
obstacle.rect.x -= 8
# ++++++++++++++++++++++
# ++++++++++++++++++++++
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