Commit 63146f06 by BellCodeEditor

save project

parent 17f8b43d
Showing with 7 additions and 1 deletions
...@@ -21,6 +21,9 @@ abc = random.choice([bush,cacti,stone]) ...@@ -21,6 +21,9 @@ abc = random.choice([bush,cacti,stone])
rect = abc.get_rect() rect = abc.get_rect()
rect.x = 1000 rect.x = 1000
rect.y = 500 - rect.height rect.y = 500 - rect.height
rect2 = road.get_rect()
rect2.x = 0
rect2.y = 500 - rect.height
index = 0 index = 0
y = 400 y = 400
mode = 0 mode = 0
...@@ -44,7 +47,7 @@ while True: ...@@ -44,7 +47,7 @@ while True:
if mode == 0: if mode == 0:
g = 20 g = 20
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (rect2.x, 500))
screen.blit(abc, (rect.x, rect.y)) screen.blit(abc, (rect.x, rect.y))
if mode == 0: if mode == 0:
i += 1 i += 1
...@@ -55,6 +58,9 @@ while True: ...@@ -55,6 +58,9 @@ while True:
rect.x = 1000 rect.x = 1000
rect.y = 500 - rect.height rect.y = 500 - rect.height
rect.x -= 10 rect.x -= 10
if rect2.x <= -1000:
rect2.x = 0
rect2.x -= 10
pygame.display.set_caption('悟空酷跑') pygame.display.set_caption('悟空酷跑')
# 刷新画面 # 刷新画面
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