From c7a813e8d5a2f2d4f58d57259018d60a7c53c2e5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 10 Dec 2020 11:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E5=BA=93=E6=9B=B4=E6=96=B0=E5=90=8E=E4=B8=A4=E4=B8=AA=E7=94=A8?= =?UTF-8?q?=E5=88=B0bgm=E5=BA=93=E7=9A=84=E5=9C=B0=E6=96=B9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=B7=9F=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/bgm.lua | 2 +- parts/scenes/music.lua | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index 37aca4f9..f69a3f04 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -6,7 +6,7 @@ local BGM={ function BGM.init(list) BGM.init=nil local min=math.min - local Sources={}function BGM.getList()return Sources end + local Sources={}function BGM.getList()return list end local count=#list function BGM.getCount()return count end local function fadeOut(src) diff --git a/parts/scenes/music.lua b/parts/scenes/music.lua index dacc8048..5602be32 100644 --- a/parts/scenes/music.lua +++ b/parts/scenes/music.lua @@ -5,10 +5,11 @@ local sin=math.sin local scene={} +local bgmList=BGM.getList() function scene.sceneInit() if BGM.nowPlay then for i=1,BGM.getCount()do - if BGM.list[i]==BGM.nowPlay then + if bgmList[i]==BGM.nowPlay then sceneTemp=i--Music selected return end @@ -34,8 +35,8 @@ function scene.keyDown(key) SFX.play("move",.7) end elseif key=="return"or key=="space"then - if BGM.nowPlay~=BGM.list[S]then - BGM.play(BGM.list[S]) + if BGM.nowPlay~=bgmList[S]then + BGM.play(bgmList[S]) if SETTING.bgm>0 then SFX.play("click")end else BGM.stop() @@ -49,13 +50,13 @@ function scene.draw() gc.setColor(1,1,1) setFont(50) - gc.print(BGM.list[sceneTemp],320,355) + gc.print(bgmList[sceneTemp],320,355) setFont(35) - if sceneTemp>1 then gc.print(BGM.list[sceneTemp-1],320,350-30)end - if sceneTemp1 then gc.print(bgmList[sceneTemp-1],320,350-30)end + if sceneTemp2 then gc.print(BGM.list[sceneTemp-2],320,350-50)end - if sceneTemp2 then gc.print(bgmList[sceneTemp-2],320,350-50)end + if sceneTemp