Commit 639df8fc by BellCodeEditor

save project

parent 95c852c0
Showing with 11 additions and 4 deletions
...@@ -29,6 +29,8 @@ a=random.choice([apple,cacti,stone]) ...@@ -29,6 +29,8 @@ a=random.choice([apple,cacti,stone])
rect=a.get_rect() rect=a.get_rect()
rect.x=1000 rect.x=1000
rect.y=500-rect.height rect.y=500-rect.height
roadd=road.get_rect()
bd=background.get_rect()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -65,11 +67,16 @@ while True: ...@@ -65,11 +67,16 @@ while True:
index = 0 index = 0
# 将背景图画上去 roadd.x-=8
screen.blit(background, (0, 0)) if roadd.x<=-1000:
screen.blit(road, (0, 500)) roadd.x=0
bd.x-=2
if bd.x<=-1000:
bd.x=0
screen.blit(background, (bd.x, 0))
screen.blit(road, (roadd.x, 500))
screen.blit(wukong, (150, y)) screen.blit(wukong, (150, y))
rect.x -= 5 rect.x -= 8
if rect.x>0-rect.width: if rect.x>0-rect.width:
screen.blit(a,(rect.x,rect.y)) screen.blit(a,(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