调整场地晃动强度
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
local Player={}--Player class
|
local Player={}--Player class
|
||||||
|
|
||||||
local int,ceil,rnd=math.floor,math.ceil,math.random
|
local int,ceil,rnd=math.floor,math.ceil,math.random
|
||||||
local max,min,modf=math.max,math.min,math.modf
|
local max,min,abs,modf=math.max,math.min,math.abs,math.modf
|
||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
local resume,yield=coroutine.resume,coroutine.yield
|
local resume,yield=coroutine.resume,coroutine.yield
|
||||||
|
|
||||||
@@ -462,7 +462,6 @@ function Player.freshBlock(P,mode)--string mode: push/move/fresh/newBlock
|
|||||||
end
|
end
|
||||||
if ENV.shakeFX then
|
if ENV.shakeFX then
|
||||||
P.fieldOff.vy=ENV.shakeFX*.5
|
P.fieldOff.vy=ENV.shakeFX*.5
|
||||||
P.fieldOff.va=P:getCenterX()*P.gameEnv.shakeFX*5e-4
|
|
||||||
end
|
end
|
||||||
P.curY=P.ghoY
|
P.curY=P.ghoY
|
||||||
end
|
end
|
||||||
@@ -609,7 +608,20 @@ function Player.spin(P,d,ifpre)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if P.sound then
|
if P.sound then
|
||||||
SFX.play(ifpre and"prerotate"or P:ifoverlap(P.cur.bk,P.curX,P.curY+1)and P:ifoverlap(P.cur.bk,P.curX-1,P.curY)and P:ifoverlap(P.cur.bk,P.curX+1,P.curY)and"rotatekick"or"rotate",nil,P:getCenterX()*.15)
|
local sfx
|
||||||
|
if ifpre then
|
||||||
|
sfx="prerotate"
|
||||||
|
elseif P:ifoverlap(icb,ix,iy+1)and P:ifoverlap(icb,ix-1,iy)and P:ifoverlap(icb,ix+1,iy)then
|
||||||
|
sfx="rotatekick"
|
||||||
|
if abs(d)==1 then
|
||||||
|
P.fieldOff.va=P.fieldOff.va+d*P.gameEnv.shakeFX*6e-3
|
||||||
|
else
|
||||||
|
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*3e-3
|
||||||
|
end
|
||||||
|
else
|
||||||
|
sfx="rotate"
|
||||||
|
end
|
||||||
|
SFX.play(sfx,nil,P:getCenterX()*.15)
|
||||||
end
|
end
|
||||||
P.stat.rotate=P.stat.rotate+1
|
P.stat.rotate=P.stat.rotate+1
|
||||||
return
|
return
|
||||||
@@ -1877,7 +1889,7 @@ end
|
|||||||
function Player.act_rotLeft(P)
|
function Player.act_rotLeft(P)
|
||||||
if P.control and P.waiting==-1 and P.cur then
|
if P.control and P.waiting==-1 and P.cur then
|
||||||
P.ctrlCount=P.ctrlCount+1
|
P.ctrlCount=P.ctrlCount+1
|
||||||
P:spin(3)
|
P:spin(-1)
|
||||||
P.keyPressing[4]=false
|
P.keyPressing[4]=false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1902,15 +1914,15 @@ function Player.act_hardDrop(P)
|
|||||||
end
|
end
|
||||||
P.curY=P.ghoY
|
P.curY=P.ghoY
|
||||||
P.spinLast=false
|
P.spinLast=false
|
||||||
if P.gameEnv.shakeFX then
|
|
||||||
P.fieldOff.vy=P.gameEnv.shakeFX*.6
|
|
||||||
P.fieldOff.va=P:getCenterX()*P.gameEnv.shakeFX*6e-4
|
|
||||||
end
|
|
||||||
if P.sound then
|
if P.sound then
|
||||||
SFX.play("drop",nil,P:getCenterX()*.15)
|
SFX.play("drop",nil,P:getCenterX()*.15)
|
||||||
VIB(1)
|
VIB(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if P.gameEnv.shakeFX then
|
||||||
|
P.fieldOff.vy=P.gameEnv.shakeFX*.6
|
||||||
|
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*6e-4
|
||||||
|
end
|
||||||
P.lockDelay=-1
|
P.lockDelay=-1
|
||||||
P:drop()
|
P:drop()
|
||||||
P.keyPressing[6]=false
|
P.keyPressing[6]=false
|
||||||
@@ -2012,7 +2024,7 @@ function Player.act_insDown(P)
|
|||||||
end
|
end
|
||||||
if ENV.shakeFX then
|
if ENV.shakeFX then
|
||||||
P.fieldOff.vy=ENV.shakeFX*.5
|
P.fieldOff.vy=ENV.shakeFX*.5
|
||||||
P.fieldOff.va=P:getCenterX()*P.gameEnv.shakeFX*5e-4
|
-- P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*5e-4
|
||||||
end
|
end
|
||||||
P.curY=P.ghoY
|
P.curY=P.ghoY
|
||||||
P.lockDelay=ENV.lock
|
P.lockDelay=ENV.lock
|
||||||
|
|||||||
@@ -85,15 +85,13 @@ local function updateFXs(P,dt)
|
|||||||
--Field shaking
|
--Field shaking
|
||||||
if P.gameEnv.shakeFX then
|
if P.gameEnv.shakeFX then
|
||||||
local O=P.fieldOff
|
local O=P.fieldOff
|
||||||
O.vx=O.vx*.8-abs(O.x)^1.2*(O.x>0 and .1 or -.1)
|
O.vx=O.vx*.8-abs(O.x)^1.3*(O.x>0 and .1 or -.1)
|
||||||
O.x=O.x+O.vx
|
O.x=O.x+O.vx
|
||||||
if abs(O.x)<.3 then O.x,O.vx=0,0 end
|
|
||||||
|
|
||||||
O.vy=O.vy*.8-abs(O.y)^1.2*(O.y>0 and .1 or -.1)
|
O.vy=O.vy*.8-abs(O.y)^1.2*(O.y>0 and .1 or -.1)
|
||||||
O.y=O.y+O.vy
|
O.y=O.y+O.vy
|
||||||
if abs(O.y)<.3 then O.y,O.vy=0,0 end
|
|
||||||
|
|
||||||
O.va=O.va*.8-abs(O.a)^1.2*(O.a>0 and .1 or -.1)
|
O.va=O.va*.8-abs(O.a)^1.4*(O.a>0 and .08 or -.08)
|
||||||
O.a=O.a+O.va
|
O.a=O.a+O.va
|
||||||
-- if abs(O.a)<.3 then O.a,O.va=0,0 end
|
-- if abs(O.a)<.3 then O.a,O.va=0,0 end
|
||||||
end
|
end
|
||||||
@@ -255,7 +253,7 @@ function update.alive(P,dt)
|
|||||||
end
|
end
|
||||||
if ENV.shakeFX then
|
if ENV.shakeFX then
|
||||||
P.fieldOff.vy=ENV.shakeFX*.2
|
P.fieldOff.vy=ENV.shakeFX*.2
|
||||||
P.fieldOff.va=P:getCenterX()*P.gameEnv.shakeFX*2e-4
|
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*4e-5
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user