Commit 80dbdbfb by BellCodeEditor

save project

parent 0284170b
Showing with 4 additions and 13 deletions
...@@ -25,7 +25,6 @@ hero = [pygame.image.load('hero1.png'), ...@@ -25,7 +25,6 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
time=0
lu_x=0 lu_x=0
shan_x=0 shan_x=0
index = 0 index = 0
...@@ -79,18 +78,9 @@ while True: ...@@ -79,18 +78,9 @@ while True:
# 创建障碍物对象 # 创建障碍物对象
aa=Block(bush,cacti,stone) aa=Block(bush,cacti,stone)
aa.rect.x -= 8 aa.rect.x -= 8
time+=1
if time>=60:
r=random.randint(0,100) screen.blit(aa.image, (aa.rect.x, aa.rect.y))
if r>40:
aa=Block(bush,cacit,stone)
block_list.add(aa)
time=0
for prop in block_list:
prop.rect.x-=8
screen.blit(prop.image, (prop.rect.x, prop.rect.y))
if prop.rect.x<=0-prop.rect.width:
prop.kill()
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) 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