Commit 6f169b53 by BellCodeEditor

save project

parent 7af43065
Showing with 5 additions and 6 deletions
...@@ -35,10 +35,9 @@ y = 400 ...@@ -35,10 +35,9 @@ y = 400
jumpState = "runing" jumpState = "runing"
t = 30 t = 30
aa = Block(bush,cacti,stone)
obstacle = Block(bush,cacti,stone)
Block_list = pygame.sprite.Group() Block_list = pygame.sprite.Group()
time=0 time = 0
num = 0 num = 0
while True: while True:
...@@ -84,13 +83,13 @@ while True: ...@@ -84,13 +83,13 @@ while True:
time += 1 time += 1
if time >=60: if time >= 60:
time = 0 time = 0
num = random.randint(0,50) num = random.randint(0,50)
print(num)
if num > 20: if num > 20:
aa = Block(bush,cacti,stone) aa = Block(bush,cacti,stone)
Block_list.add(obstacle) Block_list.add(aa)
for sprite in Block_list: for sprite in Block_list:
sprite.rect.x -= 8 sprite.rect.x -= 8
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