Commit 24c6a984 by BellCodeEditor

save project

parent 2f508534
Showing with 14 additions and 1 deletions
......@@ -31,7 +31,7 @@ index = 0
y = 400
jumpState = "runing"
t = 30
aa=Block(bush,cacti,stone)
block_list =pygame.sprite.Group()
......@@ -79,8 +79,21 @@ while True:
if obstacle.rect.x <=obstacle 0-.rect.width: # 障碍物消失
# 创建障碍物对象
obstacle=Block(bush,cacti,stone)
obstacle.rect.x -= 8
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:
prop.rect.x -=8
screen.blit(prop.image,(prop.rest.x, prop.rect.y))
if prop.rest.x <=0-prop.rect.width
screen.blit(aa.image, (obstacle.rect.x, obstacle.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