Commit 2503ba61 by BellCodeEditor

save project

parent fb68ac66
Showing with 12 additions and 11 deletions
......@@ -31,9 +31,8 @@ index = 0
y = 400
jumpState = "runing"
t = 60
aa=Block(bush,cacti,stone)
time=0
bl=pyagme.sprite.Group()
bl=pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -69,7 +68,7 @@ while True:
if shan_x <-1000:
shan_x=0
screen.blit(background, (shan_x, 0)) # 远处背景
lu_x -=23
lu_x -=1
if lu_x <-1000:
lu_x=0
screen.blit(road, (lu_x, 500)) # 路
......@@ -79,14 +78,16 @@ while True:
time=0
num=random.randint(0,50)
if num>20:
if aa.rect.x <= 0-aa.rect.width: # 障碍物消失
# 创建障碍物对象
aa=Block(bush,cacti,stone)
aa.rect.x -= 23
aa=Block(bush,cacti,stone)
bl.add(aa)
for i in bl:
i.rect.x -=8
screen.blit(aa.image, (i.rect.x, i.rect.y))
if i.rect.x <= 0-i.rect.width:
i.kill()
screen.blit(aa.image, (aa.rect.x, aa.rect.y))
# 刷新画面
pygame.display.update()
FPS.tick(128)
\ No newline at end of file
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