0.7.24α
This commit is contained in:
Binary file not shown.
BIN
BGM/blank.ogg
BIN
BGM/blank.ogg
Binary file not shown.
BIN
BGM/cruelty.ogg
BIN
BGM/cruelty.ogg
Binary file not shown.
BIN
BGM/end.ogg
BIN
BGM/end.ogg
Binary file not shown.
BIN
BGM/final.ogg
BIN
BGM/final.ogg
Binary file not shown.
BIN
BGM/infinite.ogg
BIN
BGM/infinite.ogg
Binary file not shown.
BIN
BGM/newera.ogg
BIN
BGM/newera.ogg
Binary file not shown.
BIN
BGM/push.ogg
BIN
BGM/push.ogg
Binary file not shown.
BIN
BGM/race.ogg
BIN
BGM/race.ogg
Binary file not shown.
BIN
BGM/reason.ogg
BIN
BGM/reason.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
BGM/way.ogg
BIN
BGM/way.ogg
Binary file not shown.
152
class.lua
152
class.lua
@@ -1,4 +1,6 @@
|
||||
local gc=love.graphics
|
||||
local rem=table.remove
|
||||
local format=string.format
|
||||
Task={}
|
||||
function Task:update()
|
||||
if(not self.P or self.P and scene=="play")and self:code(self.P,self.data)then
|
||||
@@ -42,21 +44,139 @@ function clearTask(opt)
|
||||
end
|
||||
end
|
||||
|
||||
function newButton(x,y,w,h,color,font,code,hide,up,down,left,right)
|
||||
return{
|
||||
type="button",
|
||||
x=x-w*.5,y=y-h*.5,w=w,h=h,
|
||||
color=color,font=font,
|
||||
code=code,hide=hide,
|
||||
up=up,down=down,left=left,right=right,
|
||||
}
|
||||
local a={a=1,b=2}
|
||||
local x,y=pairs(a)
|
||||
assert(x==next)
|
||||
assert(y==a)
|
||||
--java王宇翔
|
||||
local button,switch,slider={type="button"},{type="switch"},{type="slider"}--WIDGET OBJECT LIB
|
||||
function newButton(x,y,w,h,color,font,code,hide,N)
|
||||
local _={
|
||||
x=x-w*.5,y=y-h*.5,
|
||||
w=w,h=h,
|
||||
color=color,
|
||||
font=font,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,button do _[k]=v end return _
|
||||
end
|
||||
function newSlider(x,y,w,unit,color,font,code,hide,up,down,left,right)
|
||||
return{
|
||||
type="slider",
|
||||
x=x,y=y,w=w,unit=unit,
|
||||
color=color,font=font,
|
||||
code=code,hide=hide,
|
||||
up=up,down=down,left=left,right=right,
|
||||
}
|
||||
function button:ifAbove(x,y)
|
||||
return x>self.x and x<self.x+self.w and y>self.y and y<self.y+self.h
|
||||
end
|
||||
function button:FX()
|
||||
sysFX[#sysFX+1]={0,0,10,self.x,self.y,self.w,self.h}
|
||||
--[0=ripple],timer,duration,x,y,w,h
|
||||
end
|
||||
function button:draw()
|
||||
local C=self.color
|
||||
gc.setColor(C)
|
||||
gc.setLineWidth(3)gc.rectangle("line",self.x,self.y,self.w,self.h,4)
|
||||
gc.setColor(C[1],C[2],C[3],.4)
|
||||
gc.setLineWidth(5)gc.rectangle("line",self.x,self.y,self.w,self.h,4)
|
||||
if self==widget_sel then
|
||||
gc.rectangle("fill",self.x,self.y,self.w,self.h,4)
|
||||
end--Highlight when Selected
|
||||
local t=self.text
|
||||
if t then
|
||||
if type(t)=="function"then t=t()end
|
||||
setFont(self.font)
|
||||
local y0=self.y+self.h*.5-self.font*.7
|
||||
gc.printf(t,self.x-2,y0-1,self.w,"center")
|
||||
gc.setColor(C)
|
||||
gc.printf(t,self.x,y0,self.w,"center")
|
||||
end
|
||||
end
|
||||
function button:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x,self.y,self.w,self.h,self.font))
|
||||
end
|
||||
|
||||
function newSwitch(x,y,font,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,font=font,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,switch do _[k]=v end return _
|
||||
end
|
||||
function switch:ifAbove(x,y)
|
||||
return x>self.x and x<self.x+100 and y>self.y-20 and y<self.y+20
|
||||
end
|
||||
function switch:FX()
|
||||
sysFX[#sysFX+1]=self.disp()and
|
||||
{1,0,15,1,.4,.4,self.x,self.y-20,50,40,0}--Switched on
|
||||
or{1,0,15,.4,1,.4,self.x+50,self.y-20,50,40,0}--Switched off
|
||||
--[1=square fade],timer,duration,r,g,b,x,y,w,h
|
||||
end
|
||||
function switch:draw()
|
||||
local x,y=self.x,self.y-20
|
||||
if self.disp()then
|
||||
gc.setColor(.6,1,.6)
|
||||
gc.rectangle("fill",x+50,y,50,40,3)
|
||||
--ON
|
||||
else
|
||||
gc.setColor(1,.6,.6)
|
||||
gc.rectangle("fill",x,y,50,40,3)
|
||||
--OFF
|
||||
end--switch
|
||||
gc.setColor(1,1,1,self==widget_sel and 1 or .6)
|
||||
gc.setLineWidth(3)gc.rectangle("line",x-3,y-3,106,46,5)
|
||||
--frame
|
||||
local t=self.text
|
||||
if t then
|
||||
if type(t)=="function"then t=t()end
|
||||
gc.setColor(1,1,1)
|
||||
setFont(self.font)
|
||||
gc.printf(t,x-412,y+20-self.font*.7,400,"right")
|
||||
end
|
||||
end
|
||||
function switch:getInfo()
|
||||
print(format("x=%d,y=%d,font=%d",self.x,self.y,self.font))
|
||||
end
|
||||
|
||||
function newSlider(x,y,w,unit,font,change,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,
|
||||
w=w,unit=unit,
|
||||
font=font,
|
||||
change=change,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,slider do _[k]=v end return _
|
||||
end
|
||||
function slider:ifAbove(x,y)
|
||||
return x>self.x-10 and x<self.x+self.w+10 and y>self.y-20 and y<self.y+20
|
||||
end
|
||||
function slider:FX(pos)
|
||||
sysFX[#sysFX+1]={1,0,10,1,1,1,self.x+self.w*pos/self.unit-8,self.y-15,17,30}
|
||||
--[1=square fade],timer,duration,r,g,b,x,y,w,h
|
||||
end
|
||||
function slider:draw()
|
||||
local S=self==widget_sel
|
||||
gc.setColor(1,1,1,S and 1 or .5)
|
||||
gc.setLineWidth(2)
|
||||
local x1,x2=self.x,self.x+self.w
|
||||
for p=0,self.unit do
|
||||
local x=x1+(x2-x1)*p/self.unit
|
||||
gc.line(x,self.y+7,x,self.y-7)
|
||||
end
|
||||
--units
|
||||
gc.setLineWidth(5)
|
||||
gc.line(x1,self.y,x2,self.y)
|
||||
--axis
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("fill",x1+(x2-x1)*self.disp()/self.unit-8,self.y-15,17,30)
|
||||
--block
|
||||
local t=self.text
|
||||
if t then
|
||||
gc.setColor(1,1,1)
|
||||
setFont(self.font)
|
||||
gc.printf(t,self.x-312,self.y-self.font*.7,300,"right")
|
||||
end
|
||||
end
|
||||
function slider:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))
|
||||
end
|
||||
2
conf.lua
2
conf.lua
@@ -1,4 +1,4 @@
|
||||
gameVersion="Alpha V0.7.23"
|
||||
gameVersion="Alpha V0.7.24"
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--Save directory name
|
||||
t.version="11.1"
|
||||
|
||||
107
dataList.lua
107
dataList.lua
@@ -50,7 +50,7 @@ local function throwBadge(S,R)--Sender/Receiver
|
||||
else
|
||||
x2,y2=R.x+66*R.size,R.y+344*R.size
|
||||
end
|
||||
FX.badge[#FX.badge+1]={x1,y1,x2,y2,t=0}
|
||||
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
|
||||
end
|
||||
local AISpeed={60,50,45,35,25,15,9,7,5,3}
|
||||
local function AITemplate(type,speedLV,next,hold,node)
|
||||
@@ -192,11 +192,11 @@ loadmode={
|
||||
local LV=curMode.lv
|
||||
if LV==3 then players[1].gameEnv.drop=15 end
|
||||
local L={}for i=1,49 do L[i]=true end
|
||||
local t=int(LV^2.5)
|
||||
repeat
|
||||
local t=system~="Windows"and 0 or 2*LV
|
||||
while t>0 do
|
||||
local r=rnd(2,49)
|
||||
if L[r]then L[r],t=false,t-1 end
|
||||
until t==0
|
||||
end
|
||||
local min,max
|
||||
if LV==1 then min,max=3,5
|
||||
elseif LV==2 then min,max=4,8
|
||||
@@ -225,11 +225,11 @@ loadmode={
|
||||
local LV=curMode.lv
|
||||
if LV==3 then players[1].gameEnv.drop=15 end
|
||||
local L={}for i=1,100 do L[i]=true end
|
||||
local t=2*int(LV^2.5)
|
||||
repeat
|
||||
local t=system~="Windows"and 0 or 1+3*LV
|
||||
while t>0 do
|
||||
local r=rnd(2,99)
|
||||
if L[r]then L[r],t=false,t-1 end
|
||||
until t==0
|
||||
end
|
||||
local min,max
|
||||
if LV==1 then min,max=3,5
|
||||
elseif LV==2 then min,max=4,9
|
||||
@@ -318,7 +318,7 @@ loadmode={
|
||||
mesDisp={
|
||||
--Default:font=35,white
|
||||
sprint=function()
|
||||
setFont(65)
|
||||
setFont(60)
|
||||
local r=max(P.gameEnv.target-P.stat.row,0)
|
||||
mStr(r,-82,265)
|
||||
if r<21 and r>0 then
|
||||
@@ -415,7 +415,7 @@ mesDisp={
|
||||
end,
|
||||
c4wtrain=function()
|
||||
setFont(50)
|
||||
mStr(max(200-P.stat.row,0),-82,220)
|
||||
mStr(max(100-P.stat.row,0),-82,220)
|
||||
mStr(P.combo,-82,310)
|
||||
mStr(P.modeData.point,-82,400)
|
||||
setFont(20)
|
||||
@@ -479,7 +479,7 @@ mesDisp={
|
||||
if P.gameEnv.puzzle or P.gameEnv.target>1e10 then
|
||||
setFont(25)
|
||||
mStr("Rows",-82,290)
|
||||
setFont(65)
|
||||
setFont(60)
|
||||
mStr(P.stat.row,-82,225)
|
||||
else
|
||||
setFont(60)
|
||||
@@ -497,7 +497,7 @@ mesDisp={
|
||||
gc.setColor(c[1],c[2],c[3],.6)
|
||||
gc.rectangle("line",30*x-25,605-30*y,20,20)
|
||||
gc.rectangle("line",30*x-20,610-30*y,10,10)
|
||||
elseif B==0 then
|
||||
elseif B==-1 then
|
||||
gc.setColor(1,1,1,.4)
|
||||
gc.line(30*x-25,605-30*y,30*x-5,625-30*y)
|
||||
gc.line(30*x-25,625-30*y,30*x-5,605-30*y)
|
||||
@@ -653,50 +653,49 @@ Event={
|
||||
P.modeData.point=P.modeData.point+s
|
||||
if P.modeData.point%100==99 then
|
||||
SFX("blip_1")
|
||||
elseif P.modeData.point>100*P.modeData.event+100 then
|
||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
||||
local s=P.modeData.event+1;P.modeData.event=s--level up!
|
||||
showText(P,text.stage(s),"fly",80,-120)
|
||||
local E=P.gameEnv
|
||||
local mode=curMode.lv
|
||||
if mode==1 then
|
||||
curBG=s==2 and"game1"or s==3 and"game2"or s==4 and"game3"or s==5 and"game4"
|
||||
curBG=s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or s==4 and"game4"
|
||||
E.lock=rush_lock[s]
|
||||
E.wait=rush_wait[s]
|
||||
E.fall=rush_fall[s]
|
||||
E.das=10-s
|
||||
if s==3 then P.gameEnv.arr=2 end
|
||||
if s==5 then P.gameEnv.bone=true end
|
||||
if s==2 then P.gameEnv.arr=2 end
|
||||
if s==4 then P.gameEnv.bone=true end
|
||||
elseif mode==2 then
|
||||
curBG=s==2 and"game3"or s==3 and"game4"or s==4 and"game5"or s==5 and"game6"
|
||||
curBG=s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"
|
||||
E.lock=death_lock[s]
|
||||
E.wait=death_wait[s]
|
||||
E.fall=death_fall[s]
|
||||
E.das=int(7.3-s*.4)
|
||||
if s==4 then P.gameEnv.bone=true end
|
||||
E.das=int(6.9-s*.4)
|
||||
if s==3 then P.gameEnv.bone=true end
|
||||
end
|
||||
if s==5 then
|
||||
P.modeData.point,P.modeData.event=500,4
|
||||
Event.win()
|
||||
else
|
||||
showText(P,text.stage(s),"fly",80,-120)
|
||||
end
|
||||
SFX("reach")
|
||||
end
|
||||
end,
|
||||
master_score_hard=function()
|
||||
local c=#P.clearing
|
||||
if P.modeData.point%100<60 then
|
||||
P.modeData.point=P.modeData.point+(c<3 and c+1 or c==3 and 5 or 7)--[1]2 3 5 7
|
||||
if P.modeData.point%100>59 then SFX("blip_1")end
|
||||
return
|
||||
if c==0 then return end
|
||||
local s
|
||||
if P.lastClear<10 then
|
||||
s=c
|
||||
else
|
||||
if c==0 then return end
|
||||
local s
|
||||
if P.lastClear<10 then
|
||||
s=c-1--0,1,2,X
|
||||
else
|
||||
s=int(c^1.45)--1,2,4,7
|
||||
end
|
||||
if P.combo>9 then s=s+3
|
||||
elseif P.combo>4 then s=s+2
|
||||
elseif P.combo>2 then s=s+1
|
||||
end
|
||||
P.modeData.point=P.modeData.point+s
|
||||
s=c<3 and c+1 or c<5 and 6 or 10
|
||||
end
|
||||
if P.combo>9 then s=s+2
|
||||
elseif P.combo>4 then s=s+1
|
||||
end
|
||||
P.modeData.point=P.modeData.point+s
|
||||
if P.modeData.point%100==99 then SFX("blip_1")end
|
||||
if int(P.modeData.point*.01)>P.modeData.event then
|
||||
local s=P.modeData.event+1;P.modeData.event=s--level up!
|
||||
showText(P,text.stage(s),"fly",80,-120)
|
||||
@@ -794,7 +793,7 @@ Event={
|
||||
if P.combo>P.modeData.point then
|
||||
P.modeData.point=P.combo
|
||||
end
|
||||
if P.stat.row>=200 then
|
||||
if P.stat.row>=100 then
|
||||
Event.win()
|
||||
end
|
||||
end
|
||||
@@ -803,7 +802,7 @@ Event={
|
||||
if P.curY+P.r>5-P.stat.row%4+#P.clearing then
|
||||
Event.lose()
|
||||
end
|
||||
if P.stat.piece%4==0 and #P.field==#P.clearing then
|
||||
if P.stat.piece%4==0 and #P.field==0 then
|
||||
P.modeData.event=P.modeData.event==0 and 1 or 0
|
||||
local r=rnd(#PClist)
|
||||
local f=P.modeData.event==0
|
||||
@@ -838,7 +837,15 @@ Event={
|
||||
local L=P.field[y]
|
||||
for x=1,10 do
|
||||
local a,b=preField[y][x],L and L[x]or 0
|
||||
if a~=0 and(a==0 and b>0 or a<8 and a~=b or a>7 and b==0)then return end
|
||||
if a~=0 then
|
||||
if a==-1 then
|
||||
if b>0 then return end
|
||||
elseif a<8 then
|
||||
if a~=b then return end
|
||||
elseif a>7 then
|
||||
if b==0 then return end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
P.modeData.event=1
|
||||
@@ -945,7 +952,7 @@ Event_task={
|
||||
local R=(P.modeData.event%3<2 and 1 or 3)
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+R
|
||||
P.stat.recv=P.stat.recv+R
|
||||
if P.modeData.event==45 then showText(P,text.maxspeed,"appear",100,-140,.6)end
|
||||
if P.modeData.event==60 then showText(P,text.maxspeed,"appear",100,-140,.6)end
|
||||
P.counter=0
|
||||
P.modeData.event=P.modeData.event+1
|
||||
end
|
||||
@@ -1130,27 +1137,18 @@ Event_task={
|
||||
end,
|
||||
|
||||
bgmFadeOut=function(self,_,id)
|
||||
bgm[id]:setVolume(max(bgm[id]:getVolume()-.03,0))
|
||||
if bgm[id]:getVolume()==0 then
|
||||
local v=bgm[id]:getVolume()-.025*setting.bgm*.125
|
||||
bgm[id]:setVolume(v>0 and v or 0)
|
||||
if v<=0 then
|
||||
bgm[id]:stop()
|
||||
return true
|
||||
end
|
||||
end,
|
||||
bgmFadeIn=function(self,_,id)
|
||||
bgm[id]:setVolume(min(bgm[id]:getVolume()+.03,1))
|
||||
if bgm[id]:getVolume()==1 then return true end
|
||||
local v=min(bgm[id]:getVolume()+.025*setting.bgm*.125,setting.bgm*.125)
|
||||
bgm[id]:setVolume(v)
|
||||
if v>=setting.bgm*.125 then return true end
|
||||
end,
|
||||
bgmWarp=function(self)
|
||||
if bgmPlaying then
|
||||
self.data=self.data-1
|
||||
if self.data==0 then
|
||||
self.data=rnd(120,180)
|
||||
bgm[bgmPlaying]:seek(max(bgm[bgmPlaying]:tell()-1,0))
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
}
|
||||
local Fkey_func={
|
||||
royale=function()
|
||||
@@ -1301,7 +1299,6 @@ defaultModeEnv={
|
||||
{
|
||||
oncehold=false,
|
||||
drop=1e99,lock=1e99,
|
||||
freshLimit=15,
|
||||
dropPiece=Event.tsd_reach,
|
||||
ospin=false,
|
||||
bg="matrix",bgm="reason",
|
||||
|
||||
322
gamefunc.lua
322
gamefunc.lua
@@ -53,83 +53,113 @@ local scs={
|
||||
{[0]={1.5,1.5},{1.5,1.5},{1.5,1.5},{1.5,1.5},},
|
||||
{[0]={0.5,2.5},{2.5,0.5},{1.5,2.5},{2.5,1.5}},
|
||||
}
|
||||
local ORG={0,0}
|
||||
local TRS={
|
||||
[1]={
|
||||
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{0,1}},
|
||||
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2},{0,-1}},
|
||||
[12]={{0,0},{1,0},{1,-1},{0,1},{-1,0},{0,2},{1,2}},
|
||||
[21]={{0,0},{-1,0},{-1,1},{1,0},{0,-2},{-1,-2}},
|
||||
[23]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2}},
|
||||
[32]={{0,0},{-1,0},{-1,-1},{-1,1},{0,2},{-1,2}},
|
||||
[30]={{0,0},{-1,0},{-1,-1},{0,-1},{0,2},{-1,2}},
|
||||
[03]={{0,0},{1,0},{1,1},{1,-1},{0,-2},{1,-2},{0,1}},
|
||||
[02]={{0,0},{1,0},{-1,0},{0,-1},{0,1}},
|
||||
[20]={{0,0},{-1,0},{1,0},{0,1},{0,-1}},
|
||||
[13]={{0,0},{0,-1},{0,1},{-1,0}},
|
||||
[31]={{0,0},{0,1},{0,-1},{1,0}},
|
||||
},--Z/J
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1} },
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-1}, {1,-2} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}},
|
||||
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[02]={ORG,{1,0}, {-1,0}, {0,-1}, {0,1} },
|
||||
[20]={ORG,{-1,0}, {1,0}, {0,1}, {0,-1} },
|
||||
[13]={ORG,{0,-1}, {0,1}, {-1,0}, {0,-2} },
|
||||
[31]={ORG,{0,1}, {0,-1}, {1,0}, {0,2} },
|
||||
},--Z
|
||||
[2]={
|
||||
[01]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}},
|
||||
[10]={{0,0},{1,0},{1,-1},{0,-1},{0,2},{1,2}},
|
||||
[12]={{0,0},{1,0},{1,-1},{1,1},{0,2},{1,2}},
|
||||
[21]={{0,0},{-1,0},{-1,1},{-1,-1},{0,-2},{-1,-2}},
|
||||
[23]={{0,0},{1,0},{1,1},{-1,0},{0,-2},{1,-2}},
|
||||
[32]={{0,0},{-1,0},{-1,-1},{0,1},{1,0},{0,2},{-1,2}},
|
||||
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1},{-1,1}},
|
||||
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{1,-1},{0,1}},
|
||||
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
|
||||
[20]={{0,0},{1,0},{-1,0},{0,1},{0,-1}},
|
||||
[13]={{0,0},{0,1},{0,-1},{1,0}},
|
||||
[31]={{0,0},{0,-1},{0,1},{-1,0}},
|
||||
},--S/L
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-1},{-1,-2} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}},
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
|
||||
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
|
||||
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
|
||||
[13]={ORG,{0,1}, {0,-1}, {-1,0}, {0,2} },
|
||||
[31]={ORG,{0,-1}, {0,1}, {1,0}, {0,-2} },
|
||||
},--S
|
||||
[3]={
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{0,1}, {-1,-1} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1} },
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {-1,1} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
|
||||
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{1,0}, {0,2}, {-1,2} },
|
||||
[23]={ORG,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
|
||||
[02]={ORG,{1,0}, {-1,0}, {0,-1}, {0,1} },
|
||||
[20]={ORG,{-1,0}, {1,0}, {0,1}, {0,-1} },
|
||||
[13]={ORG,{0,1}, {1,0}, {0,-1} },
|
||||
[31]={ORG,{0,-1}, {-1,0}, {0,1} },
|
||||
},--L
|
||||
[4]={
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {1,1} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {0,1}, {1,-1} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
|
||||
[12]={ORG,{1,0}, {1,-1}, {-1,0}, {0,2}, {1,2} },
|
||||
[21]={ORG,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
|
||||
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
|
||||
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
|
||||
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
|
||||
[13]={ORG,{0,-1}, {1,0}, {0,1} },
|
||||
[31]={ORG,{0,1}, {-1,0}, {0,-1} },
|
||||
},--J
|
||||
[5]={
|
||||
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{-1,-1}},
|
||||
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2},{0,-1},{1,1}},
|
||||
[12]={{0,0},{1,0},{1,-1},{0,-1},{0,2},{1,2},{-1,-1}},
|
||||
[21]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{1,1}},
|
||||
[23]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{-1,1}},
|
||||
[32]={{0,0},{-1,0},{-1,-1},{0,-1},{0,2},{-1,2},{1,-1}},
|
||||
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1}},
|
||||
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
|
||||
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
|
||||
[20]={{0,0},{1,0},{-1,0},{0,1},{0,-1}},
|
||||
[13]={{0,0},{0,-1},{0,1},{1,0},{-1,0},{0,2}},
|
||||
[31]={{0,0},{0,-1},{0,1},{-1,0},{1,0},{0,2}},
|
||||
},
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2}, {0,-1}, {1,1}},
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1} },
|
||||
[12]={ORG,{1,0}, {1,-1}, {0,-1}, {0,2}, {1,2}, {-1,-1}},
|
||||
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{1,1} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{0,-1}, {0,2}, {-1,2}, {1,-1}},
|
||||
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2}, {-1,1} },
|
||||
[02]={ORG,{-1,0}, {1,0}, {0,1} },
|
||||
[20]={ORG,{1,0}, {-1,0}, {0,-1} },
|
||||
[13]={ORG,{0,-1}, {0,1}, {1,0}, {0,-2}, {0,2}},
|
||||
[31]={ORG,{0,-1}, {0,1}, {-1,0}, {0,-2}, {0,2}},
|
||||
},--T
|
||||
[6]={},--O(special)
|
||||
[7]={
|
||||
[01]={{0,0},{0,1},{1,0},{-2,0},{-2,-1},{1,2}},
|
||||
[03]={{0,0},{0,1},{-1,0},{2,0},{2,-1},{-1,2}},
|
||||
[10]={{0,0},{2,0},{-1,0},{-1,-2},{2,1},{0,2}},
|
||||
[30]={{0,0},{-2,0},{1,0},{1,-2},{-2,1},{0,2}},
|
||||
[12]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
|
||||
[32]={{0,0},{1,0},{-2,0},{1,-2},{-2,-1}},
|
||||
[21]={{0,0},{-2,0},{1,0},{1,-2},{-2,1}},
|
||||
[23]={{0,0},{2,0},{-1,0},{-1,-2},{2,1}},
|
||||
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
|
||||
[20]={{0,0},{1,0},{-1,0},{0,1},{0,-1}},
|
||||
[13]={{0,0},{0,-1},{-1,0},{1,0},{0,1}},
|
||||
[31]={{0,0},{1,0},{-1,0}},
|
||||
[01]={ORG,{0,1}, {1,0}, {-2,0}, {-2,-1},{1,2} },
|
||||
[03]={ORG,{0,1}, {-1,0}, {2,0}, {2,-1}, {-1,2} },
|
||||
[10]={ORG,{2,0}, {-1,0}, {-1,-2},{2,1}, {0,2} },
|
||||
[30]={ORG,{-2,0}, {1,0}, {1,-2}, {-2,1}, {0,2} },
|
||||
[12]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
|
||||
[32]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,-1} },
|
||||
[21]={ORG,{-2,0}, {1,0}, {1,-2}, {-2,1} },
|
||||
[23]={ORG,{2,0}, {-1,0}, {-1,-2},{2,1} },
|
||||
[02]={ORG,{-1,0}, {1,0}, {0,-1}, {0,1} },
|
||||
[20]={ORG,{1,0}, {-1,0}, {0,1}, {0,-1} },
|
||||
[13]={ORG,{0,-1}, {-1,0}, {1,0}, {0,1} },
|
||||
[31]={ORG,{1,0}, {-1,0}},
|
||||
}
|
||||
}TRS[3],TRS[4]=TRS[2],TRS[1]
|
||||
}
|
||||
local AIRS={{
|
||||
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
|
||||
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2}},
|
||||
[12]={{0,0},{1,0},{1,-1},{0,2},{1,2}},
|
||||
[21]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
|
||||
[23]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
|
||||
[32]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2}},
|
||||
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2}},
|
||||
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
|
||||
[01]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[10]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[03]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
[30]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[12]={ORG,{1,0}, {1,-1}, {0,2}, {1,2} },
|
||||
[21]={ORG,{-1,0}, {-1,1}, {0,-2}, {-1,-2} },
|
||||
[32]={ORG,{-1,0}, {-1,-1},{0,2}, {-1,2} },
|
||||
[23]={ORG,{1,0}, {1,1}, {0,-2}, {1,-2} },
|
||||
}}for i=2,6 do AIRS[i]=AIRS[1]end
|
||||
AIRS[7]={
|
||||
[01]={{0,0},{-2,0},{1,0},{-2,-1},{1,2}},
|
||||
[10]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
|
||||
[12]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
|
||||
[21]={{0,0},{1,0},{-2,0},{1,-2},{-2,1}},
|
||||
[23]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
|
||||
[32]={{0,0},{-2,0},{1,0},{-2,-1},{1,2}},
|
||||
[30]={{0,0},{1,0},{-2,0},{1,-2},{-2,1}},
|
||||
[03]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
|
||||
[01]={ORG,{-2,0}, {1,0}, {-2,-1},{1,2} },
|
||||
[10]={ORG,{2,0}, {-1,0}, {2,1}, {-1,-2} },
|
||||
[12]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
|
||||
[21]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,1} },
|
||||
[23]={ORG,{2,0}, {-1,0}, {2,1}, {-1,-2} },
|
||||
[32]={ORG,{-2,0}, {1,0}, {-2,-1},{1,2} },
|
||||
[30]={ORG,{1,0}, {-2,0}, {1,-2}, {-2,1} },
|
||||
[03]={ORG,{-1,0}, {2,0}, {-1,2}, {2,-1} },
|
||||
}
|
||||
local CCblockID={4,3,5,6,1,2,0}
|
||||
local function newNext(n)
|
||||
@@ -367,8 +397,8 @@ function resetGameData()
|
||||
curBG=modeEnv.bg
|
||||
BGM(modeEnv.bgm)
|
||||
|
||||
FX.badge={}
|
||||
FX.attack={}
|
||||
FX_badge={}
|
||||
FX_attack={}
|
||||
for _,v in next,PTC.dust do
|
||||
v:release()
|
||||
end
|
||||
@@ -463,7 +493,7 @@ function createPlayer(id,x,y,size,AIdata)
|
||||
end
|
||||
end--reset current game settings
|
||||
P.cur={bk={{}},id=0,color=0,name=0}
|
||||
P.sc,P.dir,P.r,P.c={0,0},0,0,0
|
||||
P.sc,P.dir,P.r,P.c=ORG,0,0,0
|
||||
P.curX,P.curY,P.y_img=0,0,0
|
||||
P.hold={bk={{}},id=0,color=0,name=0}
|
||||
P.holded=false
|
||||
@@ -491,7 +521,7 @@ function createPlayer(id,x,y,size,AIdata)
|
||||
newNext(rem(bag1,rnd(#bag1)))
|
||||
end
|
||||
elseif s=="drought2"then
|
||||
local bag1={1,2,3,4,6}
|
||||
local bag1={1,2,3,4,6,6}
|
||||
for i=1,6 do
|
||||
newNext(rem(bag1,rnd(#bag1)))
|
||||
end
|
||||
@@ -562,7 +592,7 @@ function createPlayer(id,x,y,size,AIdata)
|
||||
end
|
||||
function showText(P,text,type,font,dy,spd,inf)
|
||||
if not P.small then
|
||||
P.bonus[#P.bonus+1]={t=0,text=text,draw=FX[type],font=font,dy=dy or 0,speed=spd or 1,inf=inf}
|
||||
P.bonus[#P.bonus+1]={t=0,text=text,draw=textFX[type],font=font,dy=dy or 0,speed=spd or 1,inf=inf}
|
||||
end
|
||||
end
|
||||
local function createBeam(S,R,send,time,target,color,clear,spin,mini,combo)
|
||||
@@ -616,18 +646,22 @@ local function createBeam(S,R,send,time,target,color,clear,spin,mini,combo)
|
||||
radius=radius*.4
|
||||
a=.35
|
||||
end
|
||||
FX.attack[#FX.attack+1]={
|
||||
x1=x1,y1=y1,
|
||||
x2=x2,y2=y2,
|
||||
rad=radius,
|
||||
FX_attack[#FX_attack+1]={
|
||||
x=x1,y=y1,--current pos
|
||||
x1=x1,y1=y1,--start pos
|
||||
x2=x2,y2=y2,--end pos
|
||||
rad=radius*(setting.atkFX+2)*.2,
|
||||
corner=corner,
|
||||
type=type==1 and"fill"or"line",
|
||||
r=r,g=g,b=b,a=a*(setting.fxs+1)*.25,
|
||||
r=r,g=g,b=b,a=a*(setting.atkFX+1)*.25,
|
||||
t=0,
|
||||
drag={},--Afterimage coordinate list
|
||||
}
|
||||
end
|
||||
local function garbageSend(S,R,send,time,...)
|
||||
createBeam(S,R,send,time,...)
|
||||
if setting.atkFX>0 then
|
||||
createBeam(S,R,send,time,...)
|
||||
end
|
||||
R.lastRecv=S
|
||||
if R.atkBuffer.sum<20 then
|
||||
local B=R.atkBuffer
|
||||
@@ -645,7 +679,7 @@ local function garbageSend(S,R,send,time,...)
|
||||
time=0,
|
||||
sent=false,
|
||||
lv=min(int(send^.69),5),
|
||||
}--Sorted insert
|
||||
}--Sorted insert(by time)
|
||||
B.sum=B.sum+send
|
||||
R.stat.recv=R.stat.recv+send
|
||||
if R.human then
|
||||
@@ -655,21 +689,19 @@ local function garbageSend(S,R,send,time,...)
|
||||
end
|
||||
local function garbageRelease()
|
||||
local flag
|
||||
while true do
|
||||
::L::
|
||||
local A=P.atkBuffer[1]
|
||||
if A and A.countdown<=0 and not A.sent then
|
||||
garbageRise(8+A.lv,A.amount,A.pos)
|
||||
P.atkBuffer.sum=P.atkBuffer.sum-A.amount
|
||||
A.sent,A.time=true,0
|
||||
P.stat.pend=P.stat.pend+A.amount
|
||||
for i=1,#P.atkBuffer do
|
||||
P.atkBuffer[i]=P.atkBuffer[i+1]
|
||||
end
|
||||
flag=true
|
||||
else
|
||||
break
|
||||
goto E
|
||||
end
|
||||
end
|
||||
goto L
|
||||
::E::
|
||||
if flag and P.AI_mode=="CC"then CC_updateField(P)end
|
||||
end
|
||||
function garbageRise(color,amount,pos)
|
||||
@@ -699,7 +731,7 @@ local function ifoverlap(bk,x,y)
|
||||
end end
|
||||
end
|
||||
local function ckfull(i)
|
||||
for j=1,10 do if P.field[i][j]==0 then return end end
|
||||
for j=1,10 do if P.field[i][j]<=0 then return end end
|
||||
return true
|
||||
end
|
||||
local function checkrow(start,height)--(cy,r)
|
||||
@@ -738,9 +770,13 @@ function freshgho()
|
||||
goto L
|
||||
end
|
||||
if P.curY>P.y_img then
|
||||
if P.human and setting.fxs>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
P.fieldOffY=2*setting.fxs
|
||||
if P.human then
|
||||
if setting.dropFX>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
end
|
||||
if setting.shakeFX>0 then
|
||||
P.fieldOffY=2*setting.shakeFX+1
|
||||
end
|
||||
end
|
||||
P.curY=P.y_img
|
||||
end
|
||||
@@ -752,7 +788,8 @@ function freshgho()
|
||||
end
|
||||
end
|
||||
local function freshLockDelay()
|
||||
if P.lockDelay<P.gameEnv.lock or P.curY==P.y_img then
|
||||
if P.lockDelay<P.gameEnv.lock then
|
||||
P.dropDelay=P.gameEnv.drop
|
||||
if P.freshTime<=P.gameEnv.freshLimit then
|
||||
P.lockDelay=P.gameEnv.lock
|
||||
end
|
||||
@@ -809,7 +846,7 @@ local function spin(d,ifpre)
|
||||
P.cur.bk=blocks[5][0]
|
||||
P.sc=scs[5][0]
|
||||
P.r,P.c,P.dir=2,3,0
|
||||
P.spinLast=3
|
||||
P.spinLast=2
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
do return end
|
||||
::I::
|
||||
@@ -817,7 +854,7 @@ local function spin(d,ifpre)
|
||||
P.cur.bk=blocks[7][2]
|
||||
P.sc=scs[7][2]
|
||||
P.r,P.c,P.dir=1,4,2
|
||||
P.spinLast=3
|
||||
P.spinLast=2
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
end
|
||||
return
|
||||
@@ -837,14 +874,14 @@ local function spin(d,ifpre)
|
||||
end
|
||||
do return end
|
||||
::spin::
|
||||
if P.human and setting.fxs>0 then
|
||||
if P.human and setting.dropFX>0 then
|
||||
createShade(P.curX,P.curY+P.r-1,P.curX+P.c-1,P.curY)
|
||||
end
|
||||
local y0=P.curY
|
||||
P.curX,P.curY,P.dir=ix,iy,idir
|
||||
P.sc,P.cur.bk=scs[P.cur.id][idir],icb
|
||||
P.r,P.c=ir,ic
|
||||
P.spinLast=t==2 and d==2 and 0 or 1
|
||||
P.spinLast=t==2 and 0 or 1
|
||||
if not ifpre then freshgho()end
|
||||
if P.gameEnv.easyFresh or y0>P.curY then freshLockDelay()end
|
||||
if P.human then
|
||||
@@ -903,7 +940,7 @@ function resetblock()
|
||||
freshgho()
|
||||
if P.keyPressing[6]then act.hardDrop()P.keyPressing[6]=false end
|
||||
end
|
||||
function drop()
|
||||
function drop()--Place piece
|
||||
P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial
|
||||
P.waiting=P.gameEnv.wait
|
||||
local dospin=0
|
||||
@@ -924,23 +961,28 @@ function drop()
|
||||
end--Immobile
|
||||
end
|
||||
lock()
|
||||
local CHN=getFreeVoiceChannel()
|
||||
local cc,send,exblock=checkrow(P.curY,P.r),0,0--Currect clear&send&sendTime
|
||||
if cc>0 then P.falling=P.gameEnv.fall end
|
||||
local cscore,sendTime=0,0
|
||||
local mini
|
||||
if P.spinLast and cc>0 and dospin>0 then
|
||||
dospin=dospin+P.spinLast
|
||||
end
|
||||
if not P.spinLast then
|
||||
dospin=false
|
||||
elseif cc==0 then
|
||||
if dospin==0 then
|
||||
dospin=false
|
||||
if P.spinLast then
|
||||
if cc>0 then
|
||||
if dospin>0 then
|
||||
dospin=dospin+P.spinLast
|
||||
if dospin<2 then
|
||||
mini=P.cur.id<6 and cc<3 and cc<P.r
|
||||
end
|
||||
else
|
||||
dospin=false
|
||||
end
|
||||
elseif cc==0 then
|
||||
if dospin==0 then
|
||||
dospin=false
|
||||
end
|
||||
end
|
||||
elseif dospin<2 then
|
||||
else
|
||||
dospin=false
|
||||
elseif dospin==2 then
|
||||
mini=P.cur.id<6 and cc<3 and cc<P.r
|
||||
end
|
||||
|
||||
if cc>0 then
|
||||
@@ -955,16 +997,16 @@ function drop()
|
||||
cscore=cscore*1.8
|
||||
P.stat.b3b=P.stat.b3b+1
|
||||
if P.human then
|
||||
VOICE("b3b")
|
||||
VOICE("b3b",CHN)
|
||||
end
|
||||
elseif P.b2b>=40 then
|
||||
elseif P.b2b>=50 then
|
||||
showText(P,text.techrashB2B,"drive",80,-30)
|
||||
sendTime=80
|
||||
send=5
|
||||
cscore=cscore*1.3
|
||||
P.stat.b2b=P.stat.b2b+1
|
||||
if P.human then
|
||||
VOICE("b2b")
|
||||
VOICE("b2b",CHN)
|
||||
end
|
||||
else
|
||||
showText(P,text.techrash,"stretch",80,-30)
|
||||
@@ -975,7 +1017,7 @@ function drop()
|
||||
P.lastClear=74
|
||||
P.stat.clear_4=P.stat.clear_4+1
|
||||
if P.human then
|
||||
VOICE("tts")
|
||||
VOICE("tts",CHN)
|
||||
end
|
||||
elseif cc>0 then
|
||||
local clearKey=clear_n
|
||||
@@ -988,15 +1030,15 @@ function drop()
|
||||
cscore=cscore*2
|
||||
P.stat.b3b=P.stat.b3b+1
|
||||
if P.human then
|
||||
VOICE("b3b")
|
||||
VOICE("b3b",CHN)
|
||||
end
|
||||
elseif P.b2b>=40 then
|
||||
elseif P.b2b>=50 then
|
||||
showText(P,text.b2b..text.spin[P.cur.name]..text.clear[cc],"spin",40,-30)
|
||||
send=b2bATK[cc]
|
||||
cscore=cscore*1.2
|
||||
P.stat.b2b=P.stat.b2b+1
|
||||
if P.human then
|
||||
VOICE("b2b")
|
||||
VOICE("b2b",CHN)
|
||||
end
|
||||
else
|
||||
showText(P,text.spin[P.cur.name]..text.clear[cc],"spin",50,-30)
|
||||
@@ -1008,9 +1050,9 @@ function drop()
|
||||
send=ceil(send*.5)
|
||||
sendTime=sendTime+60
|
||||
cscore=cscore*.5
|
||||
P.b2b=P.b2b+b2bPoint[cc]*.8
|
||||
P.b2b=P.b2b+b2bPoint[cc]*.5
|
||||
if P.human then
|
||||
VOICE("mini")
|
||||
VOICE("mini",CHN)
|
||||
end
|
||||
else
|
||||
P.b2b=P.b2b+b2bPoint[cc]
|
||||
@@ -1019,8 +1061,8 @@ function drop()
|
||||
clearKey=spin_n
|
||||
if P.human then
|
||||
SFX(spin_n[cc])
|
||||
VOICE(blockName[P.cur.name])
|
||||
VOICE("spin_")
|
||||
VOICE(blockName[P.cur.name],CHN)
|
||||
VOICE("spin_",CHN)
|
||||
end
|
||||
elseif #P.field>0 then
|
||||
P.b2b=max(P.b2b-250,0)
|
||||
@@ -1032,7 +1074,7 @@ function drop()
|
||||
end
|
||||
P.stat[clearKey[cc]]=P.stat[clearKey[cc]]+1
|
||||
if P.human then
|
||||
VOICE(clearName[cc])
|
||||
VOICE(clearName[cc],CHN)
|
||||
end
|
||||
end
|
||||
send=send+(renATK[P.combo]or 3)
|
||||
@@ -1051,7 +1093,7 @@ function drop()
|
||||
P.lastClear=P.cur.id*10+5
|
||||
if P.human then
|
||||
SFX("perfectclear")
|
||||
VOICE("pc")
|
||||
VOICE("pc",CHN)
|
||||
end
|
||||
end
|
||||
if P.combo>2 then
|
||||
@@ -1144,8 +1186,8 @@ function drop()
|
||||
P.stat.spin_0=P.stat.spin_0+1
|
||||
if P.human then
|
||||
SFX("spin_0")
|
||||
VOICE(blockName[P.cur.name])
|
||||
VOICE("spin")
|
||||
VOICE(blockName[P.cur.name],CHN)
|
||||
VOICE("spin",CHN)
|
||||
end
|
||||
cscore=cscore+30
|
||||
end
|
||||
@@ -1247,9 +1289,13 @@ act={
|
||||
P.keyPressing[6]=false
|
||||
elseif P.control and P.waiting==-1 then
|
||||
if P.curY~=P.y_img then
|
||||
if P.human and setting.fxs>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
P.fieldOffY=2*setting.fxs+1
|
||||
if P.human then
|
||||
if setting.dropFX>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
end
|
||||
if setting.shakeFX>0 then
|
||||
P.fieldOffY=2*setting.shakeFX+1
|
||||
end
|
||||
end
|
||||
P.curY=P.y_img
|
||||
P.spinLast=false
|
||||
@@ -1285,7 +1331,7 @@ act={
|
||||
P.gameEnv.Fkey()
|
||||
end,
|
||||
restart=function()
|
||||
if frame<180 then
|
||||
if not setting.holdR or frame<180 then
|
||||
clearTask("play")
|
||||
resetPartGameData()
|
||||
end
|
||||
@@ -1293,28 +1339,30 @@ act={
|
||||
|
||||
insDown=function()
|
||||
if P.curY~=P.y_img then
|
||||
if P.human and setting.fxs>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
if P.human then
|
||||
if setting.dropFX>0 then
|
||||
createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
|
||||
end
|
||||
if setting.shakeFX>0 then
|
||||
P.fieldOffY=2*setting.shakeFX
|
||||
end
|
||||
end
|
||||
P.curY,P.lockDelay,P.spinLast=P.y_img,P.gameEnv.lock,false
|
||||
if P.human and setting.fxs>0 then
|
||||
P.fieldOffY=2*setting.fxs
|
||||
end
|
||||
end
|
||||
end,
|
||||
insLeft=function()
|
||||
local x0,y0=P.curX,P.curY
|
||||
::L::if not ifoverlap(P.cur.bk,P.curX-1,P.curY)then
|
||||
P.curX=P.curX-1
|
||||
if P.human and setting.fxs>0 then
|
||||
if P.human and setting.dropFX>0 then
|
||||
createShade(P.curX+1,P.curY+P.r-1,P.curX+1,P.curY)
|
||||
end
|
||||
freshgho()
|
||||
goto L
|
||||
end
|
||||
if x0~=P.curX then
|
||||
if P.human and setting.fxs>0 then
|
||||
P.fieldOffX=-2*setting.fxs
|
||||
if P.human and setting.shakeFX>0 then
|
||||
P.fieldOffX=-2*setting.shakeFX
|
||||
end
|
||||
if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
|
||||
end
|
||||
@@ -1323,15 +1371,15 @@ act={
|
||||
local x0,y0=P.curX,P.curY
|
||||
::L::if not ifoverlap(P.cur.bk,P.curX+1,P.curY)then
|
||||
P.curX=P.curX+1
|
||||
if P.human and setting.fxs>0 then
|
||||
if P.human and setting.dropFX>0 then
|
||||
createShade(P.curX+P.c-1,P.curY+P.r-1,P.curX+P.c-1,P.curY)
|
||||
end
|
||||
freshgho()
|
||||
goto L
|
||||
end
|
||||
if x0~=P.curX then
|
||||
if P.human and setting.fxs>0 then
|
||||
P.fieldOffX=2*setting.fxs
|
||||
if P.human and setting.shakeFX>0 then
|
||||
P.fieldOffX=2*setting.shakeFX
|
||||
end
|
||||
if P.gameEnv.easyFresh or y0~=P.curY then freshLockDelay()end
|
||||
end
|
||||
|
||||
BIN
image/icon.png
BIN
image/icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 961 B |
BIN
image/mess/title_colored.png
Normal file
BIN
image/mess/title_colored.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,4 +1,3 @@
|
||||
local SWC={[true]="开",[false]="关"}
|
||||
local BK="返回"
|
||||
return{
|
||||
atkModeName={"随机","徽章","击杀","反击"},
|
||||
@@ -26,7 +25,7 @@ return{
|
||||
lose="失败",
|
||||
pause="暂停",
|
||||
finish="结束",
|
||||
pauseTime="暂停时间",
|
||||
pauseCount="暂停统计",
|
||||
|
||||
custom="自定义游戏",
|
||||
customOption={
|
||||
@@ -115,14 +114,20 @@ return{
|
||||
"适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活",
|
||||
"合群了就会消失,但是消失不代表没有意义",
|
||||
"学会使用两个旋转键,三个更好",
|
||||
"更小的DAS和ARR拥有更高的操作上限",
|
||||
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
|
||||
"注意到\"旋转\"到底对方块做了些什么吗?",
|
||||
"20G是一套全新的游戏规则",
|
||||
"20G本质是一套全新的游戏规则",
|
||||
"不要在上课时玩游戏!",
|
||||
"本游戏难度上限很高,做好心理准备",
|
||||
"方块可以不是个休闲游戏",
|
||||
"调到特殊的日期也不会发生什么的",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"使用love2d引擎制作",
|
||||
"哪里不舒服的话先看看设置有没有你想要改的",
|
||||
"有建议的话可以把信息反馈给作者~",
|
||||
"本游戏不叫铁壳米诺",
|
||||
},
|
||||
stat={
|
||||
"游戏运行次数:",
|
||||
@@ -158,7 +163,8 @@ return{
|
||||
},
|
||||
support="支持作者",
|
||||
group="官方QQ群",
|
||||
ButtonText={
|
||||
warning="禁 止 私 自 传 播",
|
||||
WidgetText={
|
||||
main={
|
||||
qplay="快速开始",
|
||||
play="开始",
|
||||
@@ -178,7 +184,7 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
music={
|
||||
bgm=function()return"音乐:"..SWC[setting.bgm]end,
|
||||
bgm="BGM",
|
||||
up="↑",
|
||||
play="播放",
|
||||
down="↓",
|
||||
@@ -221,39 +227,54 @@ return{
|
||||
pause="暂停",
|
||||
},
|
||||
pause={
|
||||
resume="继续",
|
||||
resume= "继续",
|
||||
restart="重新开始",
|
||||
quit="退出",
|
||||
quit= "退出",
|
||||
},
|
||||
setting={
|
||||
ghost=function()return"阴影:"..SWC[setting.ghost]end,
|
||||
center=function()return"旋转中心:"..SWC[setting.center]end,
|
||||
grid=function()return"网格:"..SWC[setting.grid]end,
|
||||
swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end,
|
||||
fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效:关"end,
|
||||
bg=function()return"背景:"..SWC[setting.bg]end,
|
||||
game= "游戏设置",
|
||||
graphic="画面设置",
|
||||
sound= "声音设置",
|
||||
ctrl= "控制设置",
|
||||
touch= "触屏设置",
|
||||
lang= function()return langName[setting.lang]end,
|
||||
back= "保存&返回",
|
||||
},
|
||||
setting_game={
|
||||
dasD="-",dasU="+",
|
||||
arrD="-",arrU="+",
|
||||
sddasD="-",sddasU="+",
|
||||
sdarrD="-",sdarrU="+",
|
||||
ctrl="控制设置",
|
||||
touch="触摸设置",
|
||||
lang=function()return langName[setting.lang]end,
|
||||
sfx=function()return"音效:"..SWC[setting.sfx]end,
|
||||
bgm=function()return"音乐:"..SWC[setting.bgm]end,
|
||||
vib=function()return "震动:"..setting.vib end,
|
||||
voc=function()return"语音:"..SWC[setting.voc]end,
|
||||
fullscreen=function()return"全屏:"..SWC[setting.fullscreen]end,
|
||||
bgblock=function()return"背景动画:"..SWC[setting.bgblock]end,
|
||||
frame=function()return"绘制帧:"..setting.frameMul.."%"end,
|
||||
skin="皮肤",
|
||||
smo=function()return"平滑下落:"..SWC[setting.smo]end,
|
||||
back="保存&返回",
|
||||
},
|
||||
setting2={
|
||||
holdR="长按重新开始",
|
||||
swap="组合键切换攻击模式",
|
||||
back=BK,
|
||||
},
|
||||
setting3={
|
||||
setting_graphic={
|
||||
ghost="阴影",
|
||||
grid="网格",
|
||||
center="旋转中心",
|
||||
skin="皮肤",
|
||||
bg="背景",
|
||||
bgblock="背景动画",
|
||||
smo="平滑下落",
|
||||
dropFX="下落特效等级",
|
||||
shakeFX="晃动特效等级",
|
||||
atkFX="攻击特效等级",
|
||||
fullscreen="全屏",
|
||||
frame="绘制帧率",
|
||||
back=BK,
|
||||
},
|
||||
setting_sound={
|
||||
sfx="音效",
|
||||
bgm="音乐",
|
||||
vib="震动",
|
||||
voc="语音",
|
||||
back=BK,
|
||||
},
|
||||
setting_control={
|
||||
back=BK,
|
||||
},
|
||||
setting_touch={
|
||||
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
|
||||
default="默认组合",
|
||||
snap=function()return text.snapLevelName[snapLevel]end,
|
||||
@@ -268,8 +289,8 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
history={
|
||||
prev="←",
|
||||
next="→",
|
||||
prev="↑",
|
||||
next="↓",
|
||||
back=BK,
|
||||
},
|
||||
stat={
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local SWC={[true]="开",[false]="关"}
|
||||
local BK="返回"
|
||||
return{
|
||||
atkModeName={"随机","徽章","击杀","反击"},
|
||||
@@ -26,7 +25,7 @@ return{
|
||||
lose="失败",
|
||||
pause="暂停",
|
||||
finish="结束",
|
||||
pauseTime="暂停时间",
|
||||
pauseCount="暂停统计",
|
||||
|
||||
custom="自定义游戏",
|
||||
customOption={
|
||||
@@ -115,14 +114,20 @@ return{
|
||||
"适度游戏益脑,沉迷游戏伤身,合理安排时间,享受健康生活",
|
||||
"合群了就会消失,但是消失不代表没有意义",
|
||||
"学会使用两个旋转键,三个更好",
|
||||
"更小的DAS和ARR拥有更高的操作上限",
|
||||
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
|
||||
"注意到\"旋转\"到底对方块做了些什么吗?",
|
||||
"20G是一套全新的游戏规则",
|
||||
"20G本质是一套全新的游戏规则",
|
||||
"不要在上课时玩游戏!",
|
||||
"本游戏难度上限很高,做好心理准备",
|
||||
"方块可以不是个休闲游戏",
|
||||
"调到特殊的日期也不会发生什么的",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"使用love2d引擎制作",
|
||||
"哪里不舒服的话先看看设置有没有你想要改的",
|
||||
"有建议的话可以把信息反馈给作者~",
|
||||
"郑重声明本游戏不叫[铁壳米诺]",
|
||||
},
|
||||
stat={
|
||||
"游戏运行次数:",
|
||||
@@ -158,7 +163,8 @@ return{
|
||||
},
|
||||
support="支持作者",
|
||||
group="官方QQ群",
|
||||
ButtonText={
|
||||
warning="禁 止 私 自 传 播",
|
||||
WidgetText={
|
||||
main={
|
||||
qplay="快速开始",
|
||||
play="开始",
|
||||
@@ -178,7 +184,7 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
music={
|
||||
bgm=function()return"音乐:"..SWC[setting.bgm]end,
|
||||
bgm="BGM",
|
||||
up="↑",
|
||||
play="播放",
|
||||
down="↓",
|
||||
@@ -221,39 +227,54 @@ return{
|
||||
pause="暂停",
|
||||
},
|
||||
pause={
|
||||
resume="继续",
|
||||
resume= "继续",
|
||||
restart="重新开始",
|
||||
quit="退出",
|
||||
quit= "退出",
|
||||
},
|
||||
setting={
|
||||
ghost=function()return"阴影:"..SWC[setting.ghost]end,
|
||||
center=function()return"旋转中心:"..SWC[setting.center]end,
|
||||
grid=function()return"网格:"..SWC[setting.grid]end,
|
||||
swap=function()return setting.swap and"目标选择:组合键"or"目标选择:循环"end,
|
||||
fxs=function()return setting.fxs>0 and"特效等级:"..setting.fxs or"特效:关"end,
|
||||
bg=function()return"背景:"..SWC[setting.bg]end,
|
||||
game= "游戏设置",
|
||||
graphic="画面设置",
|
||||
sound= "声音设置",
|
||||
ctrl= "控制设置",
|
||||
touch= "触屏设置",
|
||||
lang= function()return langName[setting.lang]end,
|
||||
back= "保存&返回",
|
||||
},
|
||||
setting_game={
|
||||
dasD="-",dasU="+",
|
||||
arrD="-",arrU="+",
|
||||
sddasD="-",sddasU="+",
|
||||
sdarrD="-",sdarrU="+",
|
||||
ctrl="控制设置",
|
||||
touch="触摸设置",
|
||||
lang=function()return langName[setting.lang]end,
|
||||
sfx=function()return"音效:"..SWC[setting.sfx]end,
|
||||
bgm=function()return"音乐:"..SWC[setting.bgm]end,
|
||||
vib=function()return "震动:"..setting.vib end,
|
||||
voc=function()return"语音:"..SWC[setting.voc]end,
|
||||
fullscreen=function()return"全屏:"..SWC[setting.fullscreen]end,
|
||||
bgblock=function()return"背景动画:"..SWC[setting.bgblock]end,
|
||||
frame=function()return"绘制帧:"..setting.frameMul.."%"end,
|
||||
skin="皮肤",
|
||||
smo=function()return"平滑下落:"..SWC[setting.smo]end,
|
||||
back="保存&返回",
|
||||
},
|
||||
setting2={
|
||||
holdR="长按重新开始",
|
||||
swap="组合键切换攻击模式",
|
||||
back=BK,
|
||||
},
|
||||
setting3={
|
||||
setting_graphic={
|
||||
ghost="阴影",
|
||||
grid="网格",
|
||||
center="旋转中心",
|
||||
skin="皮肤",
|
||||
bg="背景",
|
||||
bgblock="背景动画",
|
||||
smo="平滑下落",
|
||||
dropFX="下落特效等级",
|
||||
shakeFX="晃动特效等级",
|
||||
atkFX="攻击特效等级",
|
||||
fullscreen="全屏",
|
||||
frame="绘制帧率",
|
||||
back=BK,
|
||||
},
|
||||
setting_sound={
|
||||
sfx="音效",
|
||||
bgm="音乐",
|
||||
vib="震动",
|
||||
voc="语音",
|
||||
back=BK,
|
||||
},
|
||||
setting_control={
|
||||
back=BK,
|
||||
},
|
||||
setting_touch={
|
||||
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
|
||||
default="默认组合",
|
||||
snap=function()return text.snapLevelName[snapLevel]end,
|
||||
@@ -268,8 +289,8 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
history={
|
||||
prev="←",
|
||||
next="→",
|
||||
prev="↑",
|
||||
next="↓",
|
||||
back=BK,
|
||||
},
|
||||
stat={
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local SWC={[true]="ON",[false]="OFF"}
|
||||
local BK="Back"
|
||||
return{
|
||||
atkModeName={"Random","Badges","K.O.s","Counters"},
|
||||
@@ -26,7 +25,7 @@ return{
|
||||
lose="LOSE",
|
||||
pause="PAUSE",
|
||||
finish="FINISH",
|
||||
pauseTime="Pause time",
|
||||
pauseCount="Pause Count",
|
||||
|
||||
custom="Custom Game",
|
||||
customOption={
|
||||
@@ -115,14 +114,20 @@ return{
|
||||
"Playing too much = taking drugs",
|
||||
"Disappearing doesn't mean useless",
|
||||
"Try to use two rotate button,three better",
|
||||
"Small DAS&ARR can make you faster,if you can adapt to it",
|
||||
"Small DAS&ARR can make you faster,if you can control block correctly",
|
||||
"Have you noticed what does \"rotating\" do to block?",
|
||||
"20G is a brand new game rule",
|
||||
"20G actually is a brand new game rule",
|
||||
"Do not play game in class!",
|
||||
"This game can be very hard,be mentally perpared",
|
||||
"This in not a casual game",
|
||||
"Nothing will happen when some special day come",
|
||||
"3.1415926535897932384",
|
||||
"2.7182818284590452353",
|
||||
"Let-The-Bass-Kick!",
|
||||
"Powered by love2d",
|
||||
"Find out what's in the setting!",
|
||||
"Any suggestions to author!~",
|
||||
"Techmino=Technique+tetromino",
|
||||
},
|
||||
stat={
|
||||
"Games run:",
|
||||
@@ -158,7 +163,8 @@ return{
|
||||
},
|
||||
support="Support Author",
|
||||
group="Official QQ Group",
|
||||
ButtonText={
|
||||
warning="DO NOT DISTRIBUTE",
|
||||
WidgetText={
|
||||
main={
|
||||
qplay="Qplay",
|
||||
play="Play",
|
||||
@@ -178,7 +184,7 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
music={
|
||||
bgm=function()return"BGM:"..SWC[setting.bgm]end,
|
||||
bgm="BGM",
|
||||
up="↑",
|
||||
play="Play",
|
||||
down="↓",
|
||||
@@ -226,34 +232,49 @@ return{
|
||||
quit="Quit",
|
||||
},
|
||||
setting={
|
||||
ghost=function()return"Ghost:"..SWC[setting.ghost]end,
|
||||
center=function()return"Center:"..SWC[setting.center]end,
|
||||
grid=function()return"Grid:"..SWC[setting.grid]end,
|
||||
swap=function()return setting.swap and"Swap:comboKey"or"Swap:loop"end,
|
||||
fxs=function()return setting.fxs>0 and"FX level:"..setting.fxs or"NO FX"end,
|
||||
bg=function()return"BG:"..SWC[setting.bg]end,
|
||||
game= "Game Settings",
|
||||
graphic="Graphic Settings",
|
||||
sound= "Sound Settings",
|
||||
ctrl= "Control Settings",
|
||||
touch= "Touch Settings",
|
||||
lang= function()return langName[setting.lang]end,
|
||||
back= "Save&Back",
|
||||
},
|
||||
setting_game={
|
||||
dasD="-",dasU="+",
|
||||
arrD="-",arrU="+",
|
||||
sddasD="-",sddasU="+",
|
||||
sdarrD="-",sdarrU="+",
|
||||
ctrl="Control settings",
|
||||
touch="Touch settings",
|
||||
lang=function()return langName[setting.lang]end,
|
||||
sfx=function()return"SFX:"..SWC[setting.sfx]end,
|
||||
bgm=function()return"BGM:"..SWC[setting.bgm]end,
|
||||
voc=function()return"VOC:"..SWC[setting.voc]end,
|
||||
vib=function()return "VIB:"..setting.vib end,
|
||||
fullscreen=function()return"Fullscreen:"..SWC[setting.fullscreen]end,
|
||||
bgblock=function()return"BG animation:"..SWC[setting.bgblock]end,
|
||||
frame=function()return"FrameDraw:"..setting.frameMul.."%"end,
|
||||
skin="Skin",
|
||||
smo=function()return"SmoothDrop:"..SWC[setting.smo]end,
|
||||
back="Save&Back",
|
||||
},
|
||||
setting2={
|
||||
holdR="Hold R to restart",
|
||||
swap="Combo key to change ATK mode",
|
||||
back=BK,
|
||||
},
|
||||
setting3={
|
||||
setting_graphic={
|
||||
ghost="Ghost",
|
||||
grid="Grid",
|
||||
center="Center",
|
||||
skin="Skin",
|
||||
bg="Background",
|
||||
bgblock="BG animation",
|
||||
smo="Smoooth drop",
|
||||
dropFX="Drop FX level",
|
||||
shakeFX="Shake FX level",
|
||||
atkFX="ATK FX level",
|
||||
fullscreen="Fullscreen",
|
||||
frame="drawFPS",
|
||||
back=BK,
|
||||
},
|
||||
setting_sound={
|
||||
sfx="SFX",
|
||||
bgm="BGM",
|
||||
vib="VIB",
|
||||
voc="VOC",
|
||||
back=BK,
|
||||
},
|
||||
setting_control={
|
||||
back=BK,
|
||||
},
|
||||
setting_touch={
|
||||
hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
|
||||
default="Defaults",
|
||||
snap=function()return text.snapLevelName[snapLevel]end,
|
||||
@@ -268,8 +289,8 @@ return{
|
||||
back=BK,
|
||||
},
|
||||
history={
|
||||
prev="←",
|
||||
next="→",
|
||||
prev="↑",
|
||||
next="↓",
|
||||
back=BK,
|
||||
},
|
||||
stat={
|
||||
|
||||
227
list.lua
227
list.lua
@@ -82,14 +82,14 @@ bgm={
|
||||
"shining terminal",
|
||||
"end",
|
||||
}
|
||||
voiceList={
|
||||
voiceBank={}
|
||||
voiceName={
|
||||
"Z","S","L","J","T","O","I",
|
||||
"single","double","triple","tts",
|
||||
"spin","spin_","mini","b2b","b3b","pc",
|
||||
"win","lose","voc_nya","nya",
|
||||
}
|
||||
voiceBank={}
|
||||
voice={
|
||||
voiceList={
|
||||
Z={"Z_1","Z_2"},
|
||||
S={"S_1","S_2"},
|
||||
J={"J_1","J_2"},
|
||||
@@ -271,7 +271,7 @@ local customSet={
|
||||
{18,20,1,1,7,1,1,1,8,3,8,3,3},
|
||||
{22,22,1,1,7,3,1,1,8,4,1,7,7},
|
||||
{20,20,1,1,7,1,1,3,8,3,1,7,8},
|
||||
{23,11,8,11,4,1,2,1,8,3,1,4,9},
|
||||
{1,11,8,11,4,1,2,1,8,3,1,4,9},
|
||||
}
|
||||
local function useDefaultSet(n)
|
||||
for i=1,#customSet[n]do
|
||||
@@ -284,62 +284,62 @@ Widget={
|
||||
load={},
|
||||
intro={},
|
||||
main={
|
||||
qplay= newButton(160, 300,150,150,color.lightRed, 40,function()loadGame(modeSel,levelSel)end, nil, nil, "stat", nil, "play" ),
|
||||
play= newButton(380, 300,240,240,color.red, 70,function()gotoScene("mode")end, nil, nil, "stat", "qplay", "setting" ),
|
||||
setting=newButton(640, 300,240,240,color.lightBlue,55,function()gotoScene("setting")end, nil, nil, "stat", "play", "music" ),
|
||||
music= newButton(900, 300,240,240,color.lightCyan,42,function()gotoScene("music")end, nil, nil, "help", "setting", "quit" ),
|
||||
stat= newButton(640, 560,240,240,color.cyan, 55,function()gotoScene("stat")end, nil, "setting", nil, "play", "help" ),
|
||||
help= newButton(900, 560,240,240,color.yellow, 55,function()gotoScene("help")end, nil, "music", nil, "stat", "quit" ),
|
||||
quit= newButton(1180, 620,120,120,color.lightGrey,50,function()gotoScene("quit")end, nil, "music", nil, "help", nil ),
|
||||
qplay= newButton(160, 300,150,150,color.lightRed, 40,function()loadGame(modeSel,levelSel)end, nil,"play"),
|
||||
play= newButton(380, 300,240,240,color.red, 70,function()gotoScene("mode")end, nil,"setting"),
|
||||
setting=newButton(640, 300,240,240,color.lightBlue,55,function()gotoScene("setting")end, nil,"music"),
|
||||
music= newButton(900, 300,240,240,color.lightCyan,42,function()gotoScene("music")end, nil,"stat"),
|
||||
stat= newButton(640, 560,240,240,color.cyan, 55,function()gotoScene("stat")end, nil,"help"),
|
||||
help= newButton(900, 560,240,240,color.yellow, 55,function()gotoScene("help")end, nil,"quit"),
|
||||
quit= newButton(1180,620,120,120,color.lightGrey,50,function()gotoScene("quit")end, nil,"qplay"),
|
||||
},
|
||||
mode={
|
||||
up= newButton(1000, 210,200,140,color.white, 80,function()love.keypressed("up")end,function()return modeSel==1 end),
|
||||
down= newButton(1000, 430,200,140,color.white, 80,function()love.keypressed("down")end,function()return modeSel==#modeID end),
|
||||
up= newButton(1000,210,200,140,color.white, 80,function()love.keypressed("up")end,function()return modeSel==1 end),
|
||||
down= newButton(1000,430,200,140,color.white, 80,function()love.keypressed("down")end,function()return modeSel==#modeID end),
|
||||
left= newButton(190, 160,100,80, color.white, 40,function()love.keypressed("left")end,function()return levelSel==1 end),
|
||||
right= newButton(350, 160,100,80, color.white, 40,function()love.keypressed("right")end,function()return levelSel==#modeLevel[modeID[modeSel]]end),
|
||||
start= newButton(1000, 600,250,100,color.green, 50,function()loadGame(modeSel,levelSel)end),
|
||||
start= newButton(1000,600,250,100,color.green, 50,function()loadGame(modeSel,levelSel)end),
|
||||
custom= newButton(275, 420,200,90, color.yellow, 40,function()gotoScene("custom")end),
|
||||
back= newButton(640, 630,230,90, color.white, 45,back),
|
||||
},
|
||||
music={
|
||||
bgm= newButton(1100, 80, 160,80, color.white,40,function()BGM()setting.bgm=not setting.bgm end),
|
||||
up= newButton(1100, 200, 120,120,color.white,60,function()love.keypressed("up")end, function()return not setting.bgm end),
|
||||
play= newButton(1100, 340, 120,120,color.white,40,function()love.keypressed("space")end, function()return not setting.bgm end),
|
||||
down= newButton(1100, 480, 120,120,color.white,60,function()love.keypressed("down")end, function()return not setting.bgm end),
|
||||
back= newButton(640, 630, 230,90, color.white,45,back),
|
||||
bgm= newSlider(760,80,400,8,40,nil,function()return setting.bgm end,function(i)setting.bgm=i;BGM(bgmPlaying)end),
|
||||
up= newButton(1100,200,120,120,color.white,60,function()love.keypressed("up")end),
|
||||
play= newButton(1100,340,120,120,color.white,40,function()love.keypressed("space")end,function()return setting.bgm==0 end),
|
||||
down= newButton(1100,480,120,120,color.white,60,function()love.keypressed("down")end),
|
||||
back= newButton(640, 630,230,90, color.white,45,back),
|
||||
},
|
||||
custom={
|
||||
up= newButton(1000, 220, 100,100,color.white, 50,function()sel=(sel-2)%#customID+1 end),
|
||||
down= newButton(1000, 460, 100,100,color.white, 50,function()sel=sel%#customID+1 end),
|
||||
left= newButton(880, 340, 100,100,color.white, 50,function()love.keypressed("left")end),
|
||||
right= newButton(1120, 340, 100,100,color.white, 50,function()love.keypressed("right")end),
|
||||
start1= newButton(880, 580, 220,70, color.green, 40,function()loadGame(0,1)end),
|
||||
start2= newButton(1120, 580, 220,70, color.lightPurple, 40,function()loadGame(0,2)end),
|
||||
draw= newButton(1000, 90, 190,85, color.cyan, 40,function()gotoScene("draw")end),
|
||||
set1= newButton(640, 160, 240,75, color.lightRed, 40,function()useDefaultSet(1)end),
|
||||
set2= newButton(640, 250, 240,75, color.lightRed, 40,function()useDefaultSet(2)end),
|
||||
set3= newButton(640, 340, 240,75, color.lightRed, 40,function()useDefaultSet(3)end),
|
||||
set4= newButton(640, 430, 240,75, color.lightRed, 40,function()useDefaultSet(4)end),
|
||||
set5= newButton(640, 520, 240,75, color.lightRed, 40,function()useDefaultSet(5)end),
|
||||
back= newButton(640, 630, 180,60, color.white, 40,back),
|
||||
up= newButton(1000,220,100,100,color.white, 50,function()sel=(sel-2)%#customID+1 end),
|
||||
down= newButton(1000,460,100,100,color.white, 50,function()sel=sel%#customID+1 end),
|
||||
left= newButton(880, 340,100,100,color.white, 50,function()love.keypressed("left")end),
|
||||
right= newButton(1120,340,100,100,color.white, 50,function()love.keypressed("right")end),
|
||||
start1= newButton(880, 580,220,70, color.green, 40,function()loadGame(0,1)end),
|
||||
start2= newButton(1120,580,220,70, color.lightPurple, 40,function()loadGame(0,2)end),
|
||||
draw= newButton(1000,90, 190,85, color.cyan, 40,function()gotoScene("draw")end),
|
||||
set1= newButton(640, 160,240,75, color.lightRed, 40,function()useDefaultSet(1)end),
|
||||
set2= newButton(640, 250,240,75, color.lightRed, 40,function()useDefaultSet(2)end),
|
||||
set3= newButton(640, 340,240,75, color.lightRed, 40,function()useDefaultSet(3)end),
|
||||
set4= newButton(640, 430,240,75, color.lightRed, 40,function()useDefaultSet(4)end),
|
||||
set5= newButton(640, 520,240,75, color.lightRed, 40,function()useDefaultSet(5)end),
|
||||
back= newButton(640, 630,180,60, color.white, 40,back),
|
||||
},
|
||||
draw={
|
||||
any= newButton(700, 80, 120,120,color.lightGrey, 45,function()pen=0 end),
|
||||
block1= newButton(840, 80, 120,120,color.red, 65,function()pen=1 end),
|
||||
block2= newButton(980, 80, 120,120,color.green, 65,function()pen=2 end),
|
||||
block3= newButton(1120, 80, 120,120,color.orange, 65,function()pen=3 end),
|
||||
block4= newButton(840, 220, 120,120,color.blue, 65,function()pen=4 end),
|
||||
block5= newButton(980, 220, 120,120,color.magenta, 65,function()pen=5 end),
|
||||
block6= newButton(1120, 220, 120,120,color.yellow, 65,function()pen=6 end),
|
||||
block7= newButton(840, 360, 120,120,color.cyan, 65,function()pen=7 end),
|
||||
gb1= newButton(980, 360, 120,120,color.darkGrey, 65,function()pen=9 end),
|
||||
gb2= newButton(1120, 360, 120,120,color.grey, 65,function()pen=10 end),
|
||||
gb3= newButton(840, 500, 120,120,color.darkPurple, 65,function()pen=11 end),
|
||||
gb4= newButton(980, 500, 120,120,color.darkRed, 65,function()pen=12 end),
|
||||
gb5= newButton(1120, 500, 120,120,color.darkGreen, 65,function()pen=13 end),
|
||||
space= newButton(840, 640, 120,120,color.grey, 70,function()pen=-1 end),
|
||||
clear= newButton(1120, 640, 120,120,color.white, 45,function()love.keypressed("delete")end),
|
||||
back= newButton(1235, 45, 80, 80, color.white, 35,back),
|
||||
any= newButton(700, 80, 120,120,color.lightGrey, 45,function()pen=0 end),
|
||||
block1= newButton(840, 80, 120,120,color.red, 65,function()pen=1 end),
|
||||
block2= newButton(980, 80, 120,120,color.green, 65,function()pen=2 end),
|
||||
block3= newButton(1120,80, 120,120,color.orange, 65,function()pen=3 end),
|
||||
block4= newButton(840, 220,120,120,color.blue, 65,function()pen=4 end),
|
||||
block5= newButton(980, 220,120,120,color.magenta, 65,function()pen=5 end),
|
||||
block6= newButton(1120,220,120,120,color.yellow, 65,function()pen=6 end),
|
||||
block7= newButton(840, 360,120,120,color.cyan, 65,function()pen=7 end),
|
||||
gb1= newButton(980, 360,120,120,color.darkGrey, 65,function()pen=9 end),
|
||||
gb2= newButton(1120,360,120,120,color.grey, 65,function()pen=10 end),
|
||||
gb3= newButton(840, 500,120,120,color.darkPurple, 65,function()pen=11 end),
|
||||
gb4= newButton(980, 500,120,120,color.darkRed, 65,function()pen=12 end),
|
||||
gb5= newButton(1120,500,120,120,color.darkGreen, 65,function()pen=13 end),
|
||||
space= newButton(840, 640,120,120,color.grey, 70,function()pen=-1 end),
|
||||
clear= newButton(1120,640,120,120,color.white, 45,function()love.keypressed("delete")end),
|
||||
back= newButton(1235,45, 80, 80, color.white, 35,back),
|
||||
},
|
||||
play={
|
||||
pause= newButton(1235,45,80,80,color.white,30,pauseGame),
|
||||
@@ -354,74 +354,82 @@ Widget={
|
||||
end),
|
||||
quit= newButton(640,600,240,100,color.white,50,back),
|
||||
},
|
||||
setting={--Normal setting
|
||||
ghost= newButton(290, 90, 210,60,color.white,40,function()setting.ghost=not setting.ghost end, nil, nil, "grid", nil, "center" ),
|
||||
center= newButton(505, 90, 210,60,color.white,40,function()setting.center=not setting.center end, nil, nil, "swap", "ghost", "sfx" ),
|
||||
grid= newButton(290, 160,210,60,color.white,40,function()setting.grid=not setting.grid end, nil, "ghost", "fxs", nil, "swap" ),
|
||||
swap= newButton(505, 160,210,60,color.white,28,function()setting.swap=not setting.swap end, nil, "center", "bg", "grid", "vib" ),
|
||||
fxs= newButton(290, 230,210,60,color.white,40,function()setting.fxs=(setting.fxs+1)%4 end, nil, "grid", "dasU", nil, "bg" ),
|
||||
bg= newButton(505, 230,210,60,color.white,40,function()setting.bg=not setting.bg end, nil, "swap", "arrD", "fxs", "fullscreen" ),
|
||||
dasD= newButton(210, 300,50, 50,color.white,40,function()setting.das=(setting.das-1)%31 end, nil, "fxs", "sddasD", nil, "dasU" ),
|
||||
dasU= newButton(370, 300,50, 50,color.white,40,function()setting.das=(setting.das+1)%31 end, nil, "fxs", "sddasU", "dasD", "arrD" ),
|
||||
arrD= newButton(425, 300,50, 50,color.white,40,function()
|
||||
setting={
|
||||
game= newButton(640,100,320,70,color.white,40,function()gotoScene("setting_game") end,nil,"graphic"),
|
||||
graphic=newButton(640,180,320,70,color.white,40,function()gotoScene("setting_graphic") end,nil,"sound"),
|
||||
sound= newButton(640,260,320,70,color.white,40,function()gotoScene("setting_sound") end,nil,"ctrl"),
|
||||
ctrl= newButton(640,340,320,70,color.white,40,function()gotoScene("setting_control") end,nil,"touch"),
|
||||
touch= newButton(640,420,320,70,color.white,40,function()gotoScene("setting_touch") end,nil,"lang"),
|
||||
lang= newButton(640,500,320,70,color.red,40,function()
|
||||
setting.lang=setting.lang%#langName+1
|
||||
swapLanguage(setting.lang)
|
||||
end,nil,"back"),
|
||||
back= newButton(640,620,300,70,color.white,40,back, nil,"game"),
|
||||
},
|
||||
setting_game={
|
||||
dasD= newButton(150,120,50,50,color.white,40,function()setting.das=(setting.das-1)%31 end, nil,"dasU"),
|
||||
dasU= newButton(370,120,50,50,color.white,40,function()setting.das=(setting.das+1)%31 end, nil,"arrD"),
|
||||
arrD= newButton(450,120,50,50,color.white,40,function()
|
||||
setting.arr=(setting.arr-1)%16
|
||||
if setting.arr>setting.das then
|
||||
setting.das=setting.arr
|
||||
Widget.setting.dasU.alpha,Widget.setting.dasD.alpha=1,1
|
||||
Widget.setting_game.dasU:FX()
|
||||
SFX("blip_1",.4)
|
||||
end
|
||||
end,nil,"bg","sdarrD","dasU","arrU"),
|
||||
arrU= newButton(585, 300,50, 50,color.white,40,function()
|
||||
end,nil,"arrU"),
|
||||
arrU= newButton(670,120,50,50,color.white,40,function()
|
||||
setting.arr=(setting.arr+1)%16
|
||||
if setting.arr>setting.das then
|
||||
setting.das=setting.arr
|
||||
Widget.setting.dasU.alpha,Widget.setting.dasD.alpha=1,1
|
||||
Widget.setting_game.dasU:FX()
|
||||
SFX("blip_1",.4)
|
||||
end
|
||||
end,nil,"bg","sdarrU","arrD","bgblock"),
|
||||
sddasD= newButton(210, 370,50, 50,color.white,40,function()setting.sddas=(setting.sddas-1)%11 end, nil, "dasD", "ctrl", nil, "sddasU" ),
|
||||
sddasU= newButton(370, 370,50, 50,color.white,40,function()setting.sddas=(setting.sddas+1)%11 end, nil, "dasU", "ctrl", "sddasD", "sdarrD" ),
|
||||
sdarrD= newButton(425, 370,50, 50,color.white,40,function()setting.sdarr=(setting.sdarr-1)%4 end, nil, "arrD", "ctrl", "sddasU", "sdarrU" ),
|
||||
sdarrU= newButton(585, 370,50, 50,color.white,40,function()setting.sdarr=(setting.sdarr+1)%4 end, nil, "arrU", "ctrl", "sdarrD", "frame" ),
|
||||
|
||||
ctrl= newButton(340,440, 310,60,color.green,40, function()gotoScene("setting2")end, nil, "sddasU", "touch", "lang", "skin" ),
|
||||
touch= newButton(340,510, 310,60,color.yellow,40, function()gotoScene("setting3")end, nil, "ctrl", "back", nil, "lang" ),
|
||||
lang= newButton(580,510, 150,60,color.red,40, function()
|
||||
setting.lang=setting.lang%#langName+1
|
||||
swapLanguage(setting.lang)
|
||||
end,nil,"sdarrU","back","touch","skin"),
|
||||
|
||||
sfx= newButton(760,90, 160,60,color.white,40, function()setting.sfx=not setting.sfx end, nil, nil, "vib", "center", "bgm" ),
|
||||
bgm= newButton(940,90, 160,60,color.white,40, function()BGM()setting.bgm=not setting.bgm BGM("blank")end, nil, nil, "voc", "sfx", nil ),
|
||||
vib= newButton(760,160, 160,60,color.white,40, function()setting.vib=(setting.vib+1)%6 VIB(1)end, nil, "sfx", "fullscreen", "swap", "voc" ),
|
||||
voc= newButton(940,160, 160,60,color.white,40, function()setting.voc=not setting.voc end, nil, "sfx", "fullscreen", "vib", nil ),
|
||||
fullscreen= newButton(850,230, 340,60,color.white,40, function()
|
||||
end,nil,"sddasD"),
|
||||
sddasD= newButton(150,230,50,50,color.white,40,function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"),
|
||||
sddasU= newButton(370,230,50,50,color.white,40,function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"),
|
||||
sdarrD= newButton(450,230,50,50,color.white,40,function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"),
|
||||
sdarrU= newButton(670,230,50,50,color.white,40,function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"holdR"),
|
||||
holdR= newSwitch(510,330,40,function()return setting.holdR end,function()setting.holdR=not setting.holdR end, nil,"swap"),
|
||||
swap= newSwitch(510,420,25,function()return setting.swap end,function()setting.swap=not setting.swap end, nil,"back"),
|
||||
back= newButton(640,620,300,70,color.white,40,back,nil,"dasD"),
|
||||
},
|
||||
setting_graphic={
|
||||
ghost= newSwitch(310,90,40, function()return setting.ghost end, function()setting.ghost= not setting.ghost end, nil,"center"),
|
||||
center= newSwitch(580,90,40, function()return setting.center end, function()setting.center= not setting.center end, nil,"smo"),
|
||||
smo= newSwitch(310,170,25, function()return setting.smo end, function()setting.smo= not setting.smo end, nil,"grid"),
|
||||
grid= newSwitch(580,170,40, function()return setting.grid end, function()setting.grid= not setting.grid end, nil,"dropFX"),
|
||||
dropFX= newSlider(310,260,373,3,40,nil,function()return setting.dropFX end, function(i)setting.dropFX=i end, nil,"shakeFX"),
|
||||
shakeFX=newSlider(310,340,373,3,40,nil,function()return setting.shakeFX end, function(i)setting.shakeFX=i end, nil,"atkFX"),
|
||||
atkFX= newSlider(310,420,373,3,40,nil,function()return setting.atkFX end, function(i)setting.atkFX=i end, nil,"frame"),
|
||||
frame= newSlider(310,500,373,10,40,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"),
|
||||
fullscreen=newSwitch(990,90,40,function()return setting.fullscreen end,function()
|
||||
setting.fullscreen=not setting.fullscreen
|
||||
love.window.setFullscreen(setting.fullscreen)
|
||||
if not setting.fullscreen then
|
||||
love.resize(gc.getWidth(),gc.getHeight())
|
||||
end
|
||||
end,nil,"vib","bgblock","bg",nil),
|
||||
bgblock= newButton(850,300, 340,60,color.white,40, function()
|
||||
setting.bgblock=not setting.bgblock--if not setting.bgblock then for i=1,16 do BGblockList[i].v=3*BGblockList[i].v end end
|
||||
end,nil,"fullscreen","frame","arrU",nil),
|
||||
frame= newButton(850,370, 340,60,color.white,40, function()
|
||||
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
|
||||
if setting.frameMul>100 then setting.frameMul=25 end
|
||||
end,nil,"bgblock","skin","sdarrU",nil),
|
||||
skin= newButton(740,440, 120,60,color.white,40, function()
|
||||
end,nil,"bg"),
|
||||
bg= newSwitch(990,170,40,function()return setting.bg end,function()setting.bg=not setting.bg end, nil,"bgblock"),
|
||||
bgblock=newSwitch(990,250,40,function()return setting.bgblock end,function()
|
||||
setting.bgblock=not setting.bgblock--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end
|
||||
end,nil,"skin"),
|
||||
skin= newButton(950,450,120,60,color.white,40,function()
|
||||
setting.skin=setting.skin%6+1
|
||||
changeBlockSkin(setting.skin)
|
||||
end,nil,"frame","back","ctrl","smo"),
|
||||
smo= newButton(920,440, 200,60,color.white,27, function()
|
||||
setting.smo=not setting.smo
|
||||
end,nil,"frame","back","skin",nil),
|
||||
back= newButton(640,620, 300,70,color.white,40, back,nil,nil,"lang",nil,nil),
|
||||
end,nil,"back"),
|
||||
back= newButton(600,620,300,70,color.white,40,back,nil,"ghost"),
|
||||
},
|
||||
setting2={--Control setting
|
||||
setting_sound={
|
||||
sfx=newSlider(180,150,400,8,40,function()SFX("blip_1")end, function()return setting.sfx end,function(i)setting.sfx=i end,nil,"bgm"),
|
||||
bgm=newSlider(750,150,400,8,40,function()BGM(bgmPlaying or"blank")end, function()return setting.bgm end,function(i)setting.bgm=i end,nil,"vib"),
|
||||
vib=newSlider(180,340,400,5,40,function()VIB(1)end, function()return setting.vib end,function(i)setting.vib=i end,nil,"voc"),
|
||||
voc=newSlider(750,340,400,8,40,function()VOICE("nya")end, function()return setting.voc end,function(i)setting.voc=i end,nil,"back"),
|
||||
back=newButton(640,620,300,70,color.white,40,back,nil,"sfx"),
|
||||
},
|
||||
setting_control={
|
||||
back=newButton(840,630,180,60,color.white,40,back),
|
||||
},
|
||||
setting3={--Touch setting
|
||||
setting_touch={
|
||||
hide= newButton(640,210,500,80,color.white,45,function()
|
||||
setting.virtualkeySwitch=not setting.virtualkeySwitch
|
||||
end),
|
||||
@@ -454,18 +462,25 @@ Widget={
|
||||
back= newButton(640,410,170,80,color.white,45,back),
|
||||
},
|
||||
help={
|
||||
his= newButton(1050, 520,230,60,color.white,40,function()gotoScene("history")end, nil, nil, "qq", "back", nil),
|
||||
qq= newButton(1050, 600,230,60,color.white,40,function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his", nil, "back", nil),
|
||||
back= newButton(640, 600,180,60,color.white,40,back, nil, "his", nil, nil, "qq"),
|
||||
his= newButton(1050,520,230,60,color.white,40,function()gotoScene("history")end,nil,"back"),
|
||||
qq= newButton(1050,600,230,60,color.white,40,function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"),
|
||||
back= newButton(640, 600,180,60,color.white,40,back,nil,"qq"),
|
||||
},
|
||||
history={
|
||||
prev= newButton(75, 320,100,300,color.white,40,function()love.keypressed("left")end,function()return sel==1 end),
|
||||
next= newButton(1205, 320,100,300,color.white,40,function()love.keypressed("right")end,function()return sel==#updateLog end),
|
||||
back= newButton(640, 640,200,70, color.white,40,back),
|
||||
prev= newButton(1155,170,180,180,color.white,70,function()love.keypressed("up")end,function()return sel==1 end),
|
||||
next= newButton(1155,400,180,180,color.white,70,function()love.keypressed("down")end,function()return sel==#updateLog-22 end),
|
||||
back= newButton(1155,600,180,90,color.white,40,back),
|
||||
},
|
||||
stat={
|
||||
path= newButton(980,590,250,60,color.white,30,function()sys.openURL(fs.getSaveDirectory())end,function()return mobile end,nil,nil,"back",nil),
|
||||
back= newButton(640,590,180,60,color.white,40,back,nil,nil,nil,nil,"path"),
|
||||
path= newButton(980,590,250,60,color.white,30,function()sys.openURL(fs.getSaveDirectory())end,function()return mobile end,"back"),
|
||||
back= newButton(640,590,180,60,color.white,40,back,nil,"path"),
|
||||
},
|
||||
sel=nil,--selected widget id
|
||||
}
|
||||
}
|
||||
for S,L in next,Widget do
|
||||
for N,W in next,L do
|
||||
if W.next then
|
||||
W.next,L[W.next].prev=L[W.next],W
|
||||
end
|
||||
end
|
||||
end
|
||||
widget_sel=nil--selected widget object
|
||||
497
main.lua
497
main.lua
@@ -1,3 +1,8 @@
|
||||
--[[
|
||||
第一次搞这么大的工程~参考价值不是很大
|
||||
如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话当然欢迎!
|
||||
(顺便,不经允许直接盗用代码的先死个妈)
|
||||
]]
|
||||
local love=love
|
||||
local gc,tm=love.graphics,love.timer
|
||||
local ms,kb,tc=love.mouse,love.keyboard,love.touch
|
||||
@@ -6,21 +11,21 @@ local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min
|
||||
local find,format=string.find,string.format
|
||||
local ins,rem=table.insert,table.remove
|
||||
local Timer=tm.getTime
|
||||
-- sort=table.sort
|
||||
|
||||
local F=false
|
||||
null=function()end
|
||||
-------------------------------------------------------------
|
||||
system=sys.getOS()
|
||||
local mobile=system=="Android"or system=="iOS"
|
||||
local xOy=love.math.newTransform()
|
||||
local mx,my,mouseShow=-20,-20,false
|
||||
local touching--1st touching ID
|
||||
|
||||
scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1}local scr=scr
|
||||
scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1}
|
||||
local scr=scr
|
||||
scene=""
|
||||
bgmPlaying=nil
|
||||
curBG="none"
|
||||
voicePlaying={}
|
||||
bgmPlaying=nil
|
||||
voiceQueue={free=0}
|
||||
local devMode=0
|
||||
|
||||
kb.setKeyRepeat(true)
|
||||
@@ -48,18 +53,27 @@ for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
|
||||
freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end
|
||||
--Game system Vars
|
||||
setting={
|
||||
ghost=true,center=true,
|
||||
grid=false,swap=true,
|
||||
fxs=3,bg=true,
|
||||
das=10,arr=2,
|
||||
sddas=0,sdarr=2,
|
||||
lang=1,
|
||||
holdR=true,
|
||||
swap=true,
|
||||
--game
|
||||
ghost=true,center=true,
|
||||
smo=true,grid=false,
|
||||
dropFX=3,
|
||||
shakeFX=3,
|
||||
atkFX=3,
|
||||
frameMul=100,
|
||||
|
||||
sfx=true,bgm=true,
|
||||
vib=3,voc=false,
|
||||
fullscreen=false,
|
||||
bg=true,
|
||||
bgblock=true,
|
||||
skin=1,smo=true,
|
||||
lang=1,
|
||||
skin=1,
|
||||
--graphic
|
||||
sfx=8,bgm=6,
|
||||
vib=3,voc=0,
|
||||
--sound
|
||||
keyMap={
|
||||
{"left","right","x","z","c","up","down","space","tab","r","","",""},
|
||||
{"","","","","","","","","","","","",""},
|
||||
@@ -92,7 +106,7 @@ setting={
|
||||
virtualkeyAlpha=3,
|
||||
virtualkeyIcon=true,
|
||||
virtualkeySwitch=false,
|
||||
frameMul=100,
|
||||
--control
|
||||
}
|
||||
stat={
|
||||
run=0,game=0,time=0,
|
||||
@@ -133,10 +147,8 @@ require("dataList")
|
||||
require("texture")
|
||||
local Tmr=require("timer")
|
||||
local Pnt=require("paint")
|
||||
--Requires
|
||||
--Modules
|
||||
-------------------------------------------------------------
|
||||
local BGblockList={}for i=1,16 do BGblockList[i]={v=0}end
|
||||
local BGblock={tm=150,next=7,ct=0}
|
||||
local powerInfoCanvas,updatePowerInfo
|
||||
if sys.getPowerInfo()~="unknown"then
|
||||
powerInfoCanvas=gc.newCanvas(147,22)
|
||||
@@ -177,15 +189,15 @@ if sys.getPowerInfo()~="unknown"then
|
||||
end
|
||||
end
|
||||
local function getNewBlock()
|
||||
BGblock.ct=BGblock.ct+1
|
||||
if BGblock.ct==17 then BGblock.ct=1 end
|
||||
local t=BGblockList[BGblock.ct]
|
||||
t.bn,t.size=BGblock.next,2+3*rnd()
|
||||
FX_BGblock.ct=FX_BGblock.ct+1
|
||||
if FX_BGblock.ct==17 then FX_BGblock.ct=1 end
|
||||
local t=FX_BGblock.list[FX_BGblock.ct]
|
||||
t.bn,t.size=FX_BGblock.next,2+3*rnd()
|
||||
t.b=blocks[t.bn][rnd(0,3)]
|
||||
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
|
||||
t.y=-#t.b*30*t.size
|
||||
t.v=t.size*(1+rnd())
|
||||
BGblock.next=BGblock.next%7+1
|
||||
FX_BGblock.next=FX_BGblock.next%7+1
|
||||
return t
|
||||
end
|
||||
local sceneInit={
|
||||
@@ -202,12 +214,19 @@ local sceneInit={
|
||||
end,
|
||||
main=function()
|
||||
modeSel,levelSel=modeSel or 1,levelSel or 3
|
||||
BGM("blank")
|
||||
collectgarbage()
|
||||
end,
|
||||
music=function()
|
||||
sel=1
|
||||
BGM()
|
||||
if bgmPlaying then
|
||||
for i=1,#musicID do
|
||||
if musicID[i]==bgmPlaying then
|
||||
sel=i
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
sel=1
|
||||
end
|
||||
end,
|
||||
mode=function()
|
||||
curBG="none"
|
||||
@@ -239,14 +258,17 @@ local sceneInit={
|
||||
setting=function()
|
||||
curBG="none"
|
||||
end,
|
||||
setting2=function()
|
||||
setting_game=null,
|
||||
setting_graphic=null,
|
||||
setting_sound=null,
|
||||
setting_control=function()
|
||||
curBoard=1
|
||||
keyboardSet=1
|
||||
joystickSet=1
|
||||
keyboardSetting=false
|
||||
joystickSetting=false
|
||||
end,--Control settings
|
||||
setting3=function()
|
||||
setting_touch=function()
|
||||
curBG="game1"
|
||||
defaultSel=1
|
||||
sel=nil
|
||||
@@ -260,7 +282,7 @@ local sceneInit={
|
||||
history=function()
|
||||
updateLog=require"updateLog"
|
||||
curBG="lightGrey"
|
||||
sel=2
|
||||
sel=1
|
||||
end,
|
||||
quit=function()
|
||||
love.event.quit()
|
||||
@@ -279,47 +301,25 @@ local function onVirtualkey(x,y)
|
||||
end
|
||||
return nearest
|
||||
end
|
||||
local function buttonControl_key(i)
|
||||
if i=="up"or i=="down"or i=="left"or i=="right"then
|
||||
if Widget.sel then
|
||||
Widget.sel=Widget[scene][Widget.sel[i]]or Widget.sel
|
||||
else
|
||||
Widget.sel=select(2,next(Widget[scene]))
|
||||
end
|
||||
elseif i=="space"or i=="return"then
|
||||
if not sceneSwaping and Widget.sel then
|
||||
local W=Widget.sel
|
||||
if W.type=="button"then
|
||||
W.alpha=1
|
||||
W.code()
|
||||
if W.hide and W.hide()then Widget.sel=nil end
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local function buttonControl_gamepad(i)
|
||||
if i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
|
||||
if Widget.sel then
|
||||
Widget.sel=Widget[scene][Widget.sel[i=="dpup"and"up"or i=="dpdown"and"down"or i=="dpleft"and"left"or"right"]]or Widget.sel
|
||||
else
|
||||
Widget.sel=select(2,next(Widget[scene]))
|
||||
end
|
||||
elseif i=="start"then
|
||||
if not sceneSwaping and Widget.sel then
|
||||
local W=Widget.sel
|
||||
if W.type=="button"then
|
||||
W.alpha=1
|
||||
W.code()
|
||||
if W.hide and W.hide()then Widget.sel=nil end
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-------------------------------------------------------------
|
||||
local floatWheel=0
|
||||
local function wheelScroll(y)
|
||||
if y>0 then
|
||||
if floatWheel<0 then floatWheel=0 end
|
||||
floatWheel=floatWheel+y^1.2
|
||||
elseif y<0 then
|
||||
if floatWheel>0 then floatWheel=0 end
|
||||
floatWheel=floatWheel-(-y)^1.2
|
||||
end
|
||||
while floatWheel>=1 do
|
||||
love.keypressed("up")
|
||||
floatWheel=floatWheel-1
|
||||
end
|
||||
while floatWheel<=-1 do
|
||||
love.keypressed("down")
|
||||
floatWheel=floatWheel+1
|
||||
end
|
||||
end
|
||||
local mouseDown,mouseMove,mouseUp,wheelmoved={},{},{},{}
|
||||
local touchDown,touchUp,touchMove={},{},{}
|
||||
local keyDown,keyUp={},{}
|
||||
@@ -343,9 +343,8 @@ function keyDown.intro(key)
|
||||
end
|
||||
|
||||
function wheelmoved.mode(x,y)
|
||||
if y>0 then keyDown.mode("up")
|
||||
elseif y<0 then keyDown.mode("down")
|
||||
end
|
||||
wheelScroll(y)
|
||||
|
||||
end
|
||||
function keyDown.mode(key)
|
||||
if key=="down"then
|
||||
@@ -495,7 +494,7 @@ function keyDown.draw(key)
|
||||
end
|
||||
end
|
||||
|
||||
function keyDown.setting2(key)
|
||||
function keyDown.setting_control(key)
|
||||
if key=="escape"then
|
||||
if keyboardSetting then
|
||||
keyboardSetting=false
|
||||
@@ -524,7 +523,7 @@ function keyDown.setting2(key)
|
||||
curBoard=min(curBoard+1,8)
|
||||
end
|
||||
end
|
||||
function gamepadDown.setting2(key)
|
||||
function gamepadDown.setting_control(key)
|
||||
if key=="back"then
|
||||
if joystickSetting then
|
||||
joystickSetting=false
|
||||
@@ -554,7 +553,7 @@ function gamepadDown.setting2(key)
|
||||
end
|
||||
end
|
||||
|
||||
function mouseDown.setting3(x,y,k)
|
||||
function mouseDown.setting_touch(x,y,k)
|
||||
if k==2 then back()end
|
||||
for K=1,#virtualkey do
|
||||
local b=virtualkey[K]
|
||||
@@ -563,20 +562,20 @@ function mouseDown.setting3(x,y,k)
|
||||
end
|
||||
end
|
||||
end
|
||||
function mouseMove.setting3(x,y,dx,dy)
|
||||
function mouseMove.setting_touch(x,y,dx,dy)
|
||||
if sel and ms.isDown(1)then
|
||||
local b=virtualkey[sel]
|
||||
b[1],b[2]=b[1]+dx,b[2]+dy
|
||||
end
|
||||
end
|
||||
function mouseUp.setting3(x,y,k)
|
||||
function mouseUp.setting_touch(x,y,k)
|
||||
if sel then
|
||||
local b=virtualkey[sel]
|
||||
local k=snapLevelValue[snapLevel]
|
||||
b[1],b[2]=int(b[1]/k+.5)*k,int(b[2]/k+.5)*k
|
||||
end
|
||||
end
|
||||
function touchDown.setting3(id,x,y)
|
||||
function touchDown.setting_touch(id,x,y)
|
||||
for K=1,#virtualkey do
|
||||
local b=virtualkey[K]
|
||||
if (x-b[1])^2+(y-b[2])^2<b[3]then
|
||||
@@ -584,7 +583,7 @@ function touchDown.setting3(id,x,y)
|
||||
end
|
||||
end
|
||||
end
|
||||
function touchUp.setting3(id,x,y)
|
||||
function touchUp.setting_touch(id,x,y)
|
||||
if sel then
|
||||
x,y=xOy:inverseTransformPoint(x,y)
|
||||
if sel then
|
||||
@@ -594,7 +593,7 @@ function touchUp.setting3(id,x,y)
|
||||
end
|
||||
end
|
||||
end
|
||||
function touchMove.setting3(id,x,y,dx,dy)
|
||||
function touchMove.setting_touch(id,x,y,dx,dy)
|
||||
if sel then
|
||||
local b=virtualkey[sel]
|
||||
b[1],b[2]=b[1]+dx,b[2]+dy
|
||||
@@ -699,18 +698,99 @@ function gamepadUp.play(key)
|
||||
end
|
||||
end
|
||||
|
||||
function wheelmoved.history(x,y)
|
||||
wheelScroll(y)
|
||||
end
|
||||
function keyDown.history(key)
|
||||
if key=="left"then
|
||||
if sel>1 then sel=sel-1 end
|
||||
elseif key=="right"then
|
||||
if sel<#updateLog then sel=sel+1 end
|
||||
if key=="up"then
|
||||
sel=max(sel-5,1)
|
||||
elseif key=="down"then
|
||||
sel=min(sel+5,#updateLog-22)
|
||||
elseif key=="escape"then
|
||||
back()
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------
|
||||
|
||||
local function widgetPress(W,x,y)
|
||||
if W.hide and W.hide()then widget_sel=nil end
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("move",.6)
|
||||
elseif W.type=="slider"then
|
||||
if not x then return end
|
||||
local p=W.disp()
|
||||
W.code(x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5))
|
||||
if p==W.disp()then return end
|
||||
W:FX(p)
|
||||
if W.change then W.change()end
|
||||
end
|
||||
end
|
||||
local function widgetDrag(W,x,y,dx,dy)
|
||||
if W.type=="slider"then
|
||||
local p=W.disp()
|
||||
W.code(x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5))
|
||||
if p==W.disp()then return end
|
||||
W:FX(p)
|
||||
if W.change then W.change()end
|
||||
elseif not W:ifAbove(x,y)then
|
||||
widget_sel=nil
|
||||
end
|
||||
end
|
||||
local function widgetControl_key(i)
|
||||
if i=="tab"then
|
||||
if widget_sel then
|
||||
widget_sel=kb.isDown("lshift")and widget_sel.prev or widget_sel.next or widget_sel
|
||||
else
|
||||
widget_sel=select(2,next(Widget[scene]))
|
||||
end
|
||||
elseif i=="space"or i=="return"then
|
||||
if not sceneSwaping and widget_sel then
|
||||
widgetPress(widget_sel)
|
||||
end
|
||||
else
|
||||
if widget_sel then
|
||||
local W=widget_sel
|
||||
if W.type=="slider"then
|
||||
if i=="left"then
|
||||
if W.disp()>0 then W.code(W.disp()-1)end
|
||||
elseif i=="right"then
|
||||
if W.disp()<W.unit then W.code(W.disp()+1)end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local function widgetControl_gamepad(i)
|
||||
if i=="dpup"or i=="dpdown"then
|
||||
if widget_sel then
|
||||
widget_sel=i=="dpup"and widget_sel.prev or widget_sel.next or widget_sel
|
||||
else
|
||||
widget_sel=select(2,next(Widget[scene]))
|
||||
end
|
||||
elseif i=="start"then
|
||||
if not sceneSwaping and widget_sel then
|
||||
local W=widget_sel
|
||||
if W.hide and W.hide()then widget_sel=nil end
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("move",.6)
|
||||
-- elseif W.type=="slider"then
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function love.mousepressed(x,y,k,t,num)
|
||||
if t then return end
|
||||
mouseShow=true
|
||||
@@ -721,17 +801,8 @@ function love.mousepressed(x,y,k,t,num)
|
||||
back()
|
||||
end
|
||||
if k==1 then
|
||||
if not sceneSwaping and Widget.sel then
|
||||
local W=Widget.sel
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W.alpha=1
|
||||
Widget.sel=nil
|
||||
love.mousemoved(x,y,0,0)
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
VIB(1)
|
||||
end
|
||||
if widget_sel and not sceneSwaping then
|
||||
widgetPress(widget_sel,mx,my)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -739,17 +810,18 @@ function love.mousemoved(x,y,dx,dy,t)
|
||||
if t then return end
|
||||
mouseShow=true
|
||||
mx,my=xOy:inverseTransformPoint(x,y)
|
||||
Widget.sel=nil
|
||||
dx,dy=dx/scr.k,dy/scr.k
|
||||
if mouseMove[scene]then
|
||||
mouseMove[scene](mx,my,dx/scr.k,dy/scr.k)
|
||||
mouseMove[scene](mx,my,dx,dy)
|
||||
end
|
||||
for _,W in next,Widget[scene]do
|
||||
if not(W.hide and W.hide())then
|
||||
if W.type=="button"then
|
||||
if mx>W.x and mx<W.x+W.w and my>W.y and my<W.y+W.h then
|
||||
Widget.sel=W
|
||||
return
|
||||
end
|
||||
if ms.isDown(1)and widget_sel then
|
||||
widgetDrag(widget_sel,mx,my,dx,dy)
|
||||
else
|
||||
widget_sel=nil
|
||||
for _,W in next,Widget[scene]do
|
||||
if not(W.hide and W.hide())and W:ifAbove(mx,my)then
|
||||
widget_sel=W
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -775,62 +847,50 @@ function love.touchpressed(id,x,y)
|
||||
touchDown[scene](id,xOy:inverseTransformPoint(x,y))
|
||||
end
|
||||
end
|
||||
function love.touchreleased(id,x,y)
|
||||
if id==touching then
|
||||
touching=nil
|
||||
if Widget.sel then
|
||||
local W=Widget.sel
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W.alpha=1
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
VIB(1)
|
||||
end
|
||||
end
|
||||
Widget.sel=nil
|
||||
end
|
||||
if touchUp[scene]then
|
||||
touchUp[scene](id,xOy:inverseTransformPoint(x,y))
|
||||
end
|
||||
end
|
||||
function love.touchmoved(id,x,y,dx,dy)
|
||||
x,y=xOy:inverseTransformPoint(x,y)
|
||||
if touchMove[scene]then
|
||||
touchMove[scene](id,x,y,dx/scr.k,dy/scr.k)
|
||||
end
|
||||
Widget.sel=nil
|
||||
for _,W in next,Widget[scene]do
|
||||
if not(W.hide and W.hide())then
|
||||
if W.type=="button"then
|
||||
if x>W.x and x<W.x+W.w and y>W.y and y<W.y+W.h then
|
||||
Widget.sel=W
|
||||
return
|
||||
end
|
||||
if widget_sel then
|
||||
widgetDrag(widget_sel,x,y,dx,dy)
|
||||
else
|
||||
widget_sel=nil
|
||||
for _,W in next,Widget[scene]do
|
||||
if not(W.hide and W.hide())and W:ifAbove(x,y)then
|
||||
widget_sel=W
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Widget.sel then
|
||||
if not widget_sel then
|
||||
touching=nil
|
||||
end
|
||||
end
|
||||
function love.touchreleased(id,x,y)
|
||||
x,y=xOy:inverseTransformPoint(x,y)
|
||||
if id==touching then
|
||||
touching=nil
|
||||
if widget_sel and not sceneSwaping then
|
||||
widgetPress(widget_sel,x,y)
|
||||
end
|
||||
widget_sel=nil
|
||||
end
|
||||
if touchUp[scene]then
|
||||
touchUp[scene](id,x,y)
|
||||
end
|
||||
end
|
||||
function love.keypressed(i)
|
||||
mouseShow=false
|
||||
if i=="f8"then devMode=(devMode+1)%3 end
|
||||
if devMode==2 then
|
||||
if i=="k"then
|
||||
for i=1,8 do
|
||||
P=players.alive[rnd(#players.alive)]
|
||||
if P.id~=1 then
|
||||
P.lastRecv=players[1]
|
||||
Event.lose()
|
||||
end
|
||||
end
|
||||
--Test code here
|
||||
elseif i=="q"then
|
||||
local W=Widget.sel if W then print(format("x=%d,y=%d,w=%d,h=%d",W.x,W.y,W.w,W.h))end
|
||||
elseif Widget.sel then
|
||||
local W=Widget.sel
|
||||
local W=widget_sel
|
||||
if W then W:getInfo()end
|
||||
elseif widget_sel then
|
||||
local W=widget_sel
|
||||
if i=="left"then W.x=W.x-10
|
||||
elseif i=="right"then W.x=W.x+10
|
||||
elseif i=="up"then W.y=W.y-10
|
||||
@@ -839,18 +899,19 @@ function love.keypressed(i)
|
||||
elseif i=="."then W.w=W.w+10
|
||||
elseif i=="/"then W.h=W.h-10
|
||||
elseif i=="'"then W.h=W.h+10
|
||||
elseif i=="["then W.font=W.font-1
|
||||
elseif i=="]"then W.font=W.font+1
|
||||
end
|
||||
end
|
||||
else
|
||||
if keyDown[scene]then keyDown[scene](i)
|
||||
elseif i=="escape"or i=="back"then back()
|
||||
else buttonControl_key(i)
|
||||
else widgetControl_key(i)
|
||||
end
|
||||
end
|
||||
end
|
||||
function love.keyreleased(i)
|
||||
if keyUp[scene]then keyUp[scene](i)
|
||||
end
|
||||
if keyUp[scene]then keyUp[scene](i)end
|
||||
end
|
||||
|
||||
local keyMirror={
|
||||
@@ -866,7 +927,7 @@ function love.gamepadpressed(joystick,i)
|
||||
if gamepadDown[scene]then gamepadDown[scene](i)
|
||||
elseif keyDown[scene]then keyDown[scene](keyMirror[i]or i)
|
||||
elseif i=="back"then back()
|
||||
else buttonControl_gamepad(i)
|
||||
else widgetControl_gamepad(i)
|
||||
end
|
||||
end
|
||||
function love.gamepadreleased(joystick,i)
|
||||
@@ -903,16 +964,25 @@ end
|
||||
function love.update(dt)
|
||||
-- if players then for k,v in pairs(players[1])do
|
||||
-- if rawget(_G,k)and k~="next"and k~="hold"and k~="stat"then print(k,_G[v])end
|
||||
-- end end--check player data flew(debugging)
|
||||
for i=#BGblock,1,-1 do
|
||||
BGblock[i].y=BGblock[i].y+BGblock[i].v
|
||||
if BGblock[i].y>720 then rem(BGblock,i)end
|
||||
-- end end--check player data flew
|
||||
for i=#sysFX,1,-1 do
|
||||
local S=sysFX[i]
|
||||
S[2]=S[2]+1
|
||||
if S[2]==S[3]then
|
||||
for i=i,#sysFX do
|
||||
sysFX[i]=sysFX[i+1]
|
||||
end
|
||||
end
|
||||
end
|
||||
for i=#FX_BGblock,1,-1 do
|
||||
FX_BGblock[i].y=FX_BGblock[i].y+FX_BGblock[i].v
|
||||
if FX_BGblock[i].y>720 then rem(FX_BGblock,i)end
|
||||
end
|
||||
if setting.bgblock then
|
||||
BGblock.tm=BGblock.tm-1
|
||||
if BGblock.tm==0 then
|
||||
BGblock[#BGblock+1]=getNewBlock()
|
||||
BGblock.tm=rnd(20,30)
|
||||
FX_BGblock.tm=FX_BGblock.tm-1
|
||||
if FX_BGblock.tm==0 then
|
||||
FX_BGblock[#FX_BGblock+1]=getNewBlock()
|
||||
FX_BGblock.tm=rnd(20,30)
|
||||
end
|
||||
end
|
||||
if sceneSwaping then
|
||||
@@ -923,7 +993,7 @@ function love.update(dt)
|
||||
W.alpha=0
|
||||
end--Reset widgets' alpha
|
||||
end
|
||||
Widget.sel=nil
|
||||
widget_sel=nil
|
||||
scene=sceneSwaping.tar
|
||||
sceneInit[scene]()
|
||||
--scene swapped!
|
||||
@@ -937,59 +1007,55 @@ function love.update(dt)
|
||||
for i=#Task,1,-1 do
|
||||
Task[i]:update()
|
||||
end
|
||||
if voicePlaying[1]then
|
||||
if not voicePlaying[1]:isPlaying()then
|
||||
rem(voicePlaying,1)
|
||||
for i=1,#voiceQueue do
|
||||
local Q=voiceQueue[i]
|
||||
if #Q>0 then
|
||||
if type(Q[1])=="userdata"then
|
||||
if not Q[1]:isPlaying()then
|
||||
for i=1,#Q do
|
||||
Q[i]=Q[i+1]
|
||||
end
|
||||
end--play next when stop
|
||||
else
|
||||
local n=1
|
||||
local L=voiceBank[Q[1]]
|
||||
::L::if L[n]:isPlaying()then
|
||||
n=n+1
|
||||
if not L[n]then
|
||||
L[n]=L[n-1]:clone()
|
||||
L[n]:seek(0)
|
||||
goto quit
|
||||
end
|
||||
goto L
|
||||
end::quit::
|
||||
Q[1]=L[n]
|
||||
Q[1]:setVolume(setting.voc*.125)
|
||||
Q[1]:play()
|
||||
--load voice with string
|
||||
end
|
||||
end
|
||||
if voicePlaying[1] and not voicePlaying[1]:isPlaying()then voicePlaying[1]:play()end
|
||||
end
|
||||
for k,W in next,Widget[scene]do
|
||||
if W.type=="button"then
|
||||
local t=W==Widget.sel and .4 or 0
|
||||
W.alpha=abs(W.alpha-t)>.02 and(W.alpha+(W.alpha<t and .02 or -.02))or t
|
||||
if W.alpha>t then W.alpha=W.alpha-.02 elseif W.alpha<t then W.alpha=W.alpha+.02 end
|
||||
end
|
||||
end--update Widgets
|
||||
-- for k,W in next,Widget[scene]do
|
||||
-- end--update Widgets
|
||||
end
|
||||
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
||||
function love.draw()
|
||||
gc.discard()--SPEED UPUPUP!
|
||||
Pnt.BG[setting.bg and curBG or"grey"]()
|
||||
gc.setColor(1,1,1,.2)
|
||||
for n=1,#BGblock do
|
||||
local b,img=BGblock[n].b,blockSkin[BGblock[n].bn]
|
||||
local size=BGblock[n].size
|
||||
for n=1,#FX_BGblock do
|
||||
local b,img=FX_BGblock[n].b,blockSkin[FX_BGblock[n].bn]
|
||||
local size=FX_BGblock[n].size
|
||||
for i=1,#b do for j=1,#b[1]do
|
||||
if b[i][j]then
|
||||
gc.draw(img,BGblock[n].x+(j-1)*30*size,BGblock[n].y+(i-1)*30*size,nil,size)
|
||||
gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_BGblock[n].y+(i-1)*30*size,nil,size)
|
||||
end
|
||||
end end
|
||||
end
|
||||
if Pnt[scene]then Pnt[scene]()end
|
||||
for k,W in next,Widget[scene]do
|
||||
if not(W.hide and W.hide())then
|
||||
if W.type=="button"then
|
||||
local C=W.color
|
||||
gc.setColor(C[1],C[2],C[3],W.alpha)
|
||||
gc.rectangle("fill",W.x,W.y,W.w,W.h)
|
||||
gc.setColor(C)
|
||||
gc.setLineWidth(3)gc.rectangle("line",W.x,W.y,W.w,W.h,4)
|
||||
gc.setColor(C[1],C[2],C[3],.3)
|
||||
gc.setLineWidth(5)gc.rectangle("line",W.x,W.y,W.w,W.h,4)
|
||||
local t=W.text
|
||||
if t then
|
||||
if type(t)=="function"then t=t()end
|
||||
setFont(W.font)
|
||||
local x=W.x+W.w*.5
|
||||
local y0=W.y+W.h*.5-currentFont*.64
|
||||
gc.printf(t,x-201,y0+2,400,"center")
|
||||
gc.printf(t,x-199,y0+2,400,"center")
|
||||
gc.printf(t,x-201,y0,400,"center")
|
||||
gc.printf(t,x-199,y0,400,"center")
|
||||
gc.setColor(C)
|
||||
mStr(t,x,y0+1)
|
||||
end
|
||||
end
|
||||
W:draw()
|
||||
end
|
||||
end--Draw widgets
|
||||
if mouseShow and not touching then
|
||||
@@ -1000,7 +1066,27 @@ function love.draw()
|
||||
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
|
||||
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
|
||||
end--Awesome mouse!
|
||||
if sceneSwaping then sceneSwaping.draw()end--Swaping animation
|
||||
gc.setColor(1,1,1)
|
||||
if powerInfoCanvas and scene~="draw"then
|
||||
gc.draw(powerInfoCanvas)
|
||||
end--Power Info
|
||||
gc.setLineWidth(6)
|
||||
for i=1,#sysFX do
|
||||
local S=sysFX[i]
|
||||
if S[1]==0 then
|
||||
gc.setColor(1,1,1,1-S[2]/S[3])
|
||||
local r=(10*S[2]/S[3])^1.2
|
||||
gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
|
||||
--Ripple
|
||||
elseif S[1]==1 then
|
||||
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
|
||||
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
|
||||
--Shade
|
||||
end
|
||||
end--sysFXs
|
||||
if sceneSwaping then
|
||||
sceneSwaping.draw()
|
||||
end--Swaping animation
|
||||
if scr.r~=.5625 then
|
||||
gc.setColor(0,0,0)
|
||||
if scr.r>.5625 then
|
||||
@@ -1013,24 +1099,21 @@ function love.draw()
|
||||
gc.rectangle("fill",1280,0,d,720)
|
||||
end--wide
|
||||
end--Black side
|
||||
gc.setColor(1,1,1)
|
||||
if powerInfoCanvas and scene~="draw"then
|
||||
gc.draw(powerInfoCanvas)
|
||||
end
|
||||
setFont(20)
|
||||
gc.print(tm.getFPS(),5,700)
|
||||
if devMode>0 then
|
||||
if devMode==2 then
|
||||
gc.setColor(1,1,0)
|
||||
end
|
||||
gc.print(mx.." "..my,5,640)
|
||||
gc.print(#freeRow.."/"..freeRow.L,5,660)
|
||||
gc.print(gcinfo(),5,680)
|
||||
gc.setColor(1,1,devMode==2 and 0 or 1)
|
||||
gc.print("Tasks:"..#Task,5,600)
|
||||
gc.print("Voices:"..#voiceQueue,5,620)
|
||||
gc.print("Mouse:"..mx.." "..my,5,640)
|
||||
gc.print("Free Row:"..#freeRow.."/"..freeRow.L,5,660)
|
||||
gc.print("Cache used:"..gcinfo(),5,680)
|
||||
end
|
||||
end
|
||||
function love.run()
|
||||
local lastFrame,lastUpdatePowerInfo=Timer(),Timer()
|
||||
local readyDrawFrame=0
|
||||
local T=love.timer
|
||||
local PUMP,POLL=love.event.pump,love.event.poll
|
||||
love.resize(gc.getWidth(),gc.getHeight())
|
||||
scene="load"sceneInit.load()--System Launch
|
||||
@@ -1040,8 +1123,8 @@ function love.run()
|
||||
if N=="quit"then destroyPlayers()return 0
|
||||
elseif love[N]then love[N](a,b,c,d,e)end
|
||||
end
|
||||
tm.step()
|
||||
love.update(tm.getDelta())
|
||||
T.step()
|
||||
love.update(T.getDelta())
|
||||
if not wd.isMinimized()then
|
||||
readyDrawFrame=readyDrawFrame+setting.frameMul
|
||||
if readyDrawFrame>=100 then
|
||||
@@ -1056,7 +1139,7 @@ function love.run()
|
||||
lastUpdatePowerInfo=Timer()
|
||||
end
|
||||
until Timer()-lastFrame>.0133
|
||||
tm.sleep(.003)
|
||||
T.sleep(.003)
|
||||
lastFrame=Timer()
|
||||
end
|
||||
end
|
||||
@@ -1067,7 +1150,7 @@ if fs.getInfo("userdata")then
|
||||
end
|
||||
if fs.getInfo("usersetting")then
|
||||
loadSetting()
|
||||
elseif system=="Android" or system=="iOS"then
|
||||
elseif mobile then
|
||||
setting.virtualkeySwitch=true
|
||||
setting.swap=false
|
||||
end
|
||||
|
||||
123
paint.lua
123
paint.lua
@@ -106,12 +106,12 @@ local function stencil_miniTitle()
|
||||
end
|
||||
end
|
||||
|
||||
FX={
|
||||
flash=0,--Black screen(frame)
|
||||
shake=0,--Screen shake(frame)
|
||||
attack={},--Attack beam
|
||||
badge={},--badge thrown
|
||||
|
||||
FX_BGblock={tm=150,next=7,ct=0,list={{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},}}--Falling tetrominos on background
|
||||
FX_attack={}--Attack beam
|
||||
FX_badge={}--Badge thrown
|
||||
sysFX={}
|
||||
FX_ripple={}--Ripple&SqrShade
|
||||
textFX={
|
||||
appear=function(t,a)
|
||||
setFont(t.font)
|
||||
gc.setColor(1,1,1,a)
|
||||
@@ -332,17 +332,17 @@ function Pnt.intro()
|
||||
end
|
||||
function Pnt.main()
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(titleImage,280,30,nil,1.3)
|
||||
setFont(30)
|
||||
gc.print(gameVersion,290,125)
|
||||
gc.print(system,845,95)
|
||||
gc.draw(coloredTitleImage,280,30,nil,1.3)
|
||||
gc.draw(drawableText.warning,570,128)
|
||||
setFont(35)
|
||||
gc.print(gameVersion,290,125)
|
||||
gc.print(system,840,95)
|
||||
mStr(modeLevel[modeID[modeSel]][levelSel],160,180)
|
||||
mStr(text.modeName[modeSel],160,380)
|
||||
end
|
||||
function Pnt.mode()
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(titleImage,810,30)
|
||||
gc.draw(titleImage,830,30)
|
||||
setFont(40)
|
||||
gc.setColor(modeLevelColor[modeLevel[modeID[modeSel]][levelSel]]or color.white)
|
||||
mStr(modeLevel[modeID[modeSel]][levelSel],270,215)
|
||||
@@ -368,29 +368,37 @@ function Pnt.music()
|
||||
gc.draw(drawableText.musicRoom,20,20)
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(drawableText.musicRoom,22,23)
|
||||
gc.draw(drawableText.nowPlaying,490,110)
|
||||
gc.draw(drawableText.nowPlaying,490,390)
|
||||
setFont(35)
|
||||
for i=1,#musicID do
|
||||
gc.print(musicID[i],50,90+30*i)
|
||||
end
|
||||
setFont(50)
|
||||
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
|
||||
mStr(bgmPlaying or"",630,180)
|
||||
gc.draw(titleImage,640,310,nil,1.5,nil,206,35)
|
||||
if bgmPlaying then
|
||||
setFont(50)
|
||||
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
|
||||
mStr(bgmPlaying or"",630,460)
|
||||
local t=-Timer()%2.3/2
|
||||
if t<1 then
|
||||
gc.setColor(1,1,1,t)
|
||||
gc.draw(coloredTitleImage,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
|
||||
end
|
||||
end
|
||||
end
|
||||
function Pnt.custom()
|
||||
gc.setColor(1,1,1,.3+sin(Timer()*8)*.2)
|
||||
gc.rectangle("fill",25,95+40*sel,465,40)
|
||||
gc.rectangle("fill",25,95+40*sel,480,40)
|
||||
gc.setColor(.8,.8,.8)gc.draw(drawableText.custom,20,20)
|
||||
gc.setColor(1,1,1)gc.draw(drawableText.custom,22,23)
|
||||
setFont(40)
|
||||
for i=1,#customID do
|
||||
local k=customID[i]
|
||||
local y=90+40*i
|
||||
gc.printf(text.customOption[k],30,y,320,"right")
|
||||
gc.printf(text.customOption[k],15,y,320,"right")
|
||||
if text.customVal[k]then
|
||||
gc.print(text.customVal[k][customSel[i]],350,y)
|
||||
gc.print(text.customVal[k][customSel[i]],335,y)
|
||||
else
|
||||
gc.print(customRange[k][customSel[i]],350,y)
|
||||
gc.print(customRange[k][customSel[i]],335,y)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -698,32 +706,32 @@ function Pnt.play()
|
||||
end
|
||||
end--Draw players
|
||||
gc.setLineWidth(5)
|
||||
for i=1,#FX.attack do
|
||||
local A=FX.attack[i]
|
||||
for i=1,#FX_attack do
|
||||
local A=FX_attack[i]
|
||||
gc.push("transform")
|
||||
local a=A.a
|
||||
if A.t<20 then
|
||||
gc.translate(A.x1,A.y1)
|
||||
a=a*A.t*.05
|
||||
elseif A.t<80 then
|
||||
local t=((A.t-20)*.016667)t=(3-2*t)*t*t
|
||||
gc.translate(A.x1*(1-t)+A.x2*t,A.y1*(1-t)+A.y2*t)
|
||||
else
|
||||
gc.translate(A.x2,A.y2)
|
||||
a=a*(5-A.t*.05)
|
||||
end
|
||||
gc.rotate(A.t*.1)
|
||||
local a=A.t<10 and A.a*A.t*.05 or A.t>50 and A.a*(6-A.t*.1)or A.a
|
||||
gc.setColor(A.r,A.g,A.b,a*.5)
|
||||
gc.circle("line",0,0,A.rad,A.corner)
|
||||
local L=A.drag
|
||||
for i=1,#L,2 do
|
||||
gc.setColor(A.r,A.g,A.b,a*i*.05)
|
||||
gc.translate(L[i],L[i+1])
|
||||
gc.rotate(A.t*.1)
|
||||
gc.circle("fill",0,0,A.rad,A.corner)
|
||||
gc.rotate(-A.t*.1)
|
||||
gc.translate(-L[i],-L[i+1])
|
||||
end
|
||||
gc.setColor(A.r,A.g,A.b,a)
|
||||
gc.translate(A.x,A.y)
|
||||
gc.rotate(A.t*.1)
|
||||
gc.circle("fill",0,0,A.rad,A.corner)
|
||||
gc.pop()
|
||||
end
|
||||
gc.setColor(1,1,1)
|
||||
if setting.virtualkeySwitch then drawVirtualkey()end
|
||||
if modeEnv.royaleMode then
|
||||
for i=1,#FX.badge do
|
||||
local b=FX.badge[i]
|
||||
for i=1,#FX_badge do
|
||||
local b=FX_badge[i]
|
||||
gc.setColor(1,1,1,b.t<10 and b.t*.1 or b.t<50 and 1 or(60-b.t)*.1)
|
||||
if b.t<10 then
|
||||
gc.draw(badgeIcon,b[1]-14,b[2]-14)
|
||||
@@ -751,9 +759,9 @@ function Pnt.play()
|
||||
end
|
||||
end
|
||||
if restartCount>0 then
|
||||
gc.setColor(1,.7,.7,.5+restartCount*.02)
|
||||
gc.arc("fill",640,360,735,-1.5708,restartCount*0.3696-1.5708)
|
||||
gc.setColor(0,0,0,restartCount/17)
|
||||
-- gc.setColor(1,.7,.7,.5+restartCount*.02)
|
||||
-- gc.arc("fill",640,360,735,-1.5708,restartCount*0.3696-1.5708)
|
||||
gc.setColor(0,0,0,restartCount/20)
|
||||
gc.rectangle("fill",0,0,1280,720)
|
||||
end
|
||||
end
|
||||
@@ -764,7 +772,7 @@ function Pnt.pause()
|
||||
gc.setColor(1,1,1,pauseTimer*.02)
|
||||
setFont(30)
|
||||
if pauseCount>0 then
|
||||
gc.print(text.pauseTime..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
|
||||
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
|
||||
end
|
||||
for i=1,7 do
|
||||
gc.print(text.stat[i+3],110,30*i+270)
|
||||
@@ -777,21 +785,24 @@ function Pnt.pause()
|
||||
setFont(40)
|
||||
if system~="Android"then
|
||||
mStr(text.space.."/"..text.enter,640,335)
|
||||
gc.print("ESC",610,509)
|
||||
gc.print("ESC",610,506)
|
||||
end
|
||||
mDraw(gamefinished and drawableText.finish or drawableText.pause,640,60-10*(5-pauseTimer*.1)^1.5)
|
||||
end
|
||||
function Pnt.setting()
|
||||
function Pnt.setting_game()
|
||||
gc.setColor(1,1,1)
|
||||
setFont(35)
|
||||
mStr("DAS:"..setting.das,290,278)
|
||||
mStr("ARR:"..setting.arr,506,278)
|
||||
setFont(21)
|
||||
mStr(text.softdropdas..setting.sddas,290,357)
|
||||
mStr(text.softdroparr..setting.sdarr,506,357)
|
||||
gc.draw(blockSkin[7-int(Timer()*2)%7],820,480,nil,2)
|
||||
setFont(40)
|
||||
mStr("DAS:"..setting.das,260,95)
|
||||
mStr("ARR:"..setting.arr,560,95)
|
||||
setFont(28)
|
||||
mStr(text.softdropdas..setting.sddas,260,213)
|
||||
mStr(text.softdroparr..setting.sdarr,560,213)
|
||||
end
|
||||
function Pnt.setting2()
|
||||
function Pnt.setting_graphic()
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(blockSkin[7-int(Timer()*2)%7],1020,420,nil,2)
|
||||
end
|
||||
function Pnt.setting_control()
|
||||
local a=.3+sin(Timer()*15)*.1
|
||||
if keyboardSetting then
|
||||
gc.setColor(1,.5,.5,a)
|
||||
@@ -826,7 +837,7 @@ function Pnt.setting2()
|
||||
gc.print("P"..int(curBoard*.5+.5).."/P4",420,560)
|
||||
gc.print(curBoard.."/8",580,560)
|
||||
end
|
||||
function Pnt.setting3()
|
||||
function Pnt.setting_touch()
|
||||
VirtualkeyPreview()
|
||||
local d=snapLevelValue[snapLevel]
|
||||
if d>=10 then
|
||||
@@ -846,7 +857,7 @@ function Pnt.help()
|
||||
for i=1,11 do
|
||||
gc.printf(text.help[i],140,15+43*i,1000,"center")
|
||||
end
|
||||
gc.draw(titleImage,250,600,.2,1+.05*sin(Timer()*2),nil,212,35)
|
||||
gc.draw(titleImage,250,600,.2,1+.05*sin(Timer()*2),nil,206,35)
|
||||
gc.setLineWidth(5)
|
||||
gc.rectangle("line",17,17,260,260)
|
||||
gc.rectangle("line",1077,17,186,186)
|
||||
@@ -865,15 +876,17 @@ function Pnt.stat()
|
||||
gc.print(text.stat[i],400,30*i-5)
|
||||
gc.print(statOpt(i),720,30*i-5)
|
||||
end
|
||||
gc.draw(titleImage,260,600,.2+.07*sin(Timer()*3),nil,nil,212,35)
|
||||
gc.draw(titleImage,260,600,.2+.07*sin(Timer()*3),nil,nil,206,35)
|
||||
end
|
||||
function Pnt.history()
|
||||
gc.setColor(.2,.2,.2,.7)
|
||||
gc.rectangle("fill",150,35,980,530)
|
||||
gc.rectangle("fill",30,45,1000,632)
|
||||
gc.setColor(1,1,1)
|
||||
gc.setLineWidth(4)
|
||||
gc.rectangle("line",150,35,980,530)
|
||||
gc.rectangle("line",30,45,1000,632)
|
||||
setFont(25)
|
||||
gc.print(updateLog[sel],160,40)
|
||||
for i=0,min(22,#updateLog-sel)do
|
||||
gc.print(updateLog[sel+i],40,50+27*(i))
|
||||
end
|
||||
end
|
||||
return Pnt
|
||||
@@ -46,6 +46,7 @@ c:release()
|
||||
|
||||
gc.setDefaultFilter("linear","linear")
|
||||
titleImage=N("/image/mess/title.png")
|
||||
coloredTitleImage=N("/image/mess/title_colored.png")
|
||||
dialCircle=N("/image/mess/dialCircle.png")
|
||||
dialNeedle=N("/image/mess/dialNeedle.png")
|
||||
badgeIcon=N("/image/mess/badge.png")
|
||||
@@ -69,5 +70,6 @@ drawableText={
|
||||
setting2Help=T(25),
|
||||
musicRoom=T(80),
|
||||
nowPlaying=T(50),
|
||||
warning=T(30),
|
||||
}
|
||||
c=gc.setCanvas()
|
||||
70
timer.lua
70
timer.lua
@@ -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
|
||||
|
||||
91
toolfunc.lua
91
toolfunc.lua
@@ -24,7 +24,6 @@ end
|
||||
function mDraw(s,x,y)
|
||||
gc.draw(s,x-s:getWidth()*.5,y)
|
||||
end
|
||||
|
||||
function destroyPlayers()
|
||||
if players then
|
||||
for _,P in next,players do if P.id then
|
||||
@@ -75,16 +74,13 @@ local drawableTextLoad={
|
||||
"setting2Help",
|
||||
"musicRoom",
|
||||
"nowPlaying",
|
||||
"warning",
|
||||
}
|
||||
function swapLanguage(l)
|
||||
text=require("language/"..langID[l])
|
||||
Widget.sel=nil
|
||||
for S,L in next,Widget do
|
||||
for N,W in next,L do
|
||||
if W.type=="button"then
|
||||
W.alpha=0
|
||||
W.text=text.ButtonText[S][N]
|
||||
end
|
||||
W.text=text.WidgetText[S][N]
|
||||
end
|
||||
end
|
||||
gc.push("transform")
|
||||
@@ -109,6 +105,7 @@ function changeBlockSkin(n)
|
||||
n=n-1
|
||||
gc.push("transform")
|
||||
gc.origin()
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,13 do
|
||||
gc.setCanvas(blockSkin[i])
|
||||
gc.draw(blockImg,30-30*i,-30*n)
|
||||
@@ -126,7 +123,7 @@ function VIB(t)
|
||||
end
|
||||
end
|
||||
function SFX(s,v)
|
||||
if setting.sfx then
|
||||
if setting.sfx>0 then
|
||||
local n=1
|
||||
::L::if sfx[s][n]:isPlaying()then
|
||||
n=n+1
|
||||
@@ -137,20 +134,32 @@ function SFX(s,v)
|
||||
end
|
||||
goto L
|
||||
end::quit::
|
||||
sfx[s][n]:setVolume(v or 1)
|
||||
sfx[s][n]:setVolume((v or 1)*setting.sfx*.125)
|
||||
sfx[s][n]:play()
|
||||
end
|
||||
end
|
||||
function VOICE(s,n)
|
||||
if setting.voc then
|
||||
voicePlaying[#voicePlaying+1]=voice[s][n or rnd(#voice[s])]
|
||||
if #voicePlaying==1 then
|
||||
voicePlaying[1]:play()
|
||||
function getFreeVoiceChannel()
|
||||
local i=#voiceQueue
|
||||
for i=1,i do
|
||||
if #voiceQueue[i]==0 then return i end
|
||||
end
|
||||
voiceQueue[i+1]={}
|
||||
return i+1
|
||||
end
|
||||
function VOICE(s,chn)
|
||||
if setting.voc>0 then
|
||||
if chn then
|
||||
voiceQueue[chn][#voiceQueue[chn]+1]=voiceList[s][rnd(#voiceList[s])]
|
||||
--添加到[chn]
|
||||
else
|
||||
local P=#voiceQueue
|
||||
voiceQueue[P+1]={voiceList[s][rnd(#voiceList[s])]}
|
||||
--新建[chn]
|
||||
end
|
||||
end
|
||||
end
|
||||
function BGM(s)
|
||||
if setting.bgm then
|
||||
if setting.bgm>0 then
|
||||
if bgmPlaying~=s then
|
||||
if bgmPlaying then newTask(Event_task.bgmFadeOut,nil,bgmPlaying)end
|
||||
for i=#Task,1,-1 do
|
||||
@@ -167,8 +176,19 @@ function BGM(s)
|
||||
end
|
||||
bgmPlaying=s
|
||||
else
|
||||
if bgmPlaying then bgm[bgmPlaying]:play()end
|
||||
if bgmPlaying then
|
||||
local v=setting.bgm*.125
|
||||
bgm[bgmPlaying]:setVolume(v)
|
||||
if v>0 then
|
||||
bgm[bgmPlaying]:play()
|
||||
else
|
||||
bgm[bgmPlaying]:pause()
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif bgmPlaying then
|
||||
bgm[bgmPlaying]:pause()
|
||||
bgmPlaying=nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -221,7 +241,7 @@ function gotoScene(s,style)
|
||||
time=swap[style][1],mid=swap[style][2],
|
||||
draw=swap[style].d
|
||||
}
|
||||
Widget.sel=nil
|
||||
widget_sel=nil
|
||||
if style~="none"then
|
||||
SFX("swipe")
|
||||
end
|
||||
@@ -253,8 +273,11 @@ local prevMenu={
|
||||
saveSetting()
|
||||
gotoScene("main")
|
||||
end,
|
||||
setting2="setting",
|
||||
setting3="setting",
|
||||
setting_game= "setting",
|
||||
setting_graphic="setting",
|
||||
setting_sound= "setting",
|
||||
setting_control="setting",
|
||||
setting_touch= "setting",
|
||||
help="main",
|
||||
history="help",
|
||||
stat="main",
|
||||
@@ -339,8 +362,8 @@ function loadSetting()
|
||||
local p=find(t[i],"=")
|
||||
if p then
|
||||
local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
|
||||
if t=="sfx"or t=="bgm"or t=="bgblock"or t=="voc"then
|
||||
setting[t]=v=="true"
|
||||
if t=="sfx"or t=="bgm"or t=="voc"then
|
||||
setting[t]=toN(v:match("[012345678]"))or setting[t]
|
||||
elseif t=="vib"then
|
||||
setting.vib=toN(v:match("[012345]"))or 0
|
||||
elseif t=="fullscreen"then
|
||||
@@ -366,6 +389,8 @@ function loadSetting()
|
||||
end
|
||||
elseif t=="virtualkeyAlpha"then
|
||||
setting.virtualkeyAlpha=min(int(abs(toN(v))),10)
|
||||
elseif t=="ghost"or t=="center"or t=="grid"or t=="swap"or t=="bg"or t=="bgblock"or t=="smo"then
|
||||
setting[t]=v=="true"
|
||||
elseif t=="virtualkeyIcon"or t=="virtualkeySwitch"then
|
||||
setting[t]=v=="true"
|
||||
elseif t=="frameMul"then
|
||||
@@ -373,9 +398,7 @@ function loadSetting()
|
||||
elseif t=="das"or t=="arr"or t=="sddas"or t=="sdarr"then
|
||||
v=toN(v)if not v or v<0 then v=0 end
|
||||
setting[t]=int(v)
|
||||
elseif t=="ghost"or t=="center"or t=="grid"or t=="swap"or t=="bg"or t=="smo"then
|
||||
setting[t]=v=="true"
|
||||
elseif t=="fxs"then
|
||||
elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then
|
||||
setting[t]=toN(v:match("[0123]"))or 0
|
||||
elseif t=="lang"then
|
||||
setting[t]=toN(v:match("[123]"))or 1
|
||||
@@ -386,22 +409,30 @@ function loadSetting()
|
||||
end
|
||||
end
|
||||
local saveOpt={
|
||||
"ghost","center",
|
||||
"grid","swap",
|
||||
"fxs","bg",
|
||||
"das","arr",
|
||||
"sddas","sdarr",
|
||||
"holdR",
|
||||
"swap",
|
||||
|
||||
"ghost","center",
|
||||
"smo","grid",
|
||||
"dropFX",
|
||||
"shakeFX",
|
||||
"atkFX",
|
||||
"frameMul",
|
||||
|
||||
"fullscreen",
|
||||
"bg",
|
||||
"bgblock",
|
||||
"lang",
|
||||
"skin",
|
||||
|
||||
"sfx","bgm",
|
||||
"vib","voc",
|
||||
"fullscreen",
|
||||
"bgblock",
|
||||
"skin","smo",
|
||||
|
||||
"virtualkeyAlpha",
|
||||
"virtualkeyIcon",
|
||||
"virtualkeySwitch",
|
||||
"frameMul",
|
||||
}
|
||||
function saveSetting()
|
||||
local vk={}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
return{
|
||||
[=[Future outlook:
|
||||
Brand New GUI:
|
||||
custom restart method
|
||||
local S=[=[
|
||||
Future outlook:
|
||||
GUI:
|
||||
highscore of most modes
|
||||
custom block color/direction
|
||||
custom sequence
|
||||
virtual key switch(all keys)
|
||||
Normal Things:
|
||||
new cooler attack FX
|
||||
combo mode
|
||||
demo play at main menu
|
||||
any screen size
|
||||
CC smarter(think of gaebage buffer)
|
||||
@@ -17,9 +19,10 @@ return{
|
||||
Encrypt source code(JIT to byte code)
|
||||
infinite 1v1
|
||||
square mode
|
||||
more FXs & 3d features & animations]=],[=[
|
||||
0.7.23:
|
||||
remake all BGM!
|
||||
more FXs & 3d features & animations
|
||||
0.7.24(0.7.23):
|
||||
REMAKE ALL BGM!
|
||||
more settings with brand new GUI!
|
||||
new mode:Master-Final
|
||||
new modes:attacker & defender(not survivor!)
|
||||
add restart button when pause
|
||||
@@ -27,7 +30,8 @@ return{
|
||||
change falling animation
|
||||
new GUI details
|
||||
louder sound
|
||||
code optimized & many bugs fixed]=],[=[
|
||||
code optimized
|
||||
many bugs fixed
|
||||
0.7.22:
|
||||
scoring system
|
||||
smooth dropping
|
||||
@@ -46,7 +50,7 @@ return{
|
||||
0.7.21:
|
||||
new title image
|
||||
more GUI details
|
||||
many bugs fixed]=],[=[
|
||||
many bugs fixed
|
||||
0.7.20:
|
||||
add music room
|
||||
change block/space apperance in draw mode
|
||||
@@ -63,7 +67,7 @@ return{
|
||||
add 2 new block skins
|
||||
new difficulty in infinite mode
|
||||
new background/sound effect in master mode
|
||||
bug fixed]=],[=[
|
||||
bug fixed
|
||||
0.7.18:
|
||||
3 new block skins!(one skin origional by Miya(nya~))
|
||||
better restarting(to prevent mistakenly touching)
|
||||
@@ -79,7 +83,7 @@ return{
|
||||
adjust difficulty of PC train mode
|
||||
adjust vibrate level for mobile devices
|
||||
little optimized
|
||||
bugs fixed]=],[=[
|
||||
bugs fixed
|
||||
0.7.16:
|
||||
bugs fixed
|
||||
change rules of custom puzzle mode
|
||||
@@ -92,7 +96,7 @@ return{
|
||||
can pause game with animation
|
||||
change icon of "Functional key"
|
||||
speed optimized
|
||||
bugs fixed]=],[=[
|
||||
bugs fixed
|
||||
0.7.14:
|
||||
drawing mode in custom game
|
||||
can adjust virtual keys with mouse
|
||||
@@ -103,7 +107,7 @@ return{
|
||||
little game rule change
|
||||
bugs fixed(AI control error)
|
||||
0.7.13:
|
||||
Chniese game name:方块研究所
|
||||
Chinese game name:方块研究所
|
||||
SUPER COOL instant moving effect
|
||||
new b2b bar style & animation
|
||||
new transition animation
|
||||
@@ -111,7 +115,7 @@ return{
|
||||
adjust delay algorithm(probably cause controlfeel changing,please reset your DAS setting)
|
||||
code reconstructed
|
||||
bugs fixed(error when seq=his,size of custom oppo)
|
||||
debug key change to F8]=],[=[
|
||||
debug key change to F8
|
||||
0.7.12:
|
||||
AI learned to switch attack mode
|
||||
seperate master mode from marathon mode
|
||||
@@ -124,7 +128,7 @@ return{
|
||||
grid switch
|
||||
swap target by combo key/press
|
||||
some Chinese translaton editted
|
||||
[reconstruct event system]]=],[=[
|
||||
[reconstruct event system]
|
||||
0.7.11:
|
||||
some Chinese translaton editted
|
||||
add bone block in 2 hardest marathon(new block-fresh system)
|
||||
@@ -135,7 +139,7 @@ return{
|
||||
clearer attacking pointer
|
||||
fix 6 next in classic mode
|
||||
add QR code in help page
|
||||
change some detials]=],[=[
|
||||
change some detials
|
||||
0.7.10:
|
||||
更完全的中文翻译
|
||||
add Classic mode
|
||||
@@ -148,7 +152,7 @@ return{
|
||||
change rotate system
|
||||
change BGM&BG set
|
||||
code optimized
|
||||
fix bugs]=],[=[
|
||||
fix bugs
|
||||
0.7.8:
|
||||
GPU usage decreased much more than before
|
||||
add virtual key animation
|
||||
@@ -163,7 +167,7 @@ return{
|
||||
combine some modes
|
||||
change some GUI
|
||||
more SFXs
|
||||
fix bugs]=],[=[
|
||||
fix bugs
|
||||
0.7.6:
|
||||
new font
|
||||
add DIFFICULTY selection
|
||||
@@ -175,7 +179,7 @@ return{
|
||||
better GUI&change speed&BGM in royale mode
|
||||
more FXs in royale mode
|
||||
fix all attacking bug of royale mode
|
||||
change sequence of TSD-only mode to bag7]=],[=[
|
||||
change sequence of TSD-only mode to bag7
|
||||
0.7.5:
|
||||
reduce difficuly of PC training mode,and add more patterns
|
||||
reduce difficuly of death mode
|
||||
@@ -189,7 +193,7 @@ return{
|
||||
change game icon
|
||||
adjust GUI of royale mode
|
||||
change sequence of TSD-only mode
|
||||
royale mode use LESS GPU]=],[=[
|
||||
royale mode use LESS GPU
|
||||
0.7.4:
|
||||
add a lot of bugs
|
||||
0.7.3:
|
||||
@@ -205,5 +209,15 @@ return{
|
||||
remove non-sense s/z spin double
|
||||
GUI position editted
|
||||
grid BG changed
|
||||
smarter AI]=]
|
||||
}
|
||||
smarter AI
|
||||
]=]
|
||||
local find,sub=string.find,string.sub
|
||||
local L,n,p={},1,1
|
||||
local eof=#S
|
||||
repeat
|
||||
p1=find(S,"\n",p)
|
||||
L[n]=sub(S,p,p1-1)
|
||||
n=n+1
|
||||
p=p1+1
|
||||
until p1==eof
|
||||
return L
|
||||
Reference in New Issue
Block a user