Commit c1a9b8b8 by BellCodeEditor

save project

parent b89d344d
Showing with 11 additions and 3 deletions
...@@ -33,6 +33,7 @@ jumpState = "runing" ...@@ -33,6 +33,7 @@ jumpState = "runing"
t = 30 t = 30
aa=Block(bush,cacti,stone) aa=Block(bush,cacti,stone)
block_list=pygame.sprite.Group() block_list=pygame.sprite.Group()
time=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -75,12 +76,19 @@ while True: ...@@ -75,12 +76,19 @@ while True:
screen.blit(road, (lu_x, 500)) # 路 screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wukong, (150, y)) # 悟空
aa=Block(bush,cacti,stone) time+=1
block_list.add(aa) if time>=60:
time=0
num=random.randint(0,50)
if num>20:
aa=Block(bush,cacti,stone)
block_list.add(aa)
for aaa in block_list: for aaa in block_list:
aaa.rect.x -= 8 aaa.rect.x -= 8
screen.blit(aaa.image, (aaa.rect.x, aaa.rect.y)) screen.blit(aaa.image, (aaa.rect.x, aaa.rect.y))
if aaa.rect.x <=0-aaa.rect.height:
aaa.kill()
......
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