move音效在方块因重力或旋转触地时也会播放,而不只是移动后

move音效名改为touch
This commit is contained in:
MrZ626
2021-11-07 01:41:29 +08:00
parent a5de06dedb
commit a45b6ad57e
11 changed files with 19 additions and 17 deletions

View File

@@ -435,7 +435,7 @@ end
function switch:press() function switch:press()
self.code() self.code()
if self.sound then if self.sound then
SFX.play('move') SFX.play('touch')
end end
end end
function WIDGET.newSwitch(D)--name,x,y[,lim][,fText][,color][,font=30][,sound=true][,disp],code[,hideF][,hide] function WIDGET.newSwitch(D)--name,x,y[,lim][,fText][,color][,font=30][,sound=true][,disp],code[,hideF][,hide]
@@ -1431,7 +1431,7 @@ function WIDGET.textinput(texts)
if W and W.type=='inputBox'then if W and W.type=='inputBox'then
if(not W.regex or texts:match(W.regex))and(not W.limit or #(WIDGET.sel.value..texts)<=W.limit)then if(not W.regex or texts:match(W.regex))and(not W.limit or #(WIDGET.sel.value..texts)<=W.limit)then
WIDGET.sel.value=WIDGET.sel.value..texts WIDGET.sel.value=WIDGET.sel.value..texts
SFX.play('move') SFX.play('touch')
else else
SFX.play('finesseError',.3) SFX.play('finesseError',.3)
end end

View File

@@ -603,6 +603,12 @@ function Player:freshBlock(mode)--string mode: push/move/fresh/newBlock
end end
end end
end end
--Play sound if touch ground
if mode=='move'and self.sound and self.curY==self.ghoY then
SFX.play('touch')
end
end end
function Player:lock() function Player:lock()
local CB=self.cur.bk local CB=self.cur.bk
@@ -2110,6 +2116,8 @@ local function update_alive(P)
if P.ghoY~=P.curY then if P.ghoY~=P.curY then
P.dropDelay=ENV.drop P.dropDelay=ENV.drop
elseif P.sound then
SFX.play('touch')
end end
else else
P.lockDelay=P.lockDelay-1 P.lockDelay=P.lockDelay-1
@@ -2437,9 +2445,6 @@ function Player:act_moveLeft(auto)
self:createMoveFX('left') self:createMoveFX('left')
self.curX=self.curX-1 self.curX=self.curX-1
self:freshBlock('move') self:freshBlock('move')
if self.sound and self.curY==self.ghoY then
SFX.play('move')
end
if not auto then if not auto then
self.moving=0 self.moving=0
end end
@@ -2466,9 +2471,6 @@ function Player:act_moveRight(auto)
self:createMoveFX('right') self:createMoveFX('right')
self.curX=self.curX+1 self.curX=self.curX+1
self:freshBlock('move') self:freshBlock('move')
if self.sound and self.curY==self.ghoY then
SFX.play('move')
end
if not auto then if not auto then
self.moving=0 self.moving=0
end end

View File

@@ -124,7 +124,7 @@ local function tapBoard(x,y,key)
SFX.play('win') SFX.play('win')
return return
end end
SFX.play('move') SFX.play('touch')
end end
end end
end end

View File

@@ -313,7 +313,7 @@ function scene.keyDown(key,isRep)
TEXT.show(arrows[key],640,360,80,'beat',3) TEXT.show(arrows[key],640,360,80,'beat',3)
move=move+1 move=move+1
if not autoPressing then if not autoPressing then
SFX.play('move') SFX.play('touch')
end end
end end
end end

View File

@@ -50,7 +50,7 @@ function scene.keyDown(key,isRep)
progress=progress+1 progress=progress+1
frameKeyCount=frameKeyCount+1 frameKeyCount=frameKeyCount+1
TEXT.show(key:upper(),rnd(320,960),rnd(100,240),90,'score',2.6) TEXT.show(key:upper(),rnd(320,960),rnd(100,240),90,'score',2.6)
SFX.play('move') SFX.play('touch')
if progress==2 then if progress==2 then
state=1 state=1
startTime=TIME() startTime=TIME()

View File

@@ -57,7 +57,7 @@ local function full(L)
end end
local function place(X,x) local function place(X,x)
board[X][x]=round board[X][x]=round
SFX.play('move') SFX.play('touch')
lastX,lastx=X,x lastX,lastx=X,x
curX,curx=nil curX,curx=nil
placeTime=TIME() placeTime=TIME()

View File

@@ -157,7 +157,7 @@ function scene.keyDown(key,isRep)
input=input..key input=input..key
inputTime=1 inputTime=1
check(tonumber(input)) check(tonumber(input))
SFX.play('move') SFX.play('touch')
end end
elseif key=="-"then elseif key=="-"then
if #input<8 then if #input<8 then

View File

@@ -211,7 +211,7 @@ function scene.update()
SFX.play('fail') SFX.play('fail')
else else
fallingTimer=fast and 4 or 5 fallingTimer=fast and 4 or 5
SFX.play('move') SFX.play('touch')
end end
end end
elseif fast and( elseif fast and(

View File

@@ -42,7 +42,7 @@ pad={x=140,y=65,page=1,
{samp={tag='ready2',func=function()playReadySFX(2)end}}, {samp={tag='ready2',func=function()playReadySFX(2)end}},
{samp={tag='ready1',func=function()playReadySFX(1)end}}, {samp={tag='ready1',func=function()playReadySFX(1)end}},
{samp={tag='start',func=function()playReadySFX(0)end}}, {samp={tag='start',func=function()playReadySFX(0)end}},
{sfx='move'},{sfx='lock'},{sfx='drop'},{sfx='fall'}, {sfx='touch'},{sfx='lock'},{sfx='drop'},{sfx='fall'},
}, },
{ {
{sfx='hold'},{sfx='prehold'}, {sfx='hold'},{sfx='prehold'},
@@ -76,7 +76,7 @@ pad={x=140,y=65,page=1,
{samp={tag='ready2',func=function()playReadySFX(2)end}}, {samp={tag='ready2',func=function()playReadySFX(2)end}},
{samp={tag='ready1',func=function()playReadySFX(1)end}}, {samp={tag='ready1',func=function()playReadySFX(1)end}},
{samp={tag='start',func=function()playReadySFX(0)end}}, {samp={tag='start',func=function()playReadySFX(0)end}},
{sfx='move'},{sfx='lock'},{sfx='drop'},{sfx='fall'}, {sfx='touch'},{sfx='lock'},{sfx='drop'},{sfx='fall'},
}, },
{ {
{sfx='hold'},{sfx='prehold'}, {sfx='hold'},{sfx='prehold'},

View File

@@ -36,7 +36,7 @@ local function _toggleMod(M,back)
SFX.play('move',.6) SFX.play('move',.6)
SFX.play('lock') SFX.play('lock')
else else
SFX.play('move') SFX.play('touch')
SFX.play('lock',.6) SFX.play('lock',.6)
end end
scene.widgetList.unranked.hide=scoreValid() scene.widgetList.unranked.hide=scoreValid()