添加危险警告音效,整理代码
This commit is contained in:
2
main.lua
2
main.lua
@@ -271,7 +271,7 @@ do
|
|||||||
--Check setting file
|
--Check setting file
|
||||||
if
|
if
|
||||||
type(SETTING.block)~="boolean"or
|
type(SETTING.block)~="boolean"or
|
||||||
type(SETTING.spawn)~="number"or
|
type(SETTING.sfx_spawn)~="number"or
|
||||||
type(SETTING.ghost)~="number"or
|
type(SETTING.ghost)~="number"or
|
||||||
type(SETTING.center)~="number"or
|
type(SETTING.center)~="number"or
|
||||||
type(SETTING.grid)~="number"or
|
type(SETTING.grid)~="number"or
|
||||||
|
|||||||
BIN
media/SFX/warning.ogg
Normal file
BIN
media/SFX/warning.ogg
Normal file
Binary file not shown.
@@ -295,7 +295,8 @@ SETTING={--Settings
|
|||||||
|
|
||||||
--Sound
|
--Sound
|
||||||
sfx=1,
|
sfx=1,
|
||||||
spawn=.3,
|
sfx_spawn=.3,
|
||||||
|
sfx_warn=.3,
|
||||||
bgm=.7,
|
bgm=.7,
|
||||||
stereo=.7,
|
stereo=.7,
|
||||||
vib=0,
|
vib=0,
|
||||||
|
|||||||
@@ -311,9 +311,10 @@ return{
|
|||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Stereo",
|
|
||||||
spawn="Spawning",
|
spawn="Spawning",
|
||||||
|
warn="Warning",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
|
stereo="Stereo",
|
||||||
vib="Vibration",
|
vib="Vibration",
|
||||||
voc="Voice",
|
voc="Voice",
|
||||||
cv="Voice Pack",
|
cv="Voice Pack",
|
||||||
|
|||||||
@@ -291,9 +291,10 @@ return{
|
|||||||
graphic="Vidéo→",
|
graphic="Vidéo→",
|
||||||
|
|
||||||
sfx="Sons",
|
sfx="Sons",
|
||||||
stereo="Stéréo",
|
|
||||||
spawn="Apparition",
|
spawn="Apparition",
|
||||||
|
warn="Alerte de danger",
|
||||||
bgm="Musique",
|
bgm="Musique",
|
||||||
|
stereo="Stéréo",
|
||||||
vib="Vibration",
|
vib="Vibration",
|
||||||
voc="Voix",
|
voc="Voix",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -310,9 +310,10 @@ return{
|
|||||||
graphic="Vídeo→",
|
graphic="Vídeo→",
|
||||||
|
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Stereo",
|
|
||||||
spawn="Nascida",
|
spawn="Nascida",
|
||||||
|
warn="Alerta de perigo",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
|
stereo="Stereo",
|
||||||
vib="Vibração",
|
vib="Vibração",
|
||||||
voc="Voz",
|
voc="Voz",
|
||||||
cv="Pacote de voz",
|
cv="Pacote de voz",
|
||||||
|
|||||||
@@ -291,9 +291,10 @@ return{
|
|||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
sfx="SFX",
|
sfx="SFX",
|
||||||
stereo="Estéreo",
|
|
||||||
spawn="Spawn de Pzas.",
|
spawn="Spawn de Pzas.",
|
||||||
|
warn="Alerta de Peligro",
|
||||||
bgm="BGM",
|
bgm="BGM",
|
||||||
|
stereo="Estéreo",
|
||||||
vib="Vibración",
|
vib="Vibración",
|
||||||
voc="Voces",
|
voc="Voces",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,9 +183,10 @@ return{
|
|||||||
graphic="Video→",
|
graphic="Video→",
|
||||||
|
|
||||||
sfx="#!#",
|
sfx="#!#",
|
||||||
stereo="←~→",
|
|
||||||
spawn="#[]#",
|
spawn="#[]#",
|
||||||
|
warn="!↑↑↑!",
|
||||||
bgm="#~#",
|
bgm="#~#",
|
||||||
|
stereo="←~→",
|
||||||
vib="=~=",
|
vib="=~=",
|
||||||
voc="~~~",
|
voc="~~~",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ return{
|
|||||||
graphic="改画面→",
|
graphic="改画面→",
|
||||||
|
|
||||||
spawn="出块",
|
spawn="出块",
|
||||||
|
warn="警告",
|
||||||
bgm="曲",
|
bgm="曲",
|
||||||
vib="嗡嗡",
|
vib="嗡嗡",
|
||||||
cv="谁",
|
cv="谁",
|
||||||
|
|||||||
@@ -312,9 +312,10 @@ return{
|
|||||||
graphic="画面设置→",
|
graphic="画面设置→",
|
||||||
|
|
||||||
sfx="音效",
|
sfx="音效",
|
||||||
stereo="立体声",
|
|
||||||
spawn="方块生成",
|
spawn="方块生成",
|
||||||
|
warn="危险警告",
|
||||||
bgm="音乐",
|
bgm="音乐",
|
||||||
|
stereo="立体声",
|
||||||
vib="振动",
|
vib="振动",
|
||||||
voc="语音",
|
voc="语音",
|
||||||
cv="语音包",
|
cv="语音包",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ return{
|
|||||||
pauseLimit=true,
|
pauseLimit=true,
|
||||||
load=function()
|
load=function()
|
||||||
PLY.newPlayer(1)
|
PLY.newPlayer(1)
|
||||||
if SETTING.spawn==0 then
|
if SETTING.sfx_spawn==0 then
|
||||||
LOG.print(text.switchSpawnSFX,COLOR.yellow)
|
LOG.print(text.switchSpawnSFX,COLOR.yellow)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ function Player.resetBlock(P)
|
|||||||
|
|
||||||
--Spawn SFX
|
--Spawn SFX
|
||||||
if P.sound and id<8 then
|
if P.sound and id<8 then
|
||||||
SFX.fplay(spawnSFX_name[id],SETTING.spawn)
|
SFX.fplay(spawnSFX_name[id],SETTING.sfx_spawn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1651,7 +1651,6 @@ function Player.lose(P,force)
|
|||||||
SYSFX.newShade(1.4,P.fieldX,P.fieldY,300*P.size,610*P.size)
|
SYSFX.newShade(1.4,P.fieldX,P.fieldY,300*P.size,610*P.size)
|
||||||
SYSFX.newRectRipple(2,P.fieldX,P.fieldY,300*P.size,610*P.size)
|
SYSFX.newRectRipple(2,P.fieldX,P.fieldY,300*P.size,610*P.size)
|
||||||
SYSFX.newRipple(2,P.x+(475+25*(P.life<3 and P.life or 0)+12)*P.size,P.y+(665+12)*P.size,20)
|
SYSFX.newRipple(2,P.x+(475+25*(P.life<3 and P.life or 0)+12)*P.size,P.y+(665+12)*P.size,20)
|
||||||
--300+25*i,595
|
|
||||||
SFX.play("clear_3")
|
SFX.play("clear_3")
|
||||||
SFX.play("emit")
|
SFX.play("emit")
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
local int,max,min,abs=math.floor,math.max,math.min,math.abs
|
local int,max,min,abs=math.floor,math.max,math.min,math.abs
|
||||||
local rem=table.remove
|
local rem=table.remove
|
||||||
local resume=coroutine.resume
|
|
||||||
local status=coroutine.status
|
|
||||||
local assert=assert
|
|
||||||
|
|
||||||
local function updateLine(P)--Attacks, line pushing, cam moving
|
local function updateLine(P)--Attacks, line pushing, cam moving
|
||||||
local bf=P.atkBuffer
|
local bf=P.atkBuffer
|
||||||
@@ -95,13 +92,18 @@ local function updateFXs(P,dt)
|
|||||||
TEXT.update(P.bonus)
|
TEXT.update(P.bonus)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function updateTasks(P)
|
local updateTasks do--updateTasks(P)
|
||||||
local L=P.tasks
|
local resume=coroutine.resume
|
||||||
for i=#L,1,-1 do
|
local status=coroutine.status
|
||||||
local tr=L[i].thread
|
local assert=assert
|
||||||
assert(resume(tr))
|
function updateTasks(P)
|
||||||
if status(tr)=="dead"then
|
local L=P.tasks
|
||||||
rem(L,i)
|
for i=#L,1,-1 do
|
||||||
|
local tr=L[i].thread
|
||||||
|
assert(resume(tr))
|
||||||
|
if status(tr)=="dead"then
|
||||||
|
rem(L,i)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ function scene.update(dt)
|
|||||||
elseif GAME.warnLVL>0 then
|
elseif GAME.warnLVL>0 then
|
||||||
GAME.warnLVL=max(GAME.warnLVL-.026,0)
|
GAME.warnLVL=max(GAME.warnLVL-.026,0)
|
||||||
end
|
end
|
||||||
|
if GAME.warnLVL>1.126 and GAME.frame%30==0 then
|
||||||
|
SFX.fplay("warning",SETTING.sfx_warn)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drawAtkPointer(x,y)
|
local function drawAtkPointer(x,y)
|
||||||
|
|||||||
@@ -62,9 +62,10 @@ scene.widgetList={
|
|||||||
WIDGET.newButton{name="graphic",x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_video","swipeL"},
|
WIDGET.newButton{name="graphic",x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_video","swipeL"},
|
||||||
|
|
||||||
WIDGET.newSlider{name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=lnk_SETval("sfx"),code=lnk_SETsto("sfx")},
|
WIDGET.newSlider{name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=lnk_SETval("sfx"),code=lnk_SETsto("sfx")},
|
||||||
WIDGET.newSlider{name="stereo", x=180, y=500,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=lnk_SETval("stereo"),code=lnk_SETsto("stereo"),hide=function()return SETTING.sx==0 end},
|
WIDGET.newSlider{name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..math.random(7),SETTING.sfx_spawn)end,disp=lnk_SETval("sfx_spawn"),code=lnk_SETsto("sfx_spawn")},
|
||||||
WIDGET.newSlider{name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..math.random(7),SETTING.spawn)end,disp=lnk_SETval("spawn"),code=lnk_SETsto("spawn")},
|
WIDGET.newSlider{name="warn", x=180, y=400,w=400, font=30,change=function()SFX.fplay("warning",SETTING.sfx_warn)end,disp=lnk_SETval("sfx_warn"),code=lnk_SETsto("sfx_warn")},
|
||||||
WIDGET.newSlider{name="bgm", x=180, y=400,w=400, font=35, disp=lnk_SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
|
WIDGET.newSlider{name="bgm", x=180, y=500,w=400, font=35, disp=lnk_SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
|
||||||
|
WIDGET.newSlider{name="stereo", x=180, y=600,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=lnk_SETval("stereo"),code=lnk_SETsto("stereo"),hide=function()return SETTING.sx==0 end},
|
||||||
WIDGET.newSlider{name="vib", x=750, y=200,w=400,unit=5, font=25,change=function()VIB(2)end, disp=lnk_SETval("vib"),code=lnk_SETsto("vib")},
|
WIDGET.newSlider{name="vib", x=750, y=200,w=400,unit=5, font=25,change=function()VIB(2)end, disp=lnk_SETval("vib"),code=lnk_SETsto("vib")},
|
||||||
WIDGET.newSlider{name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=lnk_SETval("voc"),code=lnk_SETsto("voc")},
|
WIDGET.newSlider{name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=lnk_SETval("voc"),code=lnk_SETsto("voc")},
|
||||||
WIDGET.newSelector{name="cv", x=1100, y=380,w=200, list={"miya","naki"}, disp=function()return cv end,code=function(i)cv=i end},
|
WIDGET.newSelector{name="cv", x=1100, y=380,w=200, list={"miya","naki"}, disp=function()return cv end,code=function(i)cv=i end},
|
||||||
|
|||||||
Reference in New Issue
Block a user