Commit a998d260 by BellCodeEditor

auto save

parent 1021d29d
Showing with 7 additions and 2 deletions
...@@ -25,6 +25,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -25,6 +25,7 @@ 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')]
block_list = []
lu_x=0 lu_x=0
shan_x=0 shan_x=0
index = 0 index = 0
...@@ -85,9 +86,12 @@ while True: ...@@ -85,9 +86,12 @@ while True:
# 创建障碍物对象 # 创建障碍物对象
obstacle=Block(bush,cacti,stone) obstacle=Block(bush,cacti,stone)
obstacle.rect.x -= 8 obstacle.rect.x -= 8
screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y)) screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y))
# 刷新画面 # 刷新画面
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