sysFX模块改名SYSFX

This commit is contained in:
MrZ626
2020-11-17 10:26:51 +08:00
parent a1f4b703e6
commit d70e915557
11 changed files with 34 additions and 34 deletions

View File

@@ -11,7 +11,7 @@ LIGHT= require("Zframework/light")
BG= require("Zframework/background") BG= require("Zframework/background")
WIDGET= require("Zframework/widget") WIDGET= require("Zframework/widget")
TEXT= require("Zframework/text") TEXT= require("Zframework/text")
sysFX= require("Zframework/sysFX") SYSFX= require("Zframework/sysFX")
IMG= require("Zframework/image") IMG= require("Zframework/image")
BGM= require("Zframework/bgm") BGM= require("Zframework/bgm")
@@ -108,7 +108,7 @@ function love.mousepressed(x,y,k,touch)
WIDGET.press(mx,my) WIDGET.press(mx,my)
end end
lastX,lastY=mx,my lastX,lastY=mx,my
sysFX.newRipple(.3,mx,my,30) SYSFX.newRipple(.3,mx,my,30)
end end
function love.mousemoved(x,y,dx,dy,t) function love.mousemoved(x,y,dx,dy,t)
if t then return end if t then return end
@@ -191,7 +191,7 @@ function love.touchreleased(id,x,y)
if touchClick[SCN.cur]then if touchClick[SCN.cur]then
touchClick[SCN.cur](x,y) touchClick[SCN.cur](x,y)
end end
sysFX.newRipple(.3,x,y,30) SYSFX.newRipple(.3,x,y,30)
end end
end end
@@ -504,7 +504,7 @@ function love.run()
TASK.update() TASK.update()
VOC.update() VOC.update()
BG.update(dt) BG.update(dt)
sysFX.update(dt) SYSFX.update(dt)
TEXT.update() TEXT.update()
_=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater _=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
@@ -538,7 +538,7 @@ function love.run()
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5) gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3) gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end end
sysFX.draw() SYSFX.draw()
TEXT.draw() TEXT.draw()
gc.pop() gc.pop()

View File

@@ -79,21 +79,21 @@ function FXdraw.shade(S)
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
local sysFX={} local SYSFX={}
function sysFX.update(dt) function SYSFX.update(dt)
for i=#fx,1,-1 do for i=#fx,1,-1 do
if fx[i]:update(dt) then if fx[i]:update(dt) then
rem(fx,i) rem(fx,i)
end end
end end
end end
function sysFX.draw() function SYSFX.draw()
for i=1,#fx do for i=1,#fx do
fx[i]:draw() fx[i]:draw()
end end
end end
function sysFX.newBadge(x1,y1,x2,y2) function SYSFX.newBadge(x1,y1,x2,y2)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.badge, update=FXupdate.badge,
draw=FXdraw.badge, draw=FXdraw.badge,
@@ -103,7 +103,7 @@ function sysFX.newBadge(x1,y1,x2,y2)
x2=x2,y2=y2, x2=x2,y2=y2,
} }
end end
function sysFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a) function SYSFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.attack, update=FXupdate.attack,
draw=FXdraw.attack, draw=FXdraw.attack,
@@ -115,7 +115,7 @@ function sysFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a)
r=r,g=g,b=b,a=a, r=r,g=g,b=b,a=a,
} }
end end
function sysFX.newRipple(duration,x,y,r) function SYSFX.newRipple(duration,x,y,r)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.ripple, update=FXupdate.ripple,
draw=FXdraw.ripple, draw=FXdraw.ripple,
@@ -124,7 +124,7 @@ function sysFX.newRipple(duration,x,y,r)
x=x,y=y,r=r, x=x,y=y,r=r,
} }
end end
function sysFX.newRectRipple(duration,x,y,w,h) function SYSFX.newRectRipple(duration,x,y,w,h)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.rectRipple, update=FXupdate.rectRipple,
draw=FXdraw.rectRipple, draw=FXdraw.rectRipple,
@@ -133,7 +133,7 @@ function sysFX.newRectRipple(duration,x,y,w,h)
x=x,y=y,w=w,h=h, x=x,y=y,w=w,h=h,
} }
end end
function sysFX.newShade(duration,r,g,b,x,y,w,h) function SYSFX.newShade(duration,r,g,b,x,y,w,h)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.shade, update=FXupdate.shade,
draw=FXdraw.shade, draw=FXdraw.shade,
@@ -143,4 +143,4 @@ function sysFX.newShade(duration,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
return sysFX return SYSFX

View File

@@ -102,7 +102,7 @@ function button:getCenter()
end end
function button:FX() function button:FX()
local ATV=self.ATV local ATV=self.ATV
sysFX.newRectRipple( SYSFX.newRectRipple(
.16, .16,
self.x-ATV, self.x-ATV,
self.y-ATV, self.y-ATV,
@@ -605,12 +605,12 @@ function selector:press(x)
if x<self.x+self.w*.5 then if x<self.x+self.w*.5 then
if s>1 then if s>1 then
s=s-1 s=s-1
sysFX.newShade(.3,1,1,1,self.x,self.y,self.w*.5,60) SYSFX.newShade(.3,1,1,1,self.x,self.y,self.w*.5,60)
end end
else else
if s<#self.list then if s<#self.list then
s=s+1 s=s+1
sysFX.newShade(.3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60) SYSFX.newShade(.3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60)
end end
end end
if self.select~=s then if self.select~=s then
@@ -626,10 +626,10 @@ function selector:arrowKey(isLeft)
if isLeft and s==1 or not isLeft and s==#self.list then return end if isLeft and s==1 or not isLeft and s==#self.list then return end
if isLeft then if isLeft then
s=s-1 s=s-1
sysFX.newShade(.3,1,1,1,self.x,self.y,self.w*.5,60) SYSFX.newShade(.3,1,1,1,self.x,self.y,self.w*.5,60)
else else
s=s+1 s=s+1
sysFX.newShade(.3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60) SYSFX.newShade(.3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60)
end end
self.code(self.list[s]) self.code(self.list[s])
self.select=s self.select=s

View File

@@ -38,7 +38,7 @@ local function checkClear(P)
P.field[_],P.visTime[_]=nil P.field[_],P.visTime[_]=nil
end end
setField(P,P.modeData.point+1) setField(P,P.modeData.point+1)
sysFX.newShade(.7,.6,.8,.6,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) SYSFX.newShade(.7,.6,.8,.6,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size)
SFX.play("blip_1") SFX.play("blip_1")
else else
P:win("finish") P:win("finish")

View File

@@ -22,7 +22,7 @@ local function puzzleCheck(P)
FREEROW.discard(P.visTime[_]) FREEROW.discard(P.visTime[_])
P.field[_],P.visTime[_]=nil P.field[_],P.visTime[_]=nil
end end
sysFX.newShade(.7,.3,1,.3,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) SYSFX.newShade(.7,.3,1,.3,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size)
SFX.play("reach") SFX.play("reach")
P.modeData.event=0 P.modeData.event=0
else else

View File

@@ -52,7 +52,7 @@ local function check_LVup(P)
for i=1,10 do for i=1,10 do
P:createClearingFX(i,1.5) P:createClearingFX(i,1.5)
end end
sysFX.newShade(.4,1,1,1,P.x+150*P.size,P.y+370*P.size,300*P.size,300*P.size) SYSFX.newShade(.4,1,1,1,P.x+150*P.size,P.y+370*P.size,300*P.size,300*P.size)
ENV.lock=13 ENV.lock=13
ENV.wait=6 ENV.wait=6

View File

@@ -97,7 +97,7 @@ function Player.createBeam(P,R,send,color)
r,g,b=r*2,g*2,b*2 r,g,b=r*2,g*2,b*2
local a=modeEnv.royaleMode and not(P.human or R.human)and .2 or 1 local a=modeEnv.royaleMode and not(P.human or R.human)and .2 or 1
sysFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,wid,r,g,b,a*(SETTING.atkFX+2)*.0626) SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,wid,r,g,b,a*(SETTING.atkFX+2)*.0626)
end end
--------------------------</FX>-------------------------- --------------------------</FX>--------------------------
@@ -1381,9 +1381,9 @@ function Player.lose(P,force)
for i=1,21 do for i=1,21 do
P:createClearingFX(i,1.5) P:createClearingFX(i,1.5)
end end
sysFX.newShade(.7,1,1,1,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) SYSFX.newShade(.7,1,1,1,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size)
sysFX.newRectRipple(.5,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) SYSFX.newRectRipple(.5,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size)
sysFX.newRipple(.5,P.x+(475+25*(P.life<3 and P.life or 0)+12)*P.size,P.y+(665+12)*P.size,20) SYSFX.newRipple(.5,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 --300+25*i,595
SFX.play("clear_3") SFX.play("clear_3")
SFX.play("emit") SFX.play("emit")

View File

@@ -99,8 +99,8 @@ function keyDown.custom_field(key)
for j=1,10 do for j=1,10 do
if F[i][j]<=0 then goto L end if F[i][j]<=0 then goto L end
end end
sysFX.newShade(.3,1,1,1,200,660-30*i,300,30) SYSFX.newShade(.3,1,1,1,200,660-30*i,300,30)
sysFX.newRectRipple(.3,200,660-30*i,300,30) SYSFX.newRectRipple(.3,200,660-30*i,300,30)
rem(F,i) rem(F,i)
::L:: ::L::
end end
@@ -133,14 +133,14 @@ function keyDown.custom_field(key)
ins(FIELD,S.page+1,newBoard(FIELD[S.page])) ins(FIELD,S.page+1,newBoard(FIELD[S.page]))
S.page=S.page+1 S.page=S.page+1
SFX.play("blip_1",.8) SFX.play("blip_1",.8)
sysFX.newShade(.3,.5,1,.5,200,60,300,600) SYSFX.newShade(.3,.5,1,.5,200,60,300,600)
elseif key=="m"then elseif key=="m"then
rem(FIELD,S.page) rem(FIELD,S.page)
S.page=max(S.page-1,1) S.page=max(S.page-1,1)
if not FIELD[1]then if not FIELD[1]then
ins(FIELD,newBoard()) ins(FIELD,newBoard())
end end
sysFX.newShade(.3,1,.5,.5,200,60,300,600) SYSFX.newShade(.3,1,.5,.5,200,60,300,600)
SFX.play("clear_4",.8) SFX.play("clear_4",.8)
SFX.play("fall",.8) SFX.play("fall",.8)
else else

View File

@@ -73,7 +73,7 @@ local function tapBoard(x,y,key)
if S.state<2 then if S.state<2 then
if not key then if not key then
if S.pathVis then if S.pathVis then
sysFX.newRipple(.16,x,y,10) SYSFX.newRipple(.16,x,y,10)
end end
x,y=int((x-320)/160)+1,int((y-40)/160)+1 x,y=int((x-320)/160)+1,int((y-40)/160)+1
end end

View File

@@ -60,12 +60,12 @@ local function tapBoard(x,y)
SFX.play("reach") SFX.play("reach")
end end
if S.tapFX then if S.tapFX then
sysFX.newShade(.3,.6,.8,1,320+640/R*X,40+640/R*Y,640/R,640/R) SYSFX.newShade(.3,.6,.8,1,320+640/R*X,40+640/R*Y,640/R,640/R)
end end
else else
S.error=S.error+1 S.error=S.error+1
if S.tapFX then if S.tapFX then
sysFX.newShade(.5,1,.4,.5,320+640/R*X,40+640/R*Y,640/R,640/R) SYSFX.newShade(.5,1,.4,.5,320+640/R*X,40+640/R*Y,640/R,640/R)
end end
SFX.play("finesseError") SFX.play("finesseError")
end end

View File

@@ -56,7 +56,7 @@ function Tick.throwBadge(data)--{ifAI,Sender,timer}
end end
--Generate badge object --Generate badge object
sysFX.newBadge(x1,y1,x2,y2) SYSFX.newBadge(x1,y1,x2,y2)
if not data[1]and data[3]%8==0 then if not data[1]and data[3]%8==0 then
SFX.play("collect") SFX.play("collect")