From 4c75048ef16b5d7eed099b634854b7028fc5fd24 Mon Sep 17 00:00:00 2001
From: BellCodeEditor <bellcode_dev@bell.ai>
Date: Fri, 5 Jul 2024 14:48:59 +0800
Subject: [PATCH] auto save

---
 my_game.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/my_game.py b/my_game.py
index 53f76a3..f972ef9 100644
--- a/my_game.py
+++ b/my_game.py
@@ -11,7 +11,11 @@ road = pygame.image.load('road.png')      # 路
 stone = pygame.image.load('stone.png')      # 石头
 cacti = pygame.image.load('cacti.png')      # 仙人掌
 apple = pygame.image.load('bush.png')      # 灌木丛
-hero = pygame.image.load('hero1.png')
+hero = [pygame.image.load('hero1.png'),
+        pygame.image.load('hero2.png'),
+        pygame.image.load('hero3.png'),
+        pygame.image.load('hero4.png'),
+        pygame.image.load('hero5.png')]
 index = 0 
 
 while True:
@@ -20,10 +24,14 @@ while True:
             # 接收到退出事件后退出程序
             exit()
 
+    wukong=hero[index]
+    index += 1
+    if index==5:
+        index=0
     # 将背景图画上去
     screen.blit(background, (0, 0))
     screen.blit(road, (0, 500))
-    screen.blit(hero, (150, 400))
+    screen.blit(wukong, (150, 400))
     # 刷新画面
     pygame.display.update()
     FPS.tick(60)
\ No newline at end of file
--
libgit2 0.25.0