Commit 7effdb59 by BellCodeEditor

save project

parent 6f27c7f6
Showing with 25 additions and 6 deletions
......@@ -32,7 +32,9 @@ y = 400
jumpState = "runing"
t = 30
aa=Block(bush,cacti,stone)
Block_list=pygame.sprite.Group()
time=0
b=0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -63,9 +65,10 @@ while True:
index += 1
if index >= 5:
index = 0
if aa.rect.x<=0-aa.rect.width:
aa=Block(bush,cacti,stone)
aa.rect.x-=8
#if aa.rect.x<=0-aa.rect.width:
#aa=Block(bush,cacti,stone)
#aa.rect.x-=8
......@@ -77,15 +80,30 @@ while True:
lu_x-=8
if lu_x<=-1000:
lu_x=0
time+=1
if time>=50:
time=0
b=random.randint(0,40)
if b>20:
aa=Block(bush,cacti,stone)
Block_list.add(aa)
screen.blit(background, (shan_x,0))
screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
for c in Block_list:
c.rect.x-=8
screen.blit(c.image, (c.rect.x, c.rect.y))
if c.rect.x<=0-c.rect.width:
c.kill()
screen.blit(aa.image, (aa.rect.x, aa.rect.y))
# 刷新画面
pygame.display.update()
FPS.tick(50)
\ 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