Commit 0b64bc00 by BellCodeEditor

save project

parent e8a372eb
Showing with 6 additions and 0 deletions
...@@ -35,6 +35,7 @@ rode_x=0 ...@@ -35,6 +35,7 @@ rode_x=0
bg_x=0 bg_x=0
obstacle = Block(bush,cacti,stone) obstacle = Block(bush,cacti,stone)
block_list=pygame.sprite.Group()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -81,6 +82,11 @@ while True: ...@@ -81,6 +82,11 @@ while True:
if obstacle.rect.x<=0-obstacle.rect.with: if obstacle.rect.x<=0-obstacle.rect.with:
obstacle =Block(bush,cacti,stone) obstacle =Block(bush,cacti,stone)
obstacle.rect.x-=8 obstacle.rect.x-=8
time+=1
if time>=60:
r=random.randint(0,100)
if r>40:
obstacle
screen.blit(obstacle, (rect.x, rect.y)) screen.blit(obstacle, (rect.x, 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