Commit 96c17470 by BellCodeEditor

save project

parent 1c6d2a50
Showing with 14 additions and 2 deletions
......@@ -32,6 +32,7 @@ y = 400
jumpState = "runing"
t = 30
aa=Block(bush,cacti,stone)
block_list=pygame.sprite.Group
while True:
for event in pygame.event.get():
......@@ -77,8 +78,18 @@ while True:
if obstacle.rect.x <= 0-aa.rect.width:
obstacle=Block(bush,cacti,stone)
obstacle.rect.x -= 8
screen.blit(obstacle.image, (obstacle.rect.x, aa.rect.y))
time+=1
if time >=60:
r=random.randint(0,100)
if r>40:
obstacle=Block(bush,cacti,stone)
block_list.add(obstacle)
time=0
for prop in block_list:
porp.rect.x-=0
screen.blit(prop.image, (prop.rect.x, prop.rect.y))
if prop.rect.x<0-prop.rect.width
prop.kill()
# 刷新画面
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