This commit is contained in:
MrZ_26
2020-02-04 19:36:20 +08:00
parent a29fa973a6
commit e8f0f4cf38
33 changed files with 1145 additions and 757 deletions

View File

@@ -8,12 +8,12 @@ load=function()
local t=Timer()
::R::
if loading==1 then
if loadnum<=#voiceList then
local N=voiceList[loadnum]
for i=1,#voice[N]do
voice[N][i]=love.audio.newSource("VOICE/"..voice[N][i]..".ogg","static")
if loadnum<=#voiceName then
local N=voiceName[loadnum]
for i=1,#voiceList[N]do
voiceBank[voiceList[N][i]]={love.audio.newSource("VOICE/"..voiceList[N][i]..".ogg","static")}
end
loadprogress=loadnum/#voiceList
loadprogress=loadnum/#voiceName
loadnum=loadnum+1
else
loading=2
@@ -60,20 +60,34 @@ end,
play=function(dt)
frame=frame+1
stat.time=stat.time+dt
for i=#FX.attack,1,-1 do
local b=FX.attack[i]
for i=#FX_attack,1,-1 do
local b=FX_attack[i]
b.t=b.t+1
local t0=b.t*.025--t in [0,1]
local t=(sin(1.5*(2*t0-1))+1)*.5
if t0==1 then
rem(FX.attack,i)
if b.t>50 then
b.rad=b.rad*1.08+.2
b.x,b.y=b.x2,b.y2
elseif b.t>10 then
local t=((b.t-10)*.025)t=(3-2*t)*t*t
b.x,b.y=b.x1*(1-t)+b.x2*t,b.y1*(1-t)+b.y2*t
end
if b.t<60 then
local L=FX_attack[i].drag
if #L==10 then
rem(L,1)rem(L,1)
end
ins(L,b.x)ins(L,b.y)
else
for i=1,#FX_attack do
FX_attack[i]=FX_attack[i+1]
end
end
end
for i=#FX.badge,1,-1 do
local b=FX.badge[i]
for i=#FX_badge,1,-1 do
local b=FX_badge[i]
b.t=b.t+1
if b.t==60 then
rem(FX.badge,i)
rem(FX_badge,i)
end
end
for i=1,#virtualkey do
@@ -81,18 +95,6 @@ play=function(dt)
virtualkeyPressTime[i]=virtualkeyPressTime[i]-1
end
end
local E=#FX.attack
for i=E,1,-1 do
local A=FX.attack[i]
A.t=A.t+1
if A.t>=100 then
for j=i,E do
FX.attack[j]=FX.attack[j+1]
end--remove [i]
elseif A.t>80 then
A.rad=A.rad*1.08+.2
end
end
if frame<180 then
if frame==179 then
@@ -116,7 +118,7 @@ play=function(dt)
return
elseif players[1].keyPressing[10]then
restartCount=restartCount+1
if restartCount>17 then
if restartCount>20 then
clearTask("play")
updateStat()
resetGameData()
@@ -298,7 +300,7 @@ play=function(dt)
end
for i=#P.shade,1,-1 do
local S=P.shade[i]
S[1]=S[1]-1+setting.fxs*.25
S[1]=S[1]-1+setting.dropFX*.25
if S[1]<=0 then
rem(P.shade,i)
end
@@ -322,14 +324,14 @@ play=function(dt)
end
for i=#P.atkBuffer,1,-1 do
local atk=P.atkBuffer[i]
atk.time=atk.time+1
if not atk.sent then
if atk.countdown>0 then
atk.countdown=atk.countdown-garbageSpeed
local A=P.atkBuffer[i]
A.time=A.time+1
if not A.sent then
if A.countdown>0 then
A.countdown=max(A.countdown-garbageSpeed,0)
end
else
if atk.time>20 then
if A.time>20 then
rem(P.atkBuffer,i)
end
end