新增方块溅射特效

This commit is contained in:
MrZ626
2020-11-25 14:25:38 +08:00
parent 373fc31408
commit ac76984052
12 changed files with 64 additions and 32 deletions

View File

@@ -1,10 +1,17 @@
local gc=love.graphics local gc=love.graphics
local setColor,setWidth=gc.setColor,gc.setLineWidth local setColor,setWidth=gc.setColor,gc.setLineWidth
local max,min=math.max,math.min local max,min=math.max,math.min
local sin,cos=math.sin,math.cos
local rnd=math.random
local rem=table.remove local rem=table.remove
local fx={} local fx={}
local function normUpdate(S,dt)
S.t=S.t+dt*S.rate
return S.t>1
end
local FXupdate={} local FXupdate={}
function FXupdate.badge(S,dt) function FXupdate.badge(S,dt)
S.t=S.t+dt S.t=S.t+dt
@@ -19,22 +26,16 @@ function FXupdate.badge(S,dt)
end end
return S.t>=1 return S.t>=1
end end
function FXupdate.attack(S,dt) FXupdate.attack=normUpdate
FXupdate.ripple=normUpdate
FXupdate.rectRipple=normUpdate
FXupdate.shade=normUpdate
function FXupdate.cell(S,dt)
S.x=S.x+S.vx
S.y=S.y+S.vy
S.t=S.t+dt*S.rate S.t=S.t+dt*S.rate
return S.t>1 return S.t>1
end end
function FXupdate.ripple(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
function FXupdate.rectRipple(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
function FXupdate.shade(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
local FXdraw={} local FXdraw={}
function FXdraw.badge(S) function FXdraw.badge(S)
@@ -78,6 +79,10 @@ function FXdraw.shade(S)
setColor(S.r,S.g,S.b,1-S.t) setColor(S.r,S.g,S.b,1-S.t)
gc.rectangle("fill",S.x,S.y,S.w,S.h,2) gc.rectangle("fill",S.x,S.y,S.w,S.h,2)
end end
function FXdraw.cell(S,dt)
setColor(1,1,1,1-S.t)
gc.draw(S.image,S.x,S.y,nil,S.size)
end
local SYSFX={} local SYSFX={}
function SYSFX.update(dt) function SYSFX.update(dt)
@@ -143,4 +148,15 @@ function SYSFX.newShade(rate,r,g,b,x,y,w,h)
x=x,y=y,w=w,h=h, x=x,y=y,w=w,h=h,
} }
end end
function SYSFX.newCell(rate,image,x,y,size)
local v,a=1+rnd(),rnd()*6.28
fx[#fx+1]={
update=FXupdate.cell,
draw=FXdraw.cell,
t=0,
rate=rate,image=image,
x=x,y=y,size=size,
vx=v*cos(a),vy=v*sin(a),
}
end
return SYSFX return SYSFX

View File

@@ -247,8 +247,9 @@ SETTING={
dropFX=2, dropFX=2,
moveFX=2, moveFX=2,
clearFX=2, clearFX=2,
splashFX=2,
shakeFX=2, shakeFX=2,
atkFX=3, atkFX=2,
frameMul=100, frameMul=100,
text=true, text=true,

View File

@@ -242,6 +242,7 @@ return{
dropFX="Drop FX Level", dropFX="Drop FX Level",
moveFX="Move FX Level", moveFX="Move FX Level",
clearFX="Clear FX Level", clearFX="Clear FX Level",
splashFX="Splash FX Level",
shakeFX="Field Sway Level", shakeFX="Field Sway Level",
atkFX="Atk. FX Level", atkFX="Atk. FX Level",
frame="Render Frame Rate", frame="Render Frame Rate",

View File

@@ -247,6 +247,7 @@ return{
dropFX="Effets de chute", dropFX="Effets de chute",
moveFX="Effets de déplacement", moveFX="Effets de déplacement",
clearFX="Effets de nettoyage", clearFX="Effets de nettoyage",
-- splashFX="Splash FX Level",
shakeFX="Tremblements de l'écran", shakeFX="Tremblements de l'écran",
atkFX="Effets d'attaque", atkFX="Effets d'attaque",
frame="Montrer les FPS", frame="Montrer les FPS",

View File

@@ -248,6 +248,7 @@ return{
dropFX="FX Vis. de Caída", dropFX="FX Vis. de Caída",
moveFX="FX Vis. de Movim.", moveFX="FX Vis. de Movim.",
clearFX="FX Vis. de Limpieza", clearFX="FX Vis. de Limpieza",
-- splashFX="Splash FX Level",
shakeFX="Bamboleo del Tablero", shakeFX="Bamboleo del Tablero",
atkFX="FX Vis. de Ataque", atkFX="FX Vis. de Ataque",
frame="Ratio de FPSs", frame="Ratio de FPSs",

View File

@@ -178,6 +178,7 @@ return{
dropFX="↓~", dropFX="↓~",
moveFX="←→~", moveFX="←→~",
clearFX="↓↓↓~", clearFX="↓↓↓~",
splashFX="↑↑↑~",
shakeFX="~|~|~", shakeFX="~|~|~",
atkFX="→→~", atkFX="→→~",
frame="|=|", frame="|=|",

View File

@@ -78,6 +78,7 @@ return{
dropFX="下落特效", dropFX="下落特效",
moveFX="移动特效", moveFX="移动特效",
clearFX="消除特效", clearFX="消除特效",
splashFX="溅射特效",
shakeFX="晃动特效", shakeFX="晃动特效",
atkFX="攻击特效", atkFX="攻击特效",

View File

@@ -265,14 +265,6 @@ return{
grid="网格", grid="网格",
bagLine="包分界线", bagLine="包分界线",
lockFX="锁定特效等级",
dropFX="下落特效等级",
moveFX="移动特效等级",
clearFX="消除特效等级",
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
frame="绘制帧率",
text="消行文本", text="消行文本",
score="分数动画", score="分数动画",
warn="死亡预警", warn="死亡预警",
@@ -748,7 +740,6 @@ return{
"感觉自己速度到上限了?试着把das调低一点", "感觉自己速度到上限了?试着把das调低一点",
"感谢群友帮忙想tips", "感谢群友帮忙想tips",
"刚开始练全隐形可以尽量堆平,留一列消四", "刚开始练全隐形可以尽量堆平,留一列消四",
"给别人推荐本游戏的时候请记住我真的不叫铁壳米诺!!!",
"更小的DAS和ARR拥有更高的操作上限(能控制得了的话)", "更小的DAS和ARR拥有更高的操作上限(能控制得了的话)",
"更新内容在游戏里和群公告都有写!", "更新内容在游戏里和群公告都有写!",
"还能写些什么tip呢", "还能写些什么tip呢",
@@ -837,6 +828,7 @@ return{
"Nullpomino也很好玩!", "Nullpomino也很好玩!",
"Phigros好玩!", "Phigros好玩!",
"STSD必死", "STSD必死",
"Techmino n.铁壳米诺(游戏名)",
"Techmino安卓下载", "Techmino安卓下载",
"Techmino好玩!", "Techmino好玩!",
"Techmino没有抽卡没有氪金,太好玩了", "Techmino没有抽卡没有氪金,太好玩了",

View File

@@ -17,7 +17,9 @@ return{
dropFX=2, dropFX=2,
moveFX=2, moveFX=2,
clearFX=2, clearFX=2,
shakeFX=3, splashFX=2,
shakeFX=2,
atkFX=2,
highCam=false, highCam=false,
nextPos=false, nextPos=false,

View File

@@ -283,12 +283,14 @@ local function applyGameEnv(P)--Finish gameEnv processing
ENV.dropFX=nil ENV.dropFX=nil
ENV.moveFX=nil ENV.moveFX=nil
ENV.clearFX=nil ENV.clearFX=nil
ENV.splashFX=nil
ENV.shakeFX=nil ENV.shakeFX=nil
else else
if ENV.lockFX==0 then ENV.lockFX=nil end if ENV.lockFX==0 then ENV.lockFX=nil end
if ENV.dropFX==0 then ENV.dropFX=nil end if ENV.dropFX==0 then ENV.dropFX=nil end
if ENV.moveFX==0 then ENV.moveFX=nil end if ENV.moveFX==0 then ENV.moveFX=nil end
if ENV.clearFX==0 then ENV.clearFX=nil end if ENV.clearFX==0 then ENV.clearFX=nil end
if ENV.splashFX==0 then ENV.splashFX=nil end
if ENV.shakeFX==0 then ENV.shakeFX=nil end if ENV.shakeFX==0 then ENV.shakeFX=nil end
end end
if ENV.ghost==0 then ENV.ghost=nil end if ENV.ghost==0 then ENV.ghost=nil end

View File

@@ -80,6 +80,15 @@ function Player.createMoveFX(P,dir)
end end end end
end end
end end
function Player.createSplashFX(P,y)
local L=P.field[y]
for x=1,10 do
local c=L[x]
if c>0 then
SYSFX.newCell(6-P.gameEnv.splashFX,SKIN.curText[c],P.fieldX+30*x-30,P.fieldY+600-30*y,1)
end
end
end
function Player.createClearingFX(P,y,spd) function Player.createClearingFX(P,y,spd)
ins(P.clearFX,{y,0,spd}) ins(P.clearFX,{y,0,spd})
end end
@@ -849,7 +858,11 @@ do--Player.drop(P)--Place piece
if cc>0 and ENV.clearFX then if cc>0 and ENV.clearFX then
local t=7-ENV.clearFX*1 local t=7-ENV.clearFX*1
for i=1,cc do for i=1,cc do
P:createClearingFX(P.clearedRow[i],t) local y=P.clearedRow[i]
P:createClearingFX(y,t)
if ENV.splashFX then
P:createSplashFX(y)
end
end end
end end

View File

@@ -6,7 +6,7 @@ function sceneBack.setting_video()
end end
WIDGET.init("setting_video",{ WIDGET.init("setting_video",{
WIDGET.newText{name="title", x=640,y=15,font=80}, WIDGET.newText{name="title", x=640, y=15,font=80},
WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=WIDGET.lnk_swapScene("setting_sound","swipeR")}, WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=WIDGET.lnk_swapScene("setting_sound","swipeR")},
WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=WIDGET.lnk_swapScene("setting_game","swipeL")}, WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=WIDGET.lnk_swapScene("setting_game","swipeL")},
@@ -19,13 +19,14 @@ WIDGET.init("setting_video",{
WIDGET.newSwitch{name="grid", x=700, y=240, disp=WIDGET.lnk_SETval("grid"), code=WIDGET.lnk_SETrev("grid")}, WIDGET.newSwitch{name="grid", x=700, y=240, disp=WIDGET.lnk_SETval("grid"), code=WIDGET.lnk_SETrev("grid")},
WIDGET.newSwitch{name="bagLine", x=700, y=300, disp=WIDGET.lnk_SETval("bagLine"), code=WIDGET.lnk_SETrev("bagLine")}, WIDGET.newSwitch{name="bagLine", x=700, y=300, disp=WIDGET.lnk_SETval("bagLine"), code=WIDGET.lnk_SETrev("bagLine")},
WIDGET.newSlider{name="lockFX", x=350, y=350,w=373,unit=5, disp=WIDGET.lnk_SETval("lockFX"), code=WIDGET.lnk_SETsto("lockFX")}, WIDGET.newSlider{name="lockFX", x=350, y=365,w=373,unit=5, disp=WIDGET.lnk_SETval("lockFX"), code=WIDGET.lnk_SETsto("lockFX")},
WIDGET.newSlider{name="dropFX", x=350, y=400,w=373,unit=5, disp=WIDGET.lnk_SETval("dropFX"), code=WIDGET.lnk_SETsto("dropFX")}, WIDGET.newSlider{name="dropFX", x=350, y=410,w=373,unit=5, disp=WIDGET.lnk_SETval("dropFX"), code=WIDGET.lnk_SETsto("dropFX")},
WIDGET.newSlider{name="moveFX", x=350, y=450,w=373,unit=5, disp=WIDGET.lnk_SETval("moveFX"), code=WIDGET.lnk_SETsto("moveFX")}, WIDGET.newSlider{name="moveFX", x=350, y=455,w=373,unit=5, disp=WIDGET.lnk_SETval("moveFX"), code=WIDGET.lnk_SETsto("moveFX")},
WIDGET.newSlider{name="clearFX", x=350, y=500,w=373,unit=5, disp=WIDGET.lnk_SETval("clearFX"), code=WIDGET.lnk_SETsto("clearFX")}, WIDGET.newSlider{name="clearFX", x=350, y=500,w=373,unit=5, disp=WIDGET.lnk_SETval("clearFX"), code=WIDGET.lnk_SETsto("clearFX")},
WIDGET.newSlider{name="shakeFX", x=350, y=550,w=373,unit=5, disp=WIDGET.lnk_SETval("shakeFX"), code=WIDGET.lnk_SETsto("shakeFX")}, WIDGET.newSlider{name="splashFX", x=350, y=545,w=373,unit=5, disp=WIDGET.lnk_SETval("splashFX"), code=WIDGET.lnk_SETsto("splashFX")},
WIDGET.newSlider{name="atkFX", x=350, y=600,w=373,unit=5, disp=WIDGET.lnk_SETval("atkFX"), code=WIDGET.lnk_SETsto("atkFX")}, WIDGET.newSlider{name="shakeFX", x=350, y=590,w=373,unit=5, disp=WIDGET.lnk_SETval("shakeFX"), code=WIDGET.lnk_SETsto("shakeFX")},
WIDGET.newSlider{name="frame", x=350, y=650,w=373,unit=10, WIDGET.newSlider{name="atkFX", x=350, y=635,w=373,unit=5, disp=WIDGET.lnk_SETval("atkFX"), code=WIDGET.lnk_SETsto("atkFX")},
WIDGET.newSlider{name="frame", x=350, y=680,w=373,unit=10,
disp=function() disp=function()
return SETTING.frameMul>35 and SETTING.frameMul/10 or SETTING.frameMul/5-4 return SETTING.frameMul>35 and SETTING.frameMul/10 or SETTING.frameMul/5-4
end, end,