Commit 86821dcf by BellCodeEditor

save project

parent a369c8c0
Showing with 8 additions and 2 deletions
......@@ -32,6 +32,7 @@ jumpState = "runing"
t = 30
road_x = 0
bg_x = 0
time =0
obstacle = Block(bush,stone,cacti)
block_list = pygame.sprite.Group()
......@@ -77,8 +78,13 @@ while True:
screen.blit(road, (road_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
obstacle = Block(bush,cacti,stone)
block_list.add(obstacle)
time+=1
if time >60:
time = 0
num = random.randint(0,50)
if num>20:
obstacle = Block(bush,cacti,stone)
block_list.add(obstacle)
for sprite in block_list:
sprite.rect.x -=8
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