Commit 3aec7eb3 by BellCodeEditor

save project

parent c09afce4
Showing with 10 additions and 8 deletions
......@@ -34,7 +34,7 @@ t = 30
bg_x=0
road_x=0
time=0
block_list=pygame.sprite.Groap()
block_list=pygame.sprite.Group()
while True:
for event in pygame.event.get():
......@@ -81,13 +81,14 @@ while True:
time+=1
if time>=60:
r=random.randint(0,100)
if r>40:
if r > 40:
obstacle=Block(bush,cacti,stone)
time=0
for prop in block_list:
prop.rect.x-=8
screen.blit(prop.image, (prop.rect.x, prop.rect.y))
if prop.rect.x-=0-prop.rect.width:
prop.kill()
block_list.add(obstacle)
time=0
for prop in block_list:
prop.rect.x -= 8
screen.blit(prop.image, (prop.rect.x, prop.rect.y))
if prop.rect.x <= 0-prop.rect.width:
prop.kill()
# 刷新画面
pygame.display.update()
\ 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