Commit 84ad54dc by BellCodeEditor

save project

parent 080ee70a
Showing with 6 additions and 1 deletions
......@@ -26,7 +26,7 @@ obstacle = random.choice([bush, stone, cacti])
rect = obstacle.get_rect()
rect.x = 1000
rect.y = 500 - rect.height
roadx=0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -70,6 +70,10 @@ while True:
rect.y = 500 - rect.height
rect.x -= 8
screen.blit(obstacle, (rect.x, rect.y))
roadx-=8
if roadx<=-1000:
roadx=0
screen.blit(road,(roadx,500))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
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