Commit e9d3a2b6 by BellCodeEditor

save project

parent d5e7eece
Showing with 2 additions and 4 deletions
...@@ -77,11 +77,9 @@ while True: ...@@ -77,11 +77,9 @@ while True:
if rect.x <= 0-rect.width: # 障碍物消失 if rect.x <= 0-rect.width: # 障碍物消失
# 创建障碍物对象 # 创建障碍物对象
rect = obstacle.get_rect()
rect.x = 1000
rect.y = 500 - rect.height
obstacle = random.choice([bush,stone,cacti]) obstacle = random.choice([bush,stone,cacti])
rect.x -= 8 obstacle.rect.x -= 8
screen.blit(obstacle, (rect.x, rect.y)) screen.blit(obstacle, (rect.x, rect.y))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
......
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