Commit a4233059 by BellCodeEditor

save project

parent 91e3e509
Showing with 6 additions and 5 deletions
...@@ -86,14 +86,15 @@ while True: ...@@ -86,14 +86,15 @@ while True:
time+=1 time+=1
if time >=60: if time >=60:
num=random.randint(0,50) num=random.randint(0,50)
if num >=20: if num >20:
aa=Block(bush,cacti,stone) aa=Block(bush,cacti,stone)
block_list.add(aa) block_list.add(aa)
time=0 time=0
for sprite in block_list: for sprite in block_list:
screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y)) sprite.rect.x -= 8
if sprite.rect.x<=0-sprite.rect.width: screen.blit(sprite.image,(sprite.rect.x,sprite.rect.y))
sprite.kill() if sprite.rect.x<=0-sprite.rect.width:
sprite.kill()
#screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y)) #screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y))
# 刷新画面 # 刷新画面
......
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