Commit adbeb8a3 by BellCodeEditor

auto save

parent 600071b5
Showing with 6 additions and 13 deletions
...@@ -13,17 +13,17 @@ background = pygame.image.load('bg.png') # 背景 ...@@ -13,17 +13,17 @@ background = pygame.image.load('bg.png') # 背景
road = pygame.image.load('road.png') # 路 road = pygame.image.load('road.png') # 路
#stone = pygame.image.load('stone.png') # 石头 #stone = pygame.image.load('stone.png') # 石头
cacti = pygame.image.load('cacti.png') # 仙人掌 cacti = pygame.image.load('cacti.png') # 仙人掌
bush = pygame.image.load('bush.png') # 灌木丛 apple = pygame.image.load('bush.png') # 灌木丛
hero1 = pygame.image.load('hero1.png') hero1 = pygame.image.load('hero1.png')
hero2 = pygame.image.load('hero2.png') hero2 = pygame.image.load('hero2.png')
hero3 = pygame.image.load('hero3.png') hero3 = pygame.image.load('hero3.png')
hero4 = pygame.image.load('hero4.png') hero4 = pygame.image.load('hero4.png')
hero5 = pygame.image.load('hero5.png') hero5 = pygame.image.load('hero5.png')
run = [hero1,hero2,hero3,hero4,hero5] run = [hero1,hero2,hero3,hero4,hero5]
zhangai = [cacti,bush]
zhangaiwu =
index = 0 index = 0
zhangai = random.choice([bush,cacti])
rect = zhangai.get_rect()
rect.x = 1000
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:
...@@ -56,13 +56,6 @@ while True: ...@@ -56,13 +56,6 @@ while True:
index += 1 index += 1
if index >= 5: if index >= 5:
index = 0 index = 0
print(rect.x)
if rect.x < 0-rect.width:
zhangai = random.choice([bush,cacti])
rect = zhangai.get_rect()
rect.x = 1000
rect.x -= 8
screen.blit(zhangai,(rect.x,500-rect.height))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(26) FPS.tick(28)
\ No newline at end of file \ 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