From 805704f0e5a81f5244e98873446771448f3ee8c9 Mon Sep 17 00:00:00 2001 From: chicrobot Date: Mon, 27 Jul 2026 22:49:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9F=B3=E9=A2=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=96=87=E4=BB=B6=E5=88=B0data=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E5=A4=8D=E7=94=A8data=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vespidaze-upbeat-rpg-battle-460971.mp3 | Bin page/page.py | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) rename {file => data}/vespidaze-upbeat-rpg-battle-460971.mp3 (100%) diff --git a/file/vespidaze-upbeat-rpg-battle-460971.mp3 b/data/vespidaze-upbeat-rpg-battle-460971.mp3 similarity index 100% rename from file/vespidaze-upbeat-rpg-battle-460971.mp3 rename to data/vespidaze-upbeat-rpg-battle-460971.mp3 diff --git a/page/page.py b/page/page.py index 2087f5c..c6ccdfa 100644 --- a/page/page.py +++ b/page/page.py @@ -6,7 +6,10 @@ # Datetime: 2026/7/25 下午10:44 # Description: # --------------------------------------------------------------------------- +import os + import pygame +from src.config.game_config import data_path # 初始化pygame pygame.init() @@ -22,7 +25,8 @@ screen = pygame.display.set_mode(size) pygame.display.set_caption("New_game") # 播放并循环音乐 -pygame.mixer_music.load(r'D:\python_project\Game_project\file\vespidaze-upbeat-rpg-battle-460971.mp3') +data_path = data_path() +pygame.mixer_music.load(os.path.join(data_path, "vespidaze-upbeat-rpg-battle-460971.mp3")) pygame.mixer_music.play(-1) # 状态值