Compare commits

...

6 Commits

Author SHA1 Message Date
MrZ_26
0dbdc9fe42 0.8.2+α 2020-02-04 19:40:51 +08:00
MrZ_26
324435d51a 0.8.2α 2020-02-04 19:40:34 +08:00
MrZ_26
1c384ca51a 0.8.2α 2020-02-04 19:40:21 +08:00
MrZ_26
e196790e2c 0.8.1α 2020-02-04 19:38:58 +08:00
MrZ_26
659a50300d 0.8.0α 2020-02-04 19:38:48 +08:00
MrZ_26
918d17ad9a 0.7.35α 2020-02-04 19:38:28 +08:00
28 changed files with 1566 additions and 1358 deletions

BIN
VOICE/egg_1.ogg Normal file

Binary file not shown.

BIN
VOICE/egg_2.ogg Normal file

Binary file not shown.

View File

@@ -51,22 +51,39 @@ function button:FX()
--[0=ripple],timer,duration,x,y,w,h --[0=ripple],timer,duration,x,y,w,h
end end
function button:draw() function button:draw()
local C=self.color local x,y,w,h=self.x,self.y,self.w,self.h
gc.setColor(C) local r,g,b=unpack(self.color)
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 if self==widget_sel then
gc.rectangle("fill",self.x,self.y,self.w,self.h,4) gc.setColor(r*.7,g*.7,b*.7)
end--Highlight when Selected gc.rectangle("fill",x,y,w,h)
x,y,w,h=x+w,y+h,-w,-h
else
gc.setColor(r*.9,g*.9,b*.9)
gc.rectangle("fill",x,y,w,h)
end
gc.setLineWidth(3)
gc.setColor(.4+r*.6,.4+g*.6,.4+b*.6)
gc.line(x,y+h,x,y,x+w,y)
gc.setColor(r*.6,g*.6,b*.6)
gc.line(x,y+h,x+w,y+h,x+w,y)
if self==widget_sel then
x,y,w,h=x+w,y+h,-w,-h
end
local t=self.text local t=self.text
if t then if t then
if type(t)=="function"then t=t()end if type(t)=="function"then t=t()end
setFont(self.font) setFont(self.font)
local y0=self.y+self.h*.5-self.font*.7 local y0=y+h*.5-self.font*.7
gc.printf(t,self.x-2,y0-1,self.w,"center") gc.setColor(1,1,1,.5)
gc.setColor(C) if self==widget_sel then
gc.printf(t,self.x,y0,self.w,"center") gc.printf(t,x+2,y0+1,w,"center")
gc.setColor(r*.5,g*.5,b*.5)
gc.printf(t,x,y0,w,"center")
else
gc.printf(t,x,y0-1,w,"center")
gc.setColor(r*.6,g*.6,b*.6)
gc.printf(t,x-2,y0-2,w,"center")
end
end end
end end
function button:getInfo() function button:getInfo()
@@ -84,27 +101,32 @@ function newSwitch(x,y,font,disp,code,hide,N)
}for k,v in next,switch do _[k]=v end return _ }for k,v in next,switch do _[k]=v end return _
end end
function switch:isAbove(x,y) function switch:isAbove(x,y)
return x>self.x and x<self.x+100 and y>self.y-20 and y<self.y+20 return x>self.x and x<self.x+50 and y>self.y-25 and y<self.y+25
end end
function switch:FX() function switch:FX()
sysFX[#sysFX+1]=self.disp()and sysFX[#sysFX+1]=self.disp()and
{1,0,15,1,.4,.4,self.x,self.y-20,50,40,0}--Switched on {1,0,15,.4,1,.4,self.x,self.y-25,50,50,0}--Switched on
or{1,0,15,.4,1,.4,self.x+50,self.y-20,50,40,0}--Switched off or{1,0,15,1,.4,.4,self.x,self.y-25,50,50,0}--Switched off
--[1=square fade],timer,duration,r,g,b,x,y,w,h --[1=square fade],timer,duration,r,g,b,x,y,w,h
end end
function switch:draw() function switch:draw()
local x,y=self.x,self.y-20 local x,y=self.x,self.y-25
if self.disp()then if self.disp()then
gc.setColor(.6,1,.6) gc.setColor(.9,1,.9)
gc.rectangle("fill",x+50,y,50,40,3) gc.setLineWidth(6)
--ON gc.line(x+5,y+25,x+18,y+38,x+45,y+11)
end--checked
if self==widget_sel then
gc.setColor(1,1,1,.4)
else else
gc.setColor(1,.6,.6) gc.setColor(1,1,1,.2)
gc.rectangle("fill",x,y,50,40,3) end
--OFF gc.rectangle("fill",x,y,50,50)
end--switch gc.setLineWidth(3)
gc.setColor(1,1,1,self==widget_sel and 1 or .6) gc.setColor(1,1,1)
gc.setLineWidth(3)gc.rectangle("line",x-3,y-3,106,46,5) gc.line(x,y+50,x,y,x+50,y)
gc.setColor(1,1,1,.7)
gc.line(x,y+50,x+50,y+50,x+50,y)
--frame --frame
local t=self.text local t=self.text
if t then if t then
@@ -138,27 +160,34 @@ function slider:FX(pos)
--[1=square fade],timer,duration,r,g,b,x,y,w,h --[1=square fade],timer,duration,r,g,b,x,y,w,h
end end
function slider:draw() function slider:draw()
local S=self==widget_sel local x,y=self.x,self.y
gc.setColor(1,1,1,S and 1 or .5) gc.setColor(1,1,1,self==widget_sel and 1 or .5)
gc.setLineWidth(2) gc.setLineWidth(2)
local x1,x2=self.x,self.x+self.w local x1,x2=x,x+self.w
for p=0,self.unit do for p=0,self.unit do
local x=x1+(x2-x1)*p/self.unit local x=x1+(x2-x1)*p/self.unit
gc.line(x,self.y+7,x,self.y-7) gc.line(x,y+7,x,y-7)
end end
--units --units
gc.setLineWidth(5) gc.setLineWidth(5)
gc.line(x1,self.y,x2,self.y) gc.line(x1,y,x2,y)
--axis --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 local t=self.text
if t then if t then
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(self.font) setFont(self.font)
gc.printf(t,self.x-312,self.y-self.font*.7,300,"right") gc.printf(t,x-312,y-self.font*.7,300,"right")
end end
--text
local x,y=x1+(x2-x1)*self.disp()/self.unit-8,y-15
gc.setColor(.8,.8,.8)
gc.rectangle("fill",x,y,17,30)
gc.setLineWidth(2)
gc.setColor(.5,.5,.5)
gc.line(x,y+30,x+17,y+30,x+17,y)
gc.setColor(1,1,1)
gc.line(x,y+30,x,y,x+17,y)
--block
end end
function slider:getInfo() function slider:getInfo()
print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w)) print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))

View File

@@ -1,5 +1,5 @@
math.randomseed(os.time()) math.randomseed(os.time())
gameVersion="Alpha V0.7.34" gameVersion="Alpha V0.8.2+"
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Save directory name t.identity="Techmino"--Save directory name
t.version="11.1" t.version="11.1"
@@ -10,12 +10,7 @@ function love.conf(t)
t.audio.mixwithsystem=true--Switch on to keep sysBGM t.audio.mixwithsystem=true--Switch on to keep sysBGM
local W=t.window local W=t.window
if math.random()>.26 then W.title="Techmino "..gameVersion
W.title="Techmino "..gameVersion
else
math.randomseed(tonumber(os.date("%Y%j")))
W.title="Your lucky number today:"..math.random(100,626)
end
W.icon="/image/icon.png" W.icon="/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360 W.minwidth,W.minheight=640,360

View File

@@ -34,6 +34,7 @@ local pc_drop={50,45,40,35,30,26,22,18,15,12}
local pc_lock={55,50,45,40,36,32,30} local pc_lock={55,50,45,40,36,32,30}
local pc_fall={18,16,14,12,10,9,8,7,6} local pc_fall={18,16,14,12,10,9,8,7,6}
local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"} local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local Fkey_func={ local Fkey_func={
royale=function(P) royale=function(P)
@@ -75,10 +76,10 @@ end
Event={null=NULL} Event={null=NULL}
function Event.reach_winCheck(P) function Event.reach_winCheck(P)
if P.stat.row>=P.gameEnv.target then if P.stat.row>=P.gameEnv.target then
Event.win(P) Event.win(P,"finish")
end end
end end
function Event.win(P) function Event.win(P,result)
P.alive=false P.alive=false
P.control=false P.control=false
P.timing=false P.timing=false
@@ -100,7 +101,7 @@ function Event.win(P)
end end
end end
if P.human then if P.human then
gamefinished=true gameResult=result or"win"
SFX("win") SFX("win")
VOICE("win") VOICE("win")
if modeEnv.royaleMode then if modeEnv.royaleMode then
@@ -108,7 +109,11 @@ function Event.win(P)
end end
end end
newTask(Event_task.finish,P) newTask(Event_task.finish,P)
P:showText(text.win,"beat",90,nil,.4,curMode.id~="custom") if curMode.id=="custom"then
P:showText(text.win,0,0,90,"beat",.4)
else
P:showText(text.win,0,0,90,"beat",.5,.2)
end
end end
function Event.lose(P) function Event.lose(P)
if P.invincible then if P.invincible then
@@ -139,7 +144,7 @@ function Event.lose(P)
P:changeAtk() P:changeAtk()
P.result="K.O." P.result="K.O."
P.rank=#players.alive+1 P.rank=#players.alive+1
P:showText(P.rank,"appear",60,120,nil,true) P:showText(P.rank,0,-120,60,"appear",1,12)
P.strength=0 P.strength=0
if P.lastRecv then if P.lastRecv then
local A,i=P,0 local A,i=P,0
@@ -185,9 +190,9 @@ function Event.lose(P)
end end
end end
P.gameEnv.keepVisible=P.gameEnv.visible~="show" P.gameEnv.keepVisible=P.gameEnv.visible~="show"
P:showText(text.lose,"appear",90,nil,nil,true) P:showText(text.lose,0,0,90,"appear",.5,.2)
if P.human then if P.human then
gamefinished=true gameResult="lose"
SFX("fail") SFX("fail")
VOICE("lose") VOICE("lose")
if modeEnv.royaleMode then BGM("end")end if modeEnv.royaleMode then BGM("end")end
@@ -249,7 +254,7 @@ function Event.master_score(P)
P.modeData.point,P.modeData.event=500,4 P.modeData.point,P.modeData.event=500,4
Event.win(P) Event.win(P)
else else
P:showText(text.stage(s),"fly",80,-120) P:showText(text.stage(s),0,-120,80,"fly")
end end
SFX("reach") SFX("reach")
end end
@@ -270,7 +275,7 @@ function Event.master_score_hard(P)
if P.modeData.point%100==99 then SFX("blip_1")end if P.modeData.point%100==99 then SFX("blip_1")end
if int(P.modeData.point*.01)>P.modeData.event then if int(P.modeData.point*.01)>P.modeData.event then
local s=P.modeData.event+1;P.modeData.event=s--level up! local s=P.modeData.event+1;P.modeData.event=s--level up!
P:showText(text.stage(s),"fly",80,-120) P:showText(text.stage(s),0,-120,80,"fly")
if s<4 then--first 300 if s<4 then--first 300
if s~=1 then P.gameEnv.lock=P.gameEnv.lock-1 end if s~=1 then P.gameEnv.lock=P.gameEnv.lock-1 end
if s~=2 then P.gameEnv.wait=P.gameEnv.wait-1 end if s~=2 then P.gameEnv.wait=P.gameEnv.wait-1 end
@@ -414,9 +419,9 @@ function Event.newPC(P)
P.gameEnv.lock=pc_lock[s]or 20 P.gameEnv.lock=pc_lock[s]or 20
P.gameEnv.fall=pc_fall[s]or 5 P.gameEnv.fall=pc_fall[s]or 5
if s==10 then if s==10 then
P:showText(text.maxspeed,"appear",100,-140,.6) P:showText(text.maxspeed,0,-140,100,"appear",.6)
else else
P:showText(text.speedup,"appear",40,-140) P:showText(text.speedup,0,-140,40,"appear",.8)
end end
end end
end end
@@ -447,6 +452,9 @@ end
Event_task={} Event_task={}
function Event_task.finish(P) function Event_task.finish(P)
P.endCounter=P.endCounter+1 P.endCounter=P.endCounter+1
if scene.cur~="play"then
return true
end
if P.endCounter>120 then if P.endCounter>120 then
pauseGame() pauseGame()
return true return true
@@ -462,12 +470,12 @@ function Event_task.lose(P)
end end
end end
end end
if P.endCounter==100 then if P.endCounter==120 then
while P.field[1]do while P.field[1]do
removeRow(P.field) removeRow(P.field)
removeRow(P.visTime) removeRow(P.visTime)
end end
if #players==1 then if #players==1 and scene=="play"then
pauseGame() pauseGame()
end end
return true return true
@@ -523,7 +531,7 @@ function Event_task.survivor_easy(P)
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1} P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1}
P.atkBuffer.sum=P.atkBuffer.sum+1 P.atkBuffer.sum=P.atkBuffer.sum+1
P.stat.recv=P.stat.recv+1 P.stat.recv=P.stat.recv+1
if P.modeData.event==45 then P:showText(text.maxspeed,"appear",100,-140,.6)end if P.modeData.event==45 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end
P.counter=0 P.counter=0
P.modeData.event=P.modeData.event+1 P.modeData.event=P.modeData.event+1
end end
@@ -540,7 +548,7 @@ function Event_task.survivor_normal(P)
d%4==3 and{pos=rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3} d%4==3 and{pos=rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3}
P.atkBuffer.sum=P.atkBuffer.sum+d%4+1 P.atkBuffer.sum=P.atkBuffer.sum+d%4+1
P.stat.recv=P.stat.recv+d%4+1 P.stat.recv=P.stat.recv+d%4+1
if P.modeData.event==45 then P:showText(text.maxspeed,"appear",100,-140,.6)end if P.modeData.event==45 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end
P.counter=0 P.counter=0
P.modeData.event=d P.modeData.event=d
end end
@@ -557,7 +565,7 @@ function Event_task.survivor_hard(P)
local R=(P.modeData.event%3<2 and 1 or 3) local R=(P.modeData.event%3<2 and 1 or 3)
P.atkBuffer.sum=P.atkBuffer.sum+R P.atkBuffer.sum=P.atkBuffer.sum+R
P.stat.recv=P.stat.recv+R P.stat.recv=P.stat.recv+R
if P.modeData.event==60 then P:showText(text.maxspeed,"appear",100,-140,.6)end if P.modeData.event==60 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end
P.counter=0 P.counter=0
P.modeData.event=P.modeData.event+1 P.modeData.event=P.modeData.event+1
end end
@@ -570,7 +578,7 @@ function Event_task.survivor_lunatic(P)
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3} P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
P.atkBuffer.sum=P.atkBuffer.sum+4 P.atkBuffer.sum=P.atkBuffer.sum+4
P.stat.recv=P.stat.recv+4 P.stat.recv=P.stat.recv+4
if P.modeData.event==60 then P:showText(text.maxspeed,"appear",100,-140,.6)end if P.modeData.event==60 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end
P.counter=0 P.counter=0
P.modeData.event=P.modeData.event+1 P.modeData.event=P.modeData.event+1
end end
@@ -588,7 +596,7 @@ function Event_task.survivor_ultimate(P)
P.atkBuffer.sum=P.atkBuffer.sum+20 P.atkBuffer.sum=P.atkBuffer.sum+20
P.stat.recv=P.stat.recv+20 P.stat.recv=P.stat.recv+20
P.counter=0 P.counter=0
if P.modeData.event==31 then P:showText(text.maxspeed,"appear",100,-140,.6)end if P.modeData.event==31 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end
P.modeData.event=P.modeData.event+1 P.modeData.event=P.modeData.event+1
end end
end end
@@ -608,16 +616,16 @@ function Event_task.defender_normal(P)
D.event=D.event+1 D.event=D.event+1
D.point=int(108e3/(360-D.event*2))*.1 D.point=int(108e3/(360-D.event*2))*.1
if D.event==25 then if D.event==25 then
P:showText(text.great,"appear",100,-140,.6) P:showText(text.great,0,-140,100,"appear",.6)
pushSpeed=2 pushSpeed=2
P.dropDelay,P.gameEnv.drop=20,20 P.dropDelay,P.gameEnv.drop=20,20
elseif D.event==50 then elseif D.event==50 then
P:showText(text.awesome,"appear",100,-140,.6) P:showText(text.awesome,0,-140,100,"appear",.6)
pushSpeed=3 pushSpeed=3
P.dropDelay,P.gameEnv.drop=10,10 P.dropDelay,P.gameEnv.drop=10,10
elseif D.event==90 then elseif D.event==90 then
P.dropDelay,P.gameEnv.drop=5,5 P.dropDelay,P.gameEnv.drop=5,5
P:showText(text.maxspeed,"appear",100,-140,.6) P:showText(text.maxspeed,0,-140,100,"appear",.6)
end end
end end
end end
@@ -638,15 +646,15 @@ function Event_task.defender_lunatic(P)
D.event=D.event+1 D.event=D.event+1
D.point=int(144e3/(240-2*D.event))*.1 D.point=int(144e3/(240-2*D.event))*.1
if D.event==25 then if D.event==25 then
P:showText(text.great,"appear",100,-140,.6) P:showText(text.great,0,-140,100,"appear",.6)
pushSpeed=3 pushSpeed=3
P.dropDelay,P.gameEnv.drop=4,4 P.dropDelay,P.gameEnv.drop=4,4
elseif D.event==50 then elseif D.event==50 then
P:showText(text.awesome,"appear",100,-140,.6) P:showText(text.awesome,0,-140,100,"appear",.6)
pushSpeed=4 pushSpeed=4
P.dropDelay,P.gameEnv.drop=3,3 P.dropDelay,P.gameEnv.drop=3,3
elseif D.event==75 then elseif D.event==75 then
P:showText(text.maxspeed,"appear",100,-140,.6) P:showText(text.maxspeed,0,-140,100,"appear",.6)
P.dropDelay,P.gameEnv.drop=2,2 P.dropDelay,P.gameEnv.drop=2,2
end end
end end
@@ -673,10 +681,10 @@ function Event_task.attacker_hard(P)
D.event=D.event+1 D.event=D.event+1
D.point=int(72e4/t)*.1 D.point=int(72e4/t)*.1
if D.event==20 then if D.event==20 then
P:showText(text.great,"appear",100,-140,.6) P:showText(text.great,0,-140,100,"appear",.6)
pushSpeed=3 pushSpeed=3
elseif D.event==50 then elseif D.event==50 then
P:showText(text.maxspeed,"appear",100,-140,.6) P:showText(text.maxspeed,0,-140,100,"appear",.6)
end end
end end
end end
@@ -709,13 +717,13 @@ function Event_task.attacker_ultimate(P)
D.event=D.event+1 D.event=D.event+1
D.point=int(s*36e3/t)*.1 D.point=int(s*36e3/t)*.1
if D.event==10 then if D.event==10 then
P:showText(text.great,"appear",100,-140,.6) P:showText(text.great,0,-140,100,"appear",.6)
pushSpeed=4 pushSpeed=4
elseif D.event==20 then elseif D.event==20 then
P:showText(text.awesome,"appear",100,-140,.6) P:showText(text.awesome,0,-140,100,"appear",.6)
pushSpeed=5 pushSpeed=5
elseif D.event==30 then elseif D.event==30 then
P:showText(text.maxspeed,"appear",100,-140,.6) P:showText(text.maxspeed,0,-140,100,"appear",.6)
end end
end end
end end
@@ -791,14 +799,14 @@ modes.sprint={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(60) setFont(55)
local r=max(P.gameEnv.target-P.stat.row,0) local r=max(P.gameEnv.target-P.stat.row,0)
mStr(r,-82,265) mStr(r,-82,265)
if r<21 and r>0 then if r<21 and r>0 then
gc.setLineWidth(4) gc.setLineWidth(4)
gc.setColor(1,r>10 and 0 or rnd(),.5) gc.setColor(1,r>10 and 0 or rnd(),.5)
gc.line(0,600-30*r,300,600-30*r) gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy)
end end
end, end,
} }
@@ -824,8 +832,8 @@ modes.marathon={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(P.stat.row,-82,320) mStr(P.stat.row,-82,320)
mStr(P.gameEnv.target,-82,370) mStr(P.gameEnv.target,-82,370)
gc.rectangle("fill",-125,375,90,4) gc.rectangle("fill",-125,375,90,4)
@@ -865,8 +873,8 @@ modes.master={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(P.modeData.point,-82,320) mStr(P.modeData.point,-82,320)
mStr((P.modeData.event+1)*100,-82,370) mStr((P.modeData.event+1)*100,-82,370)
gc.rectangle("fill",-125,375,90,4) gc.rectangle("fill",-125,375,90,4)
@@ -889,12 +897,12 @@ modes.classic={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(80) setFont(75)
local r=P.gameEnv.target*.1 local r=P.gameEnv.target*.1
mStr(r<11 and 18 or r<22 and r+8 or r==22 and"00"or r==23 and"0a"or format("%x",r*10-220),-82,210) mStr(r<11 and 18 or r<22 and r+8 or r==22 and"00"or r==23 and"0a"or format("%x",r*10-220),-82,210)
mDraw(drawableText.speedLV,-82,290) mDraw(drawableText.speedLV,-82,290)
setFont(50) setFont(45)
mStr(P.stat.row,-82,320) mStr(P.stat.row,-82,320)
mStr(P.gameEnv.target,-82,370) mStr(P.gameEnv.target,-82,370)
gc.rectangle("fill",-125,375,90,4) gc.rectangle("fill",-125,375,90,4)
@@ -913,8 +921,8 @@ modes.zen={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(75) setFont(70)
mStr(max(200-P.stat.row,0),-82,280) mStr(max(200-P.stat.row,0),-82,280)
end, end,
} }
@@ -942,8 +950,8 @@ modes.infinite={
end end
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(P.stat.atk,-82,310) mStr(P.stat.atk,-82,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420)
mDraw(drawableText.atk,-82,363) mDraw(drawableText.atk,-82,363)
@@ -983,7 +991,7 @@ modes.solo={
newPlayer(2,965,360,.5,AITemplate("CC",10,4,true,80000)) newPlayer(2,965,360,.5,AITemplate("CC",10,4,true,80000))
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
end, end,
} }
@@ -1012,7 +1020,7 @@ modes.round={
end end
garbageSpeed=1e4 garbageSpeed=1e4
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
end, end,
} }
@@ -1037,8 +1045,8 @@ modes.tsd={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(80) setFont(75)
mStr(P.modeData.event,-82,330) mStr(P.modeData.event,-82,330)
mDraw(drawableText.tsd,-82,407) mDraw(drawableText.tsd,-82,407)
end, end,
@@ -1088,6 +1096,7 @@ modes.blind={
_20G=true, _20G=true,
drop=0,lock=15, drop=0,lock=15,
wait=10,fall=15, wait=10,fall=15,
next=3,
visible="fast", visible="fast",
freshLimit=15, freshLimit=15,
dropPiece="GM_score", dropPiece="GM_score",
@@ -1101,15 +1110,15 @@ modes.blind={
players[1].modeData.event="M7" players[1].modeData.event="M7"
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) mDraw(drawableText.line,-82,300)
mDraw(drawableText.techrash,-82,420) mDraw(drawableText.techrash,-82,420)
if curMode.lv==6 then if curMode.lv==6 then
mDraw(drawableText.grade,-82,170) mDraw(drawableText.grade,-82,170)
setFont(60) setFont(55)
mStr(P.modeData.event,-82,110) mStr(P.modeData.event,-82,110)
end end
setFont(80) setFont(75)
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
@@ -1135,8 +1144,8 @@ modes.dig={
newPlayer(1,340,15) newPlayer(1,340,15)
pushSpeed=1 pushSpeed=1
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(70) setFont(65)
mStr(P.modeData.event,-82,310) mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375) mDraw(drawableText.wave,-82,375)
end, end,
@@ -1184,8 +1193,8 @@ modes.survivor={
newPlayer(1,340,15) newPlayer(1,340,15)
pushSpeed=curMode.lv>2 and 2 or 1 pushSpeed=curMode.lv>2 and 2 or 1
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(70) setFont(65)
mStr(P.modeData.event,-82,310) mStr(P.modeData.event,-82,310)
mDraw(drawableText.wave,-82,375) mDraw(drawableText.wave,-82,375)
end, end,
@@ -1216,8 +1225,8 @@ modes.defender={
pushSpeed=2 pushSpeed=2
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(60) setFont(55)
mStr(P.modeData.event,-82,200) mStr(P.modeData.event,-82,200)
mStr(P.modeData.point,-82,320) mStr(P.modeData.point,-82,320)
mDraw(drawableText.wave,-82,260) mDraw(drawableText.wave,-82,260)
@@ -1248,8 +1257,8 @@ modes.attacker={
pushSpeed=2 pushSpeed=2
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(60) setFont(55)
mStr(P.modeData.event,-82,200) mStr(P.modeData.event,-82,200)
mStr( mStr(
curMode.lv==1 and 24 curMode.lv==1 and 24
@@ -1317,8 +1326,8 @@ modes.tech={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(P.stat.atk,-82,310) mStr(P.stat.atk,-82,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420)
mDraw(drawableText.atk,-82,363) mDraw(drawableText.atk,-82,363)
@@ -1362,9 +1371,8 @@ modes.c4wtrain={
elseif r==6 then F[1][7],F[1][6],F[1][5]=10,10,10 elseif r==6 then F[1][7],F[1][6],F[1][5]=10,10,10
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(max(100-P.stat.row,0),-82,220)
mStr(P.combo,-82,310) mStr(P.combo,-82,310)
mStr(P.modeData.point,-82,400) mStr(P.modeData.point,-82,400)
mDraw(drawableText.combo,-82,358) mDraw(drawableText.combo,-82,358)
@@ -1400,8 +1408,8 @@ modes.pctrain={
newPlayer(1,340,15) newPlayer(1,340,15)
Event.newPC(players[1]) Event.newPC(players[1])
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(80) setFont(75)
mStr(P.stat.pc,-82,330) mStr(P.stat.pc,-82,330)
mDraw(drawableText.pc,-82,412) mDraw(drawableText.pc,-82,412)
end, end,
@@ -1436,11 +1444,11 @@ modes.pcchallenge={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(50) setFont(45)
mStr(max(100-P.stat.row,0),-82,250) mStr(max(100-P.stat.row,0),-82,250)
setFont(80) setFont(75)
mStr(P.stat.pc,-82,350) mStr(P.stat.pc,-82,350)
mDraw(drawableText.pc,-82,432) mDraw(drawableText.pc,-82,432)
@@ -1499,17 +1507,17 @@ modes.techmino49={
n=n+1 n=n+1
end end end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(40) setFont(35)
mStr(#players.alive.."/49",-82,175) mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215) mStr(P.ko,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(25) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
gc.print(P.badge,-47,227) gc.print(P.badge,-47,227)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(30) setFont(25)
gc.print(up0to4[P.strength],-132,290) gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
@@ -1563,17 +1571,17 @@ modes.techmino99={
n=n+1 n=n+1
end end end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(40) setFont(35)
mStr(#players.alive.."/99",-82,175) mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215) mStr(P.ko,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(25) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
gc.print(P.badge,-47,227) gc.print(P.badge,-47,227)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(30) setFont(25)
gc.print(up0to4[P.strength],-132,290) gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
@@ -1602,8 +1610,8 @@ modes.drought={
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(75) setFont(70)
mStr(max(100-P.stat.row,0),-82,280) mStr(max(100-P.stat.row,0),-82,280)
end, end,
} }
@@ -1631,7 +1639,7 @@ modes.hotseat={
newPlayer(4,955,160,.5) newPlayer(4,955,160,.5)
end end
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
end, end,
} }
@@ -1689,31 +1697,20 @@ modes.custom={
modeEnv.bg=customRange.bg[customSel[12]] modeEnv.bg=customRange.bg[customSel[12]]
modeEnv.bgm=customRange.bgm[customSel[13]] modeEnv.bgm=customRange.bgm[customSel[13]]
end, end,
mesDisp=function(P) mesDisp=function(P,dx,dy)
setFont(55)
if P.gameEnv.puzzle or P.gameEnv.target>1e10 then if P.gameEnv.puzzle or P.gameEnv.target>1e10 then
setFont(60)
mStr(P.stat.row,-82,225) mStr(P.stat.row,-82,225)
mDraw(drawableText.line,-82,290) mDraw(drawableText.line,-82,290)
else else
setFont(60)
mStr(max(P.gameEnv.target-P.stat.row,0),-82,240) mStr(max(P.gameEnv.target-P.stat.row,0),-82,240)
end end
if P.gameEnv.puzzle and P.modeData.event==0 then if P.gameEnv.puzzle and P.modeData.event==0 then
gc.setLineWidth(3) local m=puzzleMark
for y=1,preField.h do for x=1,10 do for y=1,preField.h do for x=1,10 do
local B=preField[y][x] local T=preField[y][x]
if B>7 then if T~=0 then
gc.setColor(blockColor[B]) gc.draw(m[T],30*x-30+dx,600-30*y+dy)
gc.rectangle("line",30*x-23,607-30*y,16,16)
elseif B>0 then
local c=blockColor[B]
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==-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)
end end
end end end end
end end

View File

@@ -8,10 +8,10 @@ setting={
ghost=true,center=true, ghost=true,center=true,
smo=true,grid=false, smo=true,grid=false,
dropFX=3, dropFX=3,
shakeFX=1, shakeFX=2,
atkFX=3, atkFX=3,
frameMul=100, frameMul=100,
--
fullscreen=false, fullscreen=false,
bg=true, bg=true,
bgblock=true, bgblock=true,

BIN
font.ttf

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

After

Width:  |  Height:  |  Size: 155 B

BIN
image/miya/ch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
image/miya/f1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
image/miya/f2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
image/miya/f3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
image/miya/f4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -9,6 +9,7 @@ local actName={
"落在最左:","落在最右:","列在最左:","列在最右:", "落在最左:","落在最右:","列在最左:","列在最右:",
} }
return{ return{
lang="中文",
atkModeName={"随机","徽章","击杀","反击"}, atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end, royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"}, cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
@@ -31,9 +32,9 @@ return{
speedup="速度加快", speedup="速度加快",
win="胜利", win="胜利",
finish="结束",
lose="失败", lose="失败",
pause="暂停", pause="暂停",
finish="结束",
pauseCount="暂停统计", pauseCount="暂停统计",
custom="自定义游戏", custom="自定义游戏",
@@ -112,7 +113,7 @@ return{
hotseat="友尽模式", hotseat="友尽模式",
}, },
load={"加载语音ing","加载音乐ing","加载音效ing","加载完成",}, load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing",},
tips={ tips={
"不是动画,真的在加载!", "不是动画,真的在加载!",
"大满贯10连击消四全清!", "大满贯10连击消四全清!",
@@ -141,10 +142,11 @@ return{
"有疑问?先看设置有没有你想要的", "有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~", "有建议的话可以把信息反馈给作者~",
"不要按F8", "不要按F8",
"秘密代码:626", "秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机获得最佳体验", "戴上耳机获得最佳体验",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
}, },
stat={ stat={
"游戏运行次数:", "游戏运行次数:",
@@ -193,7 +195,7 @@ return{
warning="禁 止 私 自 传 播", warning="禁 止 私 自 传 播",
WidgetText={ WidgetText={
main={ main={
lang="文-Lang", lang="Lang",
qplay="快速开始", qplay="快速开始",
play="开始", play="开始",
setting="设置", setting="设置",
@@ -298,23 +300,18 @@ return{
bgm="音乐", bgm="音乐",
vib="震动", vib="震动",
voc="语音", voc="语音",
stereo="双声道", stereo="立体声",
back=BK, back=BK,
}, },
setting_key={ setting_key={
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide="显示虚拟按键",
track="按键自动跟踪",
tkset="跟踪设置",
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.VKAlpha.."0%"end, more="更多",
icon="图标",
size="大小",
toggle="开关",
back=BK, back=BK,
size="大小",
}, },
setting_touchSwitch={ setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4], b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
@@ -324,6 +321,11 @@ return{
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20], b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="标准", norm="标准",
pro="专业", pro="专业",
hide="显示虚拟按键",
track="按键自动跟踪",
icon="图标",
tkset="跟踪设置",
alpha="透明度",
back=BK, back=BK,
}, },
setting_trackSetting={ setting_trackSetting={

View File

@@ -9,6 +9,7 @@ local actName={
"落在最左:","落在最右:","列在最左:","列在最右:", "落在最左:","落在最右:","列在最左:","列在最右:",
} }
return{ return{
lang="全中文",
atkModeName={"随机","徽章","击杀","反击"}, atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end, royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"}, cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
@@ -31,9 +32,9 @@ return{
speedup="速度加快", speedup="速度加快",
win="胜利", win="胜利",
finish="结束",
lose="失败", lose="失败",
pause="暂停", pause="暂停",
finish="结束",
pauseCount="暂停统计", pauseCount="暂停统计",
custom="自定义游戏", custom="自定义游戏",
@@ -112,7 +113,7 @@ return{
hotseat="友尽模式", hotseat="友尽模式",
}, },
load={"加载语音ing","加载音乐ing","加载音效ing","加载完成",}, load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing",},
tips={ tips={
"不是动画,真的在加载!", "不是动画,真的在加载!",
"大满贯10连击消四全清!", "大满贯10连击消四全清!",
@@ -141,10 +142,11 @@ return{
"有疑问?先看设置有没有你想要的", "有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~", "有建议的话可以把信息反馈给作者~",
"不要按F8", "不要按F8",
"秘密代码:626", "秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机获得最佳体验", "戴上耳机获得最佳体验",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
}, },
stat={ stat={
"游戏运行次数:", "游戏运行次数:",
@@ -193,7 +195,7 @@ return{
warning="禁 止 私 自 传 播", warning="禁 止 私 自 传 播",
WidgetText={ WidgetText={
main={ main={
lang="全-Lang", lang="Lang",
qplay="快速开始", qplay="快速开始",
play="开始", play="开始",
setting="设置", setting="设置",
@@ -299,23 +301,18 @@ return{
bgm="音乐", bgm="音乐",
vib="震动", vib="震动",
voc="语音", voc="语音",
stereo="双声道", stereo="立体声",
back=BK, back=BK,
}, },
setting_key={ setting_key={
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide="显示虚拟按键",
track="按键自动跟踪",
tkset="跟踪设置",
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.VKAlpha.."0%"end, more="更多",
icon="图标",
size="大小",
toggle="开关",
back=BK, back=BK,
size="大小",
}, },
setting_touchSwitch={ setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4], b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
@@ -325,6 +322,11 @@ return{
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20], b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="标准", norm="标准",
pro="专业", pro="专业",
hide="显示虚拟按键",
track="按键自动跟踪",
icon="图标",
tkset="跟踪设置",
alpha="透明度",
back=BK, back=BK,
}, },
setting_trackSetting={ setting_trackSetting={
@@ -346,4 +348,4 @@ return{
back=BK, back=BK,
}, },
}, },
} }--译

View File

@@ -7,6 +7,7 @@ local actName={
"Left Drop:","Right Drop:","Left INS:","Right INS:", "Left Drop:","Right Drop:","Left INS:","Right INS:",
} }
return{ return{
lang="English",
atkModeName={"Random","Badges","K.O.s","Counters"}, atkModeName={"Random","Badges","K.O.s","Counters"},
royale_remain=function(n)return n.." Players Remain"end, royale_remain=function(n)return n.." Players Remain"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"}, cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
@@ -29,9 +30,9 @@ return{
speedup="Speed up", speedup="Speed up",
win="WIN", win="WIN",
finish="FINISH",
lose="LOSE", lose="LOSE",
pause="PAUSE", pause="PAUSE",
finish="FINISH",
pauseCount="Pause Count", pauseCount="Pause Count",
custom="Custom Game", custom="Custom Game",
@@ -110,7 +111,7 @@ return{
hotseat="", hotseat="",
}, },
load={"Loading VOICE","Loading BGM","Loading SFX","Finished",}, load={[0]="Finished","Loading VOICE","Loading BGM","Loading SFX",},
tips={ tips={
"Not animation,real loading!", "Not animation,real loading!",
"Back to Back 10 combo Techrash PC!", "Back to Back 10 combo Techrash PC!",
@@ -139,11 +140,12 @@ return{
"Find out what's in the setting!", "Find out what's in the setting!",
"Any suggestions to author!", "Any suggestions to author!",
"DO NOT PRESS F8", "DO NOT PRESS F8",
"Secret code:626", "Secret num:626",
"Techmino=Technique+Tetromino", "Techmino=Technique+Tetromino",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"Headphones for better experience", "Headphones for better experience",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(first effective)Your luck number today:"..math.random(100,626),
}, },
stat={ stat={
"Games run:", "Games run:",
@@ -192,7 +194,7 @@ Lib used:
warning="DO NOT DISTRIBUTE", warning="DO NOT DISTRIBUTE",
WidgetText={ WidgetText={
main={ main={
lang="文-Lang", lang="Lang",
qplay="Qplay", qplay="Qplay",
play="Play", play="Play",
setting="Settings", setting="Settings",
@@ -304,16 +306,11 @@ Lib used:
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide="Show Virtual Key",
track="Auto track",
tkset="Track setting",
default="Defaults", default="Defaults",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.VKAlpha.."0%"end, more="More",
icon="Icon",
size="Size",
toggle="Toggle",
back=BK, back=BK,
size="Size",
}, },
setting_touchSwitch={ setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4], b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
@@ -323,6 +320,11 @@ Lib used:
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20], b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="Normal", norm="Normal",
pro="Professioanl", pro="Professioanl",
hide="Show Virtual Key",
track="Auto track",
icon="Icon",
tkset="Track setting",
alpha="Alpha",
back=BK, back=BK,
}, },
setting_trackSetting={ setting_trackSetting={

306
list.lua
View File

@@ -97,6 +97,7 @@ voiceName={
"win","lose", "win","lose",
"bye", "bye",
"nya","voc_nya", "nya","voc_nya",
"egg",
} }
voiceList={ voiceList={
zspin={"zspin_1","zspin_2","zspin_3"}, zspin={"zspin_1","zspin_2","zspin_3"},
@@ -121,6 +122,7 @@ voiceList={
bye={"bye_1","bye_2"}, bye={"bye_1","bye_2"},
nya={"nya_1","nya_2","nya_3","nya_4"}, nya={"nya_1","nya_2","nya_3","nya_4"},
voc_nya={"nya_11","nya_12","nya_13","nya_21","nya_22"}, voc_nya={"nya_11","nya_12","nya_13","nya_21","nya_22"},
egg={"egg_1","egg_2"},
} }
musicID={ musicID={
@@ -168,7 +170,6 @@ customRange={
RCPB={10,33,200,33,105,5,105,60} RCPB={10,33,200,33,105,5,105,60}
snapLevelValue={1,10,20,40,60,80} snapLevelValue={1,10,20,40,60,80}
up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
modeID={ modeID={
[0]="custom", [0]="custom",
"sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind", "sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind",
@@ -212,7 +213,6 @@ local virtualkeySet={
{8, 320, 720-200, 80},--hold {8, 320, 720-200, 80},--hold
{9, 80, 280, 80},--func {9, 80, 280, 80},--func
{10,1280-80, 280, 80},--restart {10,1280-80, 280, 80},--restart
},--Mirrored farter's set,sknaht },--Mirrored farter's set,sknaht
{ {
{1, 80, 720-80, 80},--moveLeft {1, 80, 720-80, 80},--moveLeft
@@ -311,93 +311,104 @@ local function VKAcode(n)
end end
end end
local C=color local C=color
local skinName={
"Normal(MrZ)",
"Jelly(Miya)",
"Plastic(MrZ)",
"Glow(MrZ)",
"Pure(MrZ)",
"Text Bone(MrZ)",
"Colored Bone(MrZ)",
"white Bone(MrZ)",
}
-- T1,T2=0,0 -- T1,T2=0,0
Widget={ Widget={
load={},intro={},quit={}, load={},intro={},quit={},
main={ main={
play= newButton(150,280,200,160,C.red, 60,function()scene.push()scene.swapTo("mode")end, nil,"setting"), play= newButton(150,280,200,160,C.lightRed, 55,function()scene.push()scene.swapTo("mode")end, nil,"setting"),
setting=newButton(370,280,200,160,C.lightBlue, 50,function()scene.push()scene.swapTo("setting_game")end, nil,"music"), setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"),
music= newButton(590,280,200,160,C.lightPurple,37,function()scene.push()scene.swapTo("music")end, nil,"help"), music= newButton(590,280,200,160,C.lightPurple,32,function()scene.push()scene.swapTo("music")end, nil,"help"),
help= newButton(150,460,200,160,C.yellow, 55,function()scene.push()scene.swapTo("help")end, nil,"stat"), help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"),
stat= newButton(370,460,200,160,C.cyan, 48,function()scene.push()scene.swapTo("stat")end, nil,"qplay"), stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"qplay"),
qplay= newButton(540,415,100,70,C.lightGreen, 28,function()scene.push()loadGame(modeSel,levelSel)end, nil,"lang"), qplay= newButton(540,415,100,70,C.lightOrange, 23,function()scene.push()loadGame(modeSel,levelSel)end, nil,"lang"),
lang= newButton(590,505,200,70,C.lightRed, 50,function() lang= newButton(590,505,200,70,C.lightRed, 45,function()
setting.lang=setting.lang%#langName+1 setting.lang=setting.lang%#langName+1
swapLanguage(setting.lang) swapLanguage(setting.lang)
TEXT(text.lang,795,500,50,"appear",1.6)
end,nil,"quit"), end,nil,"quit"),
-- S1= newSlider(520,550,380,10,10,nil,function()return T1 end,function(i)T1=i end), -- S1= newSlider(520,550,380,10,10,nil,function()return T1 end,function(i)T1=i end),
-- S2= newSlider(520,590,380,10,10,nil,function()return T2 end,function(i)T2=i end), -- S2= newSlider(520,590,380,10,10,nil,function()return T2 end,function(i)T2=i end),
quit= newButton(370,620,280,100,C.lightGrey, 60,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"), quit= newButton(370,620,280,100,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"),
}, },
mode={ mode={
up= newButton(1000, 210,200,140,C.white, 80,pressKey("up"), function()return modeSel==1 end), up= newButton(1000, 210,200,140,C.white, 75,pressKey("up"), function()return modeSel==1 end),
down= newButton(1000, 430,200,140,C.white, 80,pressKey("down"), function()return modeSel==#modeID end), down= newButton(1000, 430,200,140,C.white, 75,pressKey("down"), function()return modeSel==#modeID end),
left= newButton(190, 160,100,80, C.white, 40,pressKey("left"), function()return levelSel==1 end), left= newButton(190, 150,100,80, C.white, 35,pressKey("left"), function()return levelSel==1 end),
right= newButton(350, 160,100,80, C.white, 40,pressKey("right"), function()return levelSel==#modes[modeID[modeSel]].level end), right= newButton(350, 150,100,80, C.white, 35,pressKey("right"), function()return levelSel==#modes[modeID[modeSel]].level end),
start= newButton(1000, 600,250,100,C.green, 50,function()scene.push()loadGame(modeSel,levelSel)end), start= newButton(1000, 600,250,100,C.lightGreen, 45,function()scene.push()loadGame(modeSel,levelSel)end),
custom= newButton(275, 420,200,90, C.yellow, 40,function()scene.push()scene.swapTo("custom")end), custom= newButton(275, 460,200,90, C.lightYellow, 35,function()scene.push()scene.swapTo("custom")end),
back= newButton(640, 630,230,90, C.white, 45,scene.back), back= newButton(640, 630,230,90, C.white, 40,scene.back),
}, },
music={ music={
bgm= newSlider(760, 80,400,10,40,nil,SETdisp("bgm"),function(i)setting.bgm=i;BGM(bgmPlaying)end), bgm= newSlider(760, 80,400,10,35,nil,SETdisp("bgm"),function(i)setting.bgm=i;BGM(bgmPlaying)end),
up= newButton(1100, 200,120,120,C.white,60,pressKey("up")), up= newButton(1100, 200,120,120,C.white,55,pressKey("up")),
play= newButton(1100, 340,120,120,C.white,40,pressKey("space"),function()return setting.bgm==0 end), play= newButton(1100, 340,120,120,C.white,35,pressKey("space"),function()return setting.bgm==0 end),
down= newButton(1100, 480,120,120,C.white,60,pressKey("down")), down= newButton(1100, 480,120,120,C.white,55,pressKey("down")),
back= newButton(640, 630,230,90, C.white,45,scene.back), back= newButton(640, 630,230,90, C.white,40,scene.back),
}, },
custom={ custom={
up= newButton(1000, 220,100,100,C.white, 50,function()sel=(sel-2)%#customID+1 end), up= newButton(1000, 220,100,100,C.white, 45,function()sel=(sel-2)%#customID+1 end),
down= newButton(1000, 460,100,100,C.white, 50,function()sel=sel%#customID+1 end), down= newButton(1000, 460,100,100,C.white, 45,function()sel=sel%#customID+1 end),
left= newButton(880, 340,100,100,C.white, 50,pressKey("left")), left= newButton(880, 340,100,100,C.white, 45,pressKey("left")),
right= newButton(1120, 340,100,100,C.white, 50,pressKey("right")), right= newButton(1120, 340,100,100,C.white, 45,pressKey("right")),
start1= newButton(880, 580,220,70, C.green, 40,function()scene.push()loadGame(0,1)end), start1= newButton(880, 580,220,70, C.lightGreen, 35,function()scene.push()loadGame(0,1)end),
start2= newButton(1120, 580,220,70, C.lightPurple, 40,function()scene.push()loadGame(0,2)end), start2= newButton(1120, 580,220,70, C.lightPurple, 35,function()scene.push()loadGame(0,2)end),
draw= newButton(1000, 90, 190,85, C.cyan, 40,function()scene.push()scene.swapTo("draw")end), draw= newButton(1000, 90, 190,85, C.lightCyan, 35,function()scene.push()scene.swapTo("draw")end),
set1= newButton(640, 160,240,75, C.lightRed, 40,function()useDefaultSet(1)end), set1= newButton(640, 160,240,75, C.lightYellow, 35,function()useDefaultSet(1)end),
set2= newButton(640, 250,240,75, C.lightRed, 40,function()useDefaultSet(2)end), set2= newButton(640, 250,240,75, C.lightYellow, 35,function()useDefaultSet(2)end),
set3= newButton(640, 340,240,75, C.lightRed, 40,function()useDefaultSet(3)end), set3= newButton(640, 340,240,75, C.lightYellow, 35,function()useDefaultSet(3)end),
set4= newButton(640, 430,240,75, C.lightRed, 40,function()useDefaultSet(4)end), set4= newButton(640, 430,240,75, C.lightYellow, 35,function()useDefaultSet(4)end),
set5= newButton(640, 520,240,75, C.lightRed, 40,function()useDefaultSet(5)end), set5= newButton(640, 520,240,75, C.lightYellow, 35,function()useDefaultSet(5)end),
back= newButton(640, 630,180,60, C.white, 40,scene.back), back= newButton(640, 630,180,60, C.white, 35,scene.back),
}, },
draw={ draw={
block1= newButton(920, 80, 120,120,C.red, 65,setPen(1)), block1= newButton(920, 80, 120,120,C.red, 60,setPen(1)),
block2= newButton(1060, 80, 120,120,C.green, 65,setPen(2)), block2= newButton(1060, 80, 120,120,C.green, 60,setPen(2)),
block3= newButton(1200, 80, 120,120,C.orange, 65,setPen(3)), block3= newButton(1200, 80, 120,120,C.orange, 60,setPen(3)),
block4= newButton(920, 220,120,120,C.blue, 65,setPen(4)), block4= newButton(920, 220,120,120,C.blue, 60,setPen(4)),
block5= newButton(1060, 220,120,120,C.magenta, 65,setPen(5)), block5= newButton(1060, 220,120,120,C.magenta, 60,setPen(5)),
block6= newButton(1200, 220,120,120,C.yellow, 65,setPen(6)), block6= newButton(1200, 220,120,120,C.yellow, 60,setPen(6)),
block7= newButton(920, 360,120,120,C.cyan, 65,setPen(7)), block7= newButton(920, 360,120,120,C.cyan, 60,setPen(7)),
gb1= newButton(1060, 360,120,120,C.darkGrey, 65,setPen(9)), gb1= newButton(1060, 360,120,120,C.darkGrey, 60,setPen(9)),
gb2= newButton(1200, 360,120,120,C.grey, 65,setPen(10)), gb2= newButton(1200, 360,120,120,C.grey, 60,setPen(10)),
gb3= newButton(920, 500,120,120,C.darkPurple, 65,setPen(11)), gb3= newButton(920, 500,120,120,C.darkPurple, 60,setPen(11)),
gb4= newButton(1060, 500,120,120,C.darkRed, 65,setPen(12)), gb4= newButton(1060, 500,120,120,C.darkRed, 60,setPen(12)),
gb5= newButton(1200, 500,120,120,C.darkGreen, 65,setPen(13)), gb5= newButton(1200, 500,120,120,C.darkGreen, 60,setPen(13)),
clear= newButton(780, 80, 120,120,C.white, 45,pressKey("delete")), clear= newButton(780, 80, 120,120,C.white, 40,pressKey("delete")),
any= newButton(780, 220,120,120,C.lightGrey, 45,setPen(0)), any= newButton(780, 220,120,120,C.lightGrey, 40,setPen(0)),
space= newButton(780, 360,120,120,C.grey, 70,setPen(-1)), space= newButton(780, 360,120,120,C.grey, 65,setPen(-1)),
back= newButton(1200, 640,120,120,C.white, 40,scene.back), back= newButton(1200, 640,120,120,C.white, 35,scene.back),
}, },
play={ play={
pause= newButton(1235,45,80,80,C.white,30,pauseGame), pause= newButton(1235,45,80,80,C.white,25,pauseGame),
}, },
pause={ pause={
resume= newButton(640,290,240,100,C.white,50,resumeGame), resume= newButton(640,290,240,100,C.white,45,resumeGame),
restart=newButton(640,445,240,100,C.white,50,function() restart=newButton(640,445,240,100,C.white,45,function()
clearTask("play") clearTask("play")
updateStat() updateStat()
resetGameData() resetGameData()
scene.swapTo("play","none") scene.swapTo("play","none")
end), end),
setting=newButton(1150,80,200,100,C.yellow,45,function() setting=newButton(1150,80,200,100,C.yellow,40,function()
scene.push() scene.push()
scene.swapTo("setting_sound") scene.swapTo("setting_sound")
end), end),
quit= newButton(640,600,240,100,C.white,50,scene.back), quit= newButton(640,600,240,100,C.white,45,scene.back),
}, },
setting_game={ setting_game={
graphic=newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_graphic")end, nil,"sound"), graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sound"),
sound= newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_sound")end, nil,"dasD"), sound= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"dasD"),
dasD= newButton(180,230,50,50,C.white,40,function() dasD= newButton(180,230,50,50,C.white,40,function()
setting.das=(setting.das-1)%31 setting.das=(setting.das-1)%31
if setting.arr>setting.das then if setting.arr>setting.das then
@@ -434,24 +445,24 @@ Widget={
sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"), sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"),
sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"), sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"),
sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"), sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"),
quickR= newSwitch(560,430,40,SETdisp("quickR"), SETrev("quickR"), nil,"swap"), quickR= newSwitch(580,430,35,SETdisp("quickR"), SETrev("quickR"), nil,"swap"),
swap= newSwitch(560,510,25,SETdisp("swap"), SETrev("swap"), nil,"fine"), swap= newSwitch(580,510,20,SETdisp("swap"), SETrev("swap"), nil,"fine"),
fine= newSwitch(560,590,25,SETdisp("fine"), SETrev("fine"), nil,"ctrl"), fine= newSwitch(580,590,20,SETdisp("fine"), SETrev("fine"), nil,"ctrl"),
ctrl= newButton(1020,230,320,80,C.white,40,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"), ctrl= newButton(1020,230,320,80,C.white,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"),
touch= newButton(1020,340,320,80,C.white,40,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"), touch= newButton(1020,340,320,80,C.white,35,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"),
back= newButton(1160,600,160,160,C.white,55,scene.back,nil,"graphic"), back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"graphic"),
}, },
setting_graphic={ setting_graphic={
sound= newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_sound")end, nil,"game"), sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"),
game= newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_game")end, nil,"ghost"), game= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"ghost"),
ghost= newSwitch(310,180,40,SETdisp("ghost"), SETdisp("ghost"), nil,"center"), ghost= newSwitch(310,180,35,SETdisp("ghost"), SETrev("ghost"), nil,"center"),
center= newSwitch(580,180,40,SETdisp("center"), SETdisp("center"), nil,"smo"), center= newSwitch(580,180,35,SETdisp("center"), SETrev("center"), nil,"smo"),
smo= newSwitch(310,260,25,SETdisp("smo"), SETdisp("smo"), nil,"grid"), smo= newSwitch(310,260,25,SETdisp("smo"), SETrev("smo"), nil,"grid"),
grid= newSwitch(580,260,40,SETdisp("grid"), SETdisp("grid"), nil,"dropFX"), grid= newSwitch(580,260,30,SETdisp("grid"), SETrev("grid"), nil,"dropFX"),
dropFX= newSlider(310,350,373,3,40,nil,SETdisp("dropFX"), SETsto("dropFX"), nil,"shakeFX"), dropFX= newSlider(310,350,373,5,35,nil,SETdisp("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
shakeFX=newSlider(310,430,373,3,40,nil,SETdisp("shakeFX"), SETsto("shakeFX"), nil,"atkFX"), shakeFX=newSlider(310,430,373,5,35,nil,SETdisp("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
atkFX= newSlider(310,510,373,3,40,nil,SETdisp("atkFX"), SETsto("atkFX"), nil,"frame"), atkFX= newSlider(310,510,373,5,35,nil,SETdisp("atkFX"), SETsto("atkFX"), nil,"frame"),
frame= newSlider(310,590,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"), frame= newSlider(310,590,373,10,35,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,180,40,SETdisp("fullscreen"),function() fullscreen=newSwitch(990,180,40,SETdisp("fullscreen"),function()
setting.fullscreen=not setting.fullscreen setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(setting.fullscreen)
@@ -459,35 +470,31 @@ Widget={
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end end
end,nil,"bg"), end,nil,"bg"),
bg= newSwitch(990,250,40,SETdisp("bg"),SETrev("bg"),nil,"bgblock"), bg= newSwitch(990,250,35,SETdisp("bg"),SETrev("bg"),nil,"bgblock"),
bgblock=newSwitch(990,330,40,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end bgblock=newSwitch(990,330,35,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end
skin= newButton(860,470,120,60,C.white,40,function() skin= newButton(810,420,120,60,C.white,35,function()
setting.skin=setting.skin%8+1 local _=setting.skin%8+1
changeBlockSkin(setting.skin) setting.skin=_
changeBlockSkin(_)
TEXT(skinName[_],850,475,28,"appear")
end,nil,"back"), end,nil,"back"),
back= newButton(1160,600,160,160,C.white,55,scene.back,nil,"sound"), back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"sound"),
}, },
setting_sound={ setting_sound={
game= newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_game")end, nil,"graphic"), game= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_graphic")end, nil,"sfx"), graphic=newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sfx"),
sfx= newSlider(180,250,400,10,40,function()SFX("blip_1")end, SETdisp("sfx"), SETsto("sfx"), nil,"bgm"), sfx= newSlider(180,250,400,10,35,function()SFX("blip_1")end, SETdisp("sfx"), SETsto("sfx"), nil,"bgm"),
bgm= newSlider(750,250,400,10,40,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"), SETsto("bgm"), nil,"vib"), bgm= newSlider(750,250,400,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"), SETsto("bgm"), nil,"vib"),
vib= newSlider(180,440,400,5,40, function()VIB(1)end, SETdisp("vib"), SETsto("vib"), nil,"voc"), vib= newSlider(180,440,400,5 ,35,function()VIB(1)end, SETdisp("vib"), SETsto("vib"), nil,"voc"),
voc= newSlider(750,440,400,10,40,function()VOICE("nya")end, SETdisp("voc"), SETsto("voc"), nil,"stereo"), voc= newSlider(750,440,400,10,35,function()VOICE("nya")end, SETdisp("voc"), SETsto("voc"), nil,"stereo"),
stereo= newSlider(180,630,400,10,40,function()SFX("move",1,-1)SFX("lock",1,1)end, SETdisp("stereo"), SETsto("stereo"),nil,"back"), stereo= newSlider(180,630,400,10,35,function()SFX("move",1,-1)SFX("lock",1,1)end, SETdisp("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"),
back=newButton(1160,600,160,160,C.white,55,scene.back,nil,"game"), back=newButton(1160,600,160,160,C.white,50,scene.back,nil,"game"),
}, },
setting_key={ setting_key={
back=newButton(1140,650,200,80,C.white,50,scene.back), back=newButton(1140,650,200,80,C.white,45,scene.back),
}, },
setting_touch={ setting_touch={
hide= newSwitch(810,140,45,SETdisp("VKSwitch"),SETrev("VKSwitch")), default=newButton(520,80,170,80,C.white,35,function()
track= newSwitch(810,220,45,SETdisp("VKTrack"),SETrev("VKTrack")),
tkset= newButton(450,220,170,80,C.white,30,function()
scene.push()
scene.swapTo("setting_trackSetting")
end,function()return not setting.VKTrack end),
default=newButton(450,320,170,80,C.white,40,function()
local D=virtualkeySet[defaultSel] local D=virtualkeySet[defaultSel]
for i=1,#VK_org do for i=1,#VK_org do
VK_org[i].ava=false VK_org[i].ava=false
@@ -502,73 +509,76 @@ Widget={
end--Replace keys end--Replace keys
defaultSel=defaultSel%5+1 defaultSel=defaultSel%5+1
end), end),
snap= newButton(640,320,170,80,C.white,40,function() snap= newButton(760,80,170,80,C.white,35,function()
snapLevel=snapLevel%6+1 snapLevel=snapLevel%6+1
end), end),
--VK=T,70,50,27/T,130,50,27/T,190,50,27/T,250,50,27/T,310,50,27/T,370,50,27/T,430,50,27/T,490,50,27/T,550,50,27/T,610,50,27/T,670,50,27/T,730,50,27/T,790,50,27/T,850,50,27/T,910,50,27/T,970,50,27/T,739,789,897/T,1090,50,27/T,1150,50,27/T,1210,50,27 more= newButton(520,180,170,80,C.white,40,function()
alpha= newButton(830,320,170,80,C.white,45,function()
setting.VKAlpha=(setting.VKAlpha+1)%11
--Adjust virtualkey alpha
end),
icon= newButton(495,420,260,80,C.white,45,SETrev("VKIcon")),
--Switch virtualkey icon
size= newButton(785,420,260,80,C.white,45,function()
if sel then
local B=VK_org[sel]
B.r=B.r+10
if B.r>=150 then B.r=B.r-110 end
end
end),
toggle= newButton(495,520,260,80,C.white,45,function()
scene.push() scene.push()
scene.swapTo("setting_touchSwitch") scene.swapTo("setting_touchSwitch")
end), end),
back= newButton(785,520,260,80,C.white,45,scene.back), back= newButton(760,180,170,80,C.white,40,scene.back),
size= newSlider(360,120,560,14,40,nil,function()
return VK_org[sel].r/10-1
end,
function(v)
if sel then
VK_org[sel].r=10+v*10
end
end,
function()return not sel end),
}, },
setting_touchSwitch={ setting_touchSwitch={
b1= newSwitch(300,80, 40,VKAdisp(1),VKAcode(1)), b1= newSwitch(280,80, 35,VKAdisp(1),VKAcode(1)),
b2= newSwitch(300,140, 40,VKAdisp(2),VKAcode(2)), b2= newSwitch(280,140, 35,VKAdisp(2),VKAcode(2)),
b3= newSwitch(300,200, 40,VKAdisp(3),VKAcode(3)), b3= newSwitch(280,200, 35,VKAdisp(3),VKAcode(3)),
b4= newSwitch(300,260, 40,VKAdisp(4),VKAcode(4)), b4= newSwitch(280,260, 35,VKAdisp(4),VKAcode(4)),
b5= newSwitch(300,320, 40,VKAdisp(5),VKAcode(5)), b5= newSwitch(280,320, 35,VKAdisp(5),VKAcode(5)),
b6= newSwitch(300,380, 40,VKAdisp(6),VKAcode(6)), b6= newSwitch(280,380, 35,VKAdisp(6),VKAcode(6)),
b7= newSwitch(300,440, 40,VKAdisp(7),VKAcode(7)), b7= newSwitch(280,440, 35,VKAdisp(7),VKAcode(7)),
b8= newSwitch(300,500, 40,VKAdisp(8),VKAcode(8)), b8= newSwitch(280,500, 35,VKAdisp(8),VKAcode(8)),
b9= newSwitch(300,560, 40,VKAdisp(9),VKAcode(9)), b9= newSwitch(280,560, 35,VKAdisp(9),VKAcode(9)),
b10= newSwitch(300,620, 40,VKAdisp(10),VKAcode(10)), b10= newSwitch(280,620, 35,VKAdisp(10),VKAcode(10)),
b11= newSwitch(760,80, 40,VKAdisp(11),VKAcode(11)), b11= newSwitch(620,80, 35,VKAdisp(11),VKAcode(11)),
b12= newSwitch(760,140, 40,VKAdisp(12),VKAcode(12)), b12= newSwitch(620,140, 35,VKAdisp(12),VKAcode(12)),
b13= newSwitch(760,200, 40,VKAdisp(13),VKAcode(13)), b13= newSwitch(620,200, 35,VKAdisp(13),VKAcode(13)),
b14= newSwitch(760,260, 40,VKAdisp(14),VKAcode(14)), b14= newSwitch(620,260, 35,VKAdisp(14),VKAcode(14)),
b15= newSwitch(760,320, 40,VKAdisp(15),VKAcode(15)), b15= newSwitch(620,320, 35,VKAdisp(15),VKAcode(15)),
b16= newSwitch(760,380, 40,VKAdisp(16),VKAcode(16)), b16= newSwitch(620,380, 35,VKAdisp(16),VKAcode(16)),
b17= newSwitch(760,440, 40,VKAdisp(17),VKAcode(17)), b17= newSwitch(620,440, 35,VKAdisp(17),VKAcode(17)),
b18= newSwitch(760,500, 40,VKAdisp(18),VKAcode(18)), b18= newSwitch(620,500, 35,VKAdisp(18),VKAcode(18)),
b19= newSwitch(760,560, 40,VKAdisp(19),VKAcode(19)), b19= newSwitch(620,560, 35,VKAdisp(19),VKAcode(19)),
b20= newSwitch(760,620, 40,VKAdisp(20),VKAcode(20)), b20= newSwitch(620,620, 35,VKAdisp(20),VKAcode(20)),
norm= newButton(1080,150,240,80,C.white,50,function()for i=1,20 do VK_org[i].ava=i<11 end end), norm= newButton(840,100,240,80,C.white,45,function()for i=1,20 do VK_org[i].ava=i<11 end end),
pro= newButton(1080,300,240,80,C.white,40,function()for i=1,20 do VK_org[i].ava=true end end), pro= newButton(1120,100,240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=true end end),
back= newButton(1080,600,240,80,C.white,50,scene.back), hide= newSwitch(1170,200,40,SETdisp("VKSwitch"),SETrev("VKSwitch")),
track= newSwitch(1170,300,35,SETdisp("VKTrack"),SETrev("VKTrack")),
icon= newSwitch(850,300,40,SETdisp("VKIcon"),SETrev("VKIcon")),
tkset= newButton(1120,400,240,80,C.white,32,function()
scene.push()
scene.swapTo("setting_trackSetting")
end,function()return not setting.VKTrack end),
alpha= newSlider(840,490,400,10,40,nil,SETdisp("VKAlpha"),SETsto("VKAlpha")),
back= newButton(1100,600,240,80,C.white,45,scene.back),
}, },
setting_trackSetting={ setting_trackSetting={
VKDodge= newSwitch(400,200, 40,SETdisp("VKDodge"),SETrev("VKDodge")), VKDodge=newSwitch(400,200, 35,SETdisp("VKDodge"),SETrev("VKDodge")),
VKTchW= newSlider(140,310,1000,10,40,nil,SETdisp("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end), VKTchW= newSlider(140,310,1000,10,35,nil,SETdisp("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end),
VKCurW= newSlider(140,370,1000,10,40,nil,SETdisp("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end), VKCurW= newSlider(140,370,1000,10,35,nil,SETdisp("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end),
back= newButton(1080,600,240,80,C.white,50,scene.back), back= newButton(1080,600,240,80,C.white,45,scene.back),
}, },
help={ help={
his= newButton(1050,520,230,60,C.white,40,function()scene.push()scene.swapTo("history")end,nil,"back"), his= newButton(1050,520,230,60,C.white,35,function()scene.push()scene.swapTo("history")end,nil,"back"),
qq= newButton(1050,600,230,60,C.white,40,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"), qq= newButton(1050,600,230,60,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"),
back= newButton(640, 600,180,60,C.white,40,scene.back,nil,"qq"), back= newButton(640, 600,180,60,C.white,35,scene.back,nil,"qq"),
}, },
history={ history={
prev= newButton(1155,170,180,180,C.white,70,pressKey("up"),function()return sel==1 end), prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sel==1 end),
next= newButton(1155,400,180,180,C.white,70,pressKey("down"),function()return sel==#updateLog-22 end), next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sel==#updateLog-22 end),
back= newButton(1155,600,180,90,C.white,40,scene.back), back= newButton(1155,600,180,90,C.white,35,scene.back),
}, },
stat={ stat={
path= newButton(980,620,250,60,C.white,30,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"), path= newButton(980,620,250,60,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
back= newButton(640,620,180,60,C.white,40,scene.back,nil,"path"), back= newButton(640,620,180,60,C.white,35,scene.back,nil,"path"),
}, },
} }
for _,L in next,Widget do for _,L in next,Widget do

165
main.lua
View File

@@ -17,13 +17,14 @@ local mx,my,mouseShow=-20,-20,false
local touching--第一触摸ID local touching--第一触摸ID
local devMode=0 local devMode=0
modeSel,levelSel=1,3--初始模式选择 modeSel,levelSel=1,3--初始模式选择(saved in setting)
players={alive={},human=0} players={alive={},human=0}
scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1} scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1}
local scr=scr local scr=scr
curBG="none" curBG="none"
bgmPlaying=nil bgmPlaying=nil
voiceQueue={free=0} voiceQueue={free=0}
texts={}
virtualkeyDown,virtualkeyPressTime={},{} virtualkeyDown,virtualkeyPressTime={},{}
for i=1,20 do for i=1,20 do
virtualkeyDown[i]=X virtualkeyDown[i]=X
@@ -41,7 +42,7 @@ function setFont(s)
if Fonts[s]then if Fonts[s]then
gc.setFont(Fonts[s]) gc.setFont(Fonts[s])
else else
local t=gc.setNewFont("font.ttf",s-5) local t=gc.setNewFont("font.ttf",s)
Fonts[s]=t Fonts[s]=t
gc.setFont(t) gc.setFont(t)
end end
@@ -61,6 +62,8 @@ require("default_data")
require("class") require("class")
require("ai") require("ai")
require("toolfunc") require("toolfunc")
require("sound")
require("text")
require("list") require("list")
require("dataList") require("dataList")
require("texture") require("texture")
@@ -72,38 +75,40 @@ require("player")
------------------------------------------------------------- -------------------------------------------------------------
local powerInfoCanvas,updatePowerInfo local powerInfoCanvas,updatePowerInfo
if sys.getPowerInfo()~="unknown"then if sys.getPowerInfo()~="unknown"then
powerInfoCanvas=gc.newCanvas(147,22) powerInfoCanvas=gc.newCanvas(108,27)
updatePowerInfo=function() function updatePowerInfo()
local state,pow=sys.getPowerInfo() local state,pow=sys.getPowerInfo()
if state~="unknown"then if state~="unknown"then
gc.setCanvas(powerInfoCanvas)gc.push("transform")gc.origin() gc.setCanvas(powerInfoCanvas)gc.push("transform")gc.origin()
gc.clear(0,0,0,.3) gc.clear(0,0,0,.25)
gc.setLineWidth(4) gc.setLineWidth(4)
setFont(25) local charging=state=="charging"
local charging if state=="nobattery"then
if state~="battery"then
gc.setColor(1,1,1) gc.setColor(1,1,1)
if state=="nobattery"then gc.setLineWidth(2)
gc.setLineWidth(2) gc.line(74,5,100,22)
gc.line(61.5,.5,83.5,22.5) else
elseif state=="charging"or state=="charged"then
gc.draw(chargeImage,84,3)
end
end
if pow then
if charging then gc.setColor(0,1,0) if charging then gc.setColor(0,1,0)
elseif pow>50 then gc.setColor(1,1,1) elseif pow>50 then gc.setColor(1,1,1)
elseif pow>26 then gc.setColor(1,1,0) elseif pow>26 then gc.setColor(1,1,0)
elseif pow<26 then gc.setColor(1,0,0) elseif pow<26 then gc.setColor(1,0,0)
else gc.setColor(.5,0,1)--special~ else gc.setColor(.5,0,1)
end
gc.rectangle("fill",76,6,pow*.22,14)
if pow<100 then
setFont(14)
gc.setColor(0,0,0)
gc.print(pow,77,2)
gc.print(pow,77,4)
gc.print(pow,79,2)
gc.print(pow,79,4)
gc.setColor(1,1,1)
gc.print(pow,78,3)
end end
::L::
gc.rectangle("fill",61,6,pow*.15,10)
gc.setColor(1,1,1)
gc.draw(batteryImage,58,3)
gc.print(pow.."%",94,-3)
end end
gc.print(os.date("%H:%M",os.time()),2,-3) gc.draw(batteryImage,73,3)
setFont(25)
gc.print(os.date("%H:%M",os.time()),3,-5)
gc.pop()gc.setCanvas() gc.pop()gc.setCanvas()
end end
end end
@@ -115,13 +120,14 @@ local function getNewBlock()
t.bn,t.size=FX_BGblock.next,2+3*rnd() t.bn,t.size=FX_BGblock.next,2+3*rnd()
t.b=blocks[t.bn][rnd(0,3)] t.b=blocks[t.bn][rnd(0,3)]
t.x=rnd(-#t.b[1]*t.size*30+100,1180) t.x=rnd(-#t.b[1]*t.size*30+100,1180)
t.y=-#t.b*30*t.size t.y=0
t.ty=720+#t.b*30*t.size
t.v=t.size*(1+rnd()) t.v=t.size*(1+rnd())
FX_BGblock.next=FX_BGblock.next%7+1 FX_BGblock.next=FX_BGblock.next%7+1
return t return t
end end
local function onVirtualkey(x,y) local function onVirtualkey(x,y)
local dist,nearest=1e15 local dist,nearest=1e10
for K=1,#virtualkey do for K=1,#virtualkey do
local b=virtualkey[K] local b=virtualkey[K]
if b.ava then if b.ava then
@@ -135,6 +141,21 @@ local function onVirtualkey(x,y)
end end
return nearest return nearest
end end
local function onVK_org(x,y)
local dist,nearest=1e10
for K=1,#VK_org do
local b=VK_org[K]
if b.ava then
local d1=(x-b.x)^2+(y-b.y)^2
if d1<b.r^2 then
if d1<dist then
nearest,dist=K,d1
end
end
end
end
return nearest
end
------------------------------------------------------------- -------------------------------------------------------------
local floatWheel=0 local floatWheel=0
local function wheelScroll(y) local function wheelScroll(y)
@@ -311,6 +332,14 @@ function touchMove.draw(id,x,y,dx,dy)
preField[sy][sx]=pen preField[sy][sx]=pen
end end
end end
local penKey={
["1"]=1,["2"]=2,["3"]=3,
q=4, w=5, e=6,
a=7, s=9, d=10,
z=11, x=12, c=13,
tab=0, backspace=0,
lshift=-1, lalt=-1,
}
function keyDown.draw(key) function keyDown.draw(key)
if key=="delete"then if key=="delete"then
if clearSureTime>15 then if clearSureTime>15 then
@@ -334,14 +363,23 @@ function keyDown.draw(key)
if sx and sy then if sx and sy then
preField[sy][sx]=pen preField[sy][sx]=pen
end end
elseif key=="tab"then
pen=-1
elseif key=="backspace"or key=="lalt"then
pen=0
elseif key=="escape"then elseif key=="escape"then
scene.back() scene.back()
else else
pen=string.find("123qwea#sdzxc",key)or pen pen=penKey[key]or pen
end
end
function mouseDown.setting_sound(x,y,k)
if Timer()-sel>5 and x>780 and x<980 and y>470 then
VOICE("egg")
sel=Timer()
end
end
function touchDown.setting_sound(id,x,y)
if Timer()-sel>5 and x>780 and x<980 and y>470 then
VOICE("egg")
sel=Timer()
end end
end end
@@ -436,15 +474,10 @@ end
function mouseDown.setting_touch(x,y,k) function mouseDown.setting_touch(x,y,k)
if k==2 then scene.back()end if k==2 then scene.back()end
for K=1,#VK_org do sel=onVK_org(x,y)or sel
local B=VK_org[K]
if (x-B.x)^2+(y-B.y)^2<B.r^2 then
sel=K
end
end
end end
function mouseMove.setting_touch(x,y,dx,dy) function mouseMove.setting_touch(x,y,dx,dy)
if sel and ms.isDown(1)then if sel and ms.isDown(1)and not widget_sel then
local B=VK_org[sel] local B=VK_org[sel]
B.x,B.y=B.x+dx,B.y+dy B.x,B.y=B.x+dx,B.y+dy
end end
@@ -457,12 +490,7 @@ function mouseUp.setting_touch(x,y,k)
end end
end end
function touchDown.setting_touch(id,x,y) function touchDown.setting_touch(id,x,y)
for K=1,#VK_org do sel=onVK_org(x,y)or sel
local B=VK_org[K]
if (x-B.x)^2+(y-B.y)^2<B.r^2 then
sel=K
end
end
end end
function touchUp.setting_touch(id,x,y) function touchUp.setting_touch(id,x,y)
if sel then if sel then
@@ -475,7 +503,7 @@ function touchUp.setting_touch(id,x,y)
end end
end end
function touchMove.setting_touch(id,x,y,dx,dy) function touchMove.setting_touch(id,x,y,dx,dy)
if sel then if sel and not widget_sel then
local B=VK_org[sel] local B=VK_org[sel]
B.x,B.y=B.x+dx,B.y+dy B.x,B.y=B.x+dx,B.y+dy
end end
@@ -854,6 +882,7 @@ function love.lowmemory()
collectgarbage() collectgarbage()
end end
function love.resize(w,h) function love.resize(w,h)
love.timer.sleep(.26)
scr.w,scr.h,scr.r=w,h,h/w scr.w,scr.h,scr.r=w,h,h/w
if scr.r>=.5625 then if scr.r>=.5625 then
scr.k=w/1280 scr.k=w/1280
@@ -883,8 +912,9 @@ function love.update(dt)
end end
end end
for i=#FX_BGblock,1,-1 do for i=#FX_BGblock,1,-1 do
FX_BGblock[i].y=FX_BGblock[i].y+FX_BGblock[i].v local B=FX_BGblock[i]
if FX_BGblock[i].y>720 then rem(FX_BGblock,i)end B.y=B.y+B.v
if B.y>B.ty then rem(FX_BGblock,i)end
end end
if setting.bgblock then if setting.bgblock then
FX_BGblock.tm=FX_BGblock.tm-1 FX_BGblock.tm=FX_BGblock.tm-1
@@ -893,6 +923,18 @@ function love.update(dt)
FX_BGblock.tm=rnd(20,30) FX_BGblock.tm=rnd(20,30)
end end
end end
for i=#texts,1,-1 do
local t=texts[i]
t.c=t.c+t.spd
if t.stop then
if t.c>t.stop then
t.c=t.stop
end
end
if t.c>60 then
rem(texts,i)
end
end
if scene.swapping then if scene.swapping then
local S=scene.swap local S=scene.swap
S.time=S.time-1 S.time=S.time-1
@@ -900,6 +942,8 @@ function love.update(dt)
scene.cur=S.tar scene.cur=S.tar
scene.init(S.tar) scene.init(S.tar)
widget_sel=nil widget_sel=nil
texts={}
collectgarbage()
--此时场景切换 --此时场景切换
end end
if S.time==0 then if S.time==0 then
@@ -923,7 +967,7 @@ function love.update(dt)
for i=1,#Q do for i=1,#Q do
Q[i]=Q[i+1] Q[i]=Q[i+1]
end end
end--放完后放下一个 end--放完pop出下一个
else else
local n=1 local n=1
local L=voiceBank[Q[1]] local L=voiceBank[Q[1]]
@@ -956,7 +1000,7 @@ function love.draw()
local size=FX_BGblock[n].size local size=FX_BGblock[n].size
for i=1,#b do for j=1,#b[1]do for i=1,#b do for j=1,#b[1]do
if b[i][j]then if b[i][j]then
gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_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*30*size,nil,size)
end end
end end end end
end--Draw BG falling blocks end--Draw BG falling blocks
@@ -991,7 +1035,14 @@ function love.draw()
gc.rectangle("fill",S[7],S[8],S[9],S[10],2) gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影 --开关/滑条残影
end end
end--sysFXs end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
if scene.swapping then if scene.swapping then
scene.swap.draw(scene.swap.time) scene.swap.draw(scene.swap.time)
end--Swapping animation end--Swapping animation
@@ -1007,7 +1058,7 @@ function love.draw()
gc.rectangle("fill",1280,0,d,720) gc.rectangle("fill",1280,0,d,720)
end--扁窗口 end--扁窗口
end--Black side end--Black side
setFont(20) setFont(15)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.print(FPS(),5,700) gc.print(FPS(),5,700)
if devMode>0 then if devMode>0 then
@@ -1027,14 +1078,14 @@ function love.run()
local PUMP,POLL=love.event.pump,love.event.poll local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
scene.init("load")--Scene Launch scene.init("load")--Scene Launch
return function() while true do
PUMP() PUMP()
for N,a,b,c,d,e in POLL()do for N,a,b,c,d,e in POLL()do
if N=="quit"then if N=="quit"then
destroyPlayers() destroyPlayers()
saveData() saveData()
saveSetting() saveSetting()
return 0 goto END
elseif love[N]then elseif love[N]then
love[N](a,b,c,d,e) love[N](a,b,c,d,e)
end end
@@ -1053,19 +1104,19 @@ function love.run()
T.sleep(.001) T.sleep(.001)
end end
lastFrame=Timer() lastFrame=Timer()
if Timer()-lastFreshPow>5 then if Timer()-lastFreshPow>1 then
updatePowerInfo() updatePowerInfo()
lastFreshPow=Timer() lastFreshPow=Timer()
end end
end end
::END::
end end
local fs=love.filesystem userData,userSetting=love.filesystem.newFile("userdata"),love.filesystem.newFile("usersetting")
userData,userSetting=fs.newFile("userdata"),fs.newFile("usersetting") if love.filesystem.getInfo("userdata")then
if fs.getInfo("userdata")then
loadData() loadData()
end end
if fs.getInfo("usersetting")then if love.filesystem.getInfo("usersetting")then
loadSetting() loadSetting()
elseif system=="Android"or system=="iOS" then elseif system=="Android"or system=="iOS" then
setting.swap=false setting.swap=false

176
paint.lua
View File

@@ -102,75 +102,6 @@ FX_BGblock={tm=150,next=7,ct=0,list={{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{
FX_attack={}--Attack beam FX_attack={}--Attack beam
FX_badge={}--Badge thrown FX_badge={}--Badge thrown
sysFX={} sysFX={}
FX_ripple={}--Ripple&SqrShade
textFX={
appear=function(t,a)
setFont(t.font)
gc.setColor(1,1,1,a)
mStr(t.text,150,250-t.font*.5+t.dy)
end,
fly=function(t,a)
setFont(t.font)
gc.setColor(1,1,1,a)
mStr(t.text,150+(t.t-15)^3*.005,250-t.font*.5+t.dy)
end,
stretch=function(t,a)
gc.push("transform")
setFont(t.font)
gc.translate(150,250+t.dy)
if t.t<20 then gc.scale((20-t.t)*.015+1,1)end
gc.setColor(1,1,1,a)
mStr(t.text,0,-t.font*.5)
gc.pop()
end,
drive=function(t,a)
gc.push("transform")
setFont(t.font)
gc.translate(150,290+t.dy)
if t.t<20 then gc.shear((20-t.t)*.05,0)end
gc.setColor(1,1,1,a)
mStr(t.text,0,-t.font*.5-15)
gc.pop()
end,
spin=function(t,a)
gc.push("transform")
setFont(t.font)
gc.translate(150,250+t.dy)
if t.t<20 then
gc.rotate((20-t.t)^2*.0015)
end
gc.setColor(1,1,1,a)
mStr(t.text,0,-t.font*.5-8)
gc.pop()
end,
flicker=function(t,a)
setFont(t.font)
gc.setColor(1,1,1,a*(rnd()+.5))
mStr(t.text,150,225-t.font*.5+t.dy)
end,
zoomout=function(t,a)
gc.push("transform")
setFont(t.font)
local k=t.t^.5*.1+1
gc.translate(150,290+t.dy)
gc.scale(k,k)
gc.setColor(1,1,1,a)
mStr(t.text,0,-t.font*.5-5)
gc.pop()
end,
beat=function(t,a)
gc.push("transform")
setFont(t.font)
gc.translate(150,290+t.dy)
if t.t<20 then
local k=.2*(5+(25-t.t)^.5)-.45
gc.scale(k,k)
end
gc.setColor(1,1,1,a)
mStr(t.text,0,-t.font*.5-5)
gc.pop()
end,
}
local function drawAtkPointer(x,y) local function drawAtkPointer(x,y)
local t=sin(Timer()*20) local t=sin(Timer()*20)
gc.setColor(.2,.7+t*.2,1,.6+t*.4) gc.setColor(.2,.7+t*.2,1,.6+t*.4)
@@ -297,15 +228,19 @@ function Pnt.BG.matrix()
end end
function Pnt.load() function Pnt.load()
local L=loading
gc.setLineWidth(4) gc.setLineWidth(4)
gc.setColor(1,1,1,.5) gc.setColor(1,1,1,.5)
gc.rectangle("fill",300,330,loadprogress*680,60,5) gc.rectangle("fill",300,330,L[2]/L[3]*680,60,5)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.rectangle("line",300,330,680,60,5) gc.rectangle("line",300,330,680,60,5)
setFont(40) setFont(35)
mStr(text.load[loading],640,335) gc.print(text.load[L[1]],340,335)
setFont(30) if loading[1]~=0 then
mStr(loadTip,640,400) gc.printf(loading[2].."/"..loading[3],795,335,150,"right")
end
setFont(25)
mStr(L[4],640,400)
end end
function Pnt.intro() function Pnt.intro()
gc.stencil(stencil_miniTitle,"replace",1) gc.stencil(stencil_miniTitle,"replace",1)
@@ -327,30 +262,31 @@ function Pnt.main()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(coloredTitleImage,60,30,nil,1.3) gc.draw(coloredTitleImage,60,30,nil,1.3)
gc.draw(drawableText.warning,595-drawableText.warning:getWidth(),128) gc.draw(drawableText.warning,595-drawableText.warning:getWidth(),128)
setFont(35) setFont(30)
gc.print(gameVersion,70,125) gc.print(gameVersion,70,125)
gc.print(system,610,100) gc.print(system,610,100)
gc.print(modes[modeID[modeSel]].level[levelSel],600,373) gc.print(modes[modeID[modeSel]].level[levelSel],600,373)
setFont(30) setFont(25)
gc.print(text.modeName[modeSel],600,414) gc.print(text.modeName[modeSel],600,414)
players[1]:demoDraw() players[1]:draw()
end end
function Pnt.mode() function Pnt.mode()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(titleImage,830,30) gc.draw(titleImage,830,30)
setFont(40) setFont(35)
local lv=modes[modeID[modeSel]].level[levelSel] local lv=modes[modeID[modeSel]].level[levelSel]
gc.setColor(modeLevelColor[lv]or color.white) gc.setColor(modeLevelColor[lv]or color.white)
mStr(lv,270,215) mStr(lv,270,200)
setFont(30) setFont(25)
gc.setColor(color.white) gc.setColor(color.white)
mStr(text.modeInfo[modeID[modeSel]],270,255) mStr(text.modeInfo[modeID[modeSel]],270,240)
setFont(80)
setFont(75)
gc.setColor(color.grey) gc.setColor(color.grey)
mStr(text.modeName[modeSel],643,273) mStr(text.modeName[modeSel],643,273)
for i=modeSel-2,modeSel+2 do for i=modeSel-2,modeSel+2 do
if i>=1 and i<=#modeID then if i>=1 and i<=#modeID then
local f=80-abs(i-modeSel)*20 local f=75-abs(i-modeSel)*20
gc.setColor(i==modeSel and color.white or abs(i-modeSel)==1 and color.grey or color.darkGrey) gc.setColor(i==modeSel and color.white or abs(i-modeSel)==1 and color.grey or color.darkGrey)
setFont(f) setFont(f)
mStr(text.modeName[i],640,310+70*(i-modeSel)-f*.5) mStr(text.modeName[i],640,310+70*(i-modeSel)-f*.5)
@@ -365,13 +301,13 @@ function Pnt.music()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(drawableText.musicRoom,22,23) gc.draw(drawableText.musicRoom,22,23)
gc.draw(drawableText.nowPlaying,490,390) gc.draw(drawableText.nowPlaying,490,390)
setFont(35) setFont(30)
for i=1,#musicID do for i=1,#musicID do
gc.print(musicID[i],50,90+30*i) gc.print(musicID[i],50,90+30*i)
end end
gc.draw(titleImage,640,310,nil,1.5,nil,206,35) gc.draw(titleImage,640,310,nil,1.5,nil,206,35)
if bgmPlaying then if bgmPlaying then
setFont(50) setFont(45)
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8) gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
mStr(bgmPlaying or"",630,460) mStr(bgmPlaying or"",630,460)
local t=-Timer()%2.3/2 local t=-Timer()%2.3/2
@@ -386,7 +322,7 @@ function Pnt.custom()
gc.rectangle("fill",25,95+40*sel,480,40) gc.rectangle("fill",25,95+40*sel,480,40)
gc.setColor(.8,.8,.8)gc.draw(drawableText.custom,20,20) gc.setColor(.8,.8,.8)gc.draw(drawableText.custom,20,20)
gc.setColor(1,1,1)gc.draw(drawableText.custom,22,23) gc.setColor(1,1,1)gc.draw(drawableText.custom,22,23)
setFont(40) setFont(35)
for i=1,#customID do for i=1,#customID do
local k=customID[i] local k=customID[i]
local y=90+40*i local y=90+40*i
@@ -408,13 +344,13 @@ function Pnt.draw()
gc.setLineWidth(3) gc.setLineWidth(3)
gc.rectangle("line",-2,-2,304,604) gc.rectangle("line",-2,-2,304,604)
gc.setLineWidth(2) gc.setLineWidth(2)
local cross=puzzleMark[-1]
for y=1,20 do for x=1,10 do for y=1,20 do for x=1,10 do
local B=preField[y][x] local B=preField[y][x]
if B>0 then if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y) gc.draw(blockSkin[B],30*x-30,600-30*y)
elseif B==-1 then elseif B==-1 then
gc.line(30*x-25,605-30*y,30*x-5,625-30*y) gc.draw(cross,30*x-30,600-30*y)
gc.line(30*x-25,625-30*y,30*x-5,605-30*y)
end end
end end end end
if sx and sy then if sx and sy then
@@ -424,17 +360,17 @@ function Pnt.draw()
gc.translate(-200,-60) gc.translate(-200,-60)
if clearSureTime>0 then if clearSureTime>0 then
gc.setColor(1,1,1,clearSureTime*.02) gc.setColor(1,1,1,clearSureTime*.02)
gc.draw(drawableText.question,760,11) gc.draw(drawableText.question,660,11)
end end
if pen>0 then if pen>0 then
gc.setLineWidth(13) gc.setLineWidth(13)
gc.setColor(blockColor[pen]) gc.setColor(blockColor[pen])
gc.rectangle("line",746,460,70,70) gc.rectangle("line",745,460,70,70)
elseif pen==-1 then elseif pen==-1 then
gc.setLineWidth(5) gc.setLineWidth(5)
gc.setColor(.9,.9,.9) gc.setColor(.9,.9,.9)
gc.line(960,620,1000,660) gc.line(755,470,805,520)
gc.line(960,660,1000,620) gc.line(755,520,805,470)
end end
end end
function Pnt.play() function Pnt.play()
@@ -445,12 +381,13 @@ function Pnt.play()
for i=1,#FX_attack do for i=1,#FX_attack do
local A=FX_attack[i] local A=FX_attack[i]
gc.push("transform") gc.push("transform")
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 local a=(A.t<10 and A.t*.05 or A.t>50 and 6-A.t*.1 or 1)*A.a
gc.setColor(A.r,A.g,A.b,a*.5) gc.setColor(A.r,A.g,A.b,a*.5)
gc.circle("line",0,0,A.rad,A.corner) gc.circle("line",0,0,A.rad,A.corner)
local L=A.drag local L=A.drag
for i=1,#L,2 do local len=#L
gc.setColor(A.r,A.g,A.b,a*i*.05) for i=1,len,2 do
gc.setColor(A.r,A.g,A.b,.4*a*i/len)
gc.translate(L[i],L[i+1]) gc.translate(L[i],L[i+1])
gc.rotate(A.t*.1) gc.rotate(A.t*.1)
gc.circle("fill",0,0,A.rad,A.corner) gc.circle("fill",0,0,A.rad,A.corner)
@@ -483,7 +420,7 @@ function Pnt.play()
gc.setColor(.8,1,0,.2) gc.setColor(.8,1,0,.2)
for i=1,#P.atker do for i=1,#P.atker do
local p=P.atker[i] local p=P.atker[i]
gc.line(p.centerX,p.centerY,P.centerX,P.centerY) gc.line(p.centerX,p.centerY,P.x+300*P.size,P.y+670*P.size)
end end
if P.atkMode~=4 then if P.atkMode~=4 then
if P.atking then drawAtkPointer(P.atking.centerX,P.atking.centerY)end if P.atking then drawAtkPointer(P.atking.centerX,P.atking.centerY)end
@@ -495,7 +432,7 @@ function Pnt.play()
end end
end end
if restartCount>0 then if restartCount>0 then
gc.setColor(0,0,0,restartCount/20) gc.setColor(0,0,0,restartCount*.05)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,1280,720)
end end
end end
@@ -504,7 +441,7 @@ function Pnt.pause()
gc.setColor(0,0,0,pauseTimer*.015) gc.setColor(0,0,0,pauseTimer*.015)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,1280,720)
gc.setColor(1,1,1,pauseTimer*.02) gc.setColor(1,1,1,pauseTimer*.02)
setFont(30) setFont(25)
if pauseCount>0 then if pauseCount>0 then
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150) gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
end end
@@ -516,32 +453,42 @@ function Pnt.pause()
gc.print(text.stat[i+3],860,30*i+30) gc.print(text.stat[i+3],860,30*i+30)
gc.print(dataOpt(i),1050,30*i+30) gc.print(dataOpt(i),1050,30*i+30)
end end
setFont(40) setFont(35)
if system~="Android"then if system~="Android"then
mStr(text.space.."/"..text.enter,640,190) mStr(text.space.."/"..text.enter,640,190)
mStr("Ctrl+R",640,351) mStr("Ctrl+R",640,351)
gc.print("ESC",610,506) gc.print("ESC",610,506)
end end
mDraw(gamefinished and drawableText.finish or drawableText.pause,640,60-10*(5-pauseTimer*.1)^1.5) mDraw(gameResult and drawableText[gameResult]or drawableText.pause,640,60-10*(5-pauseTimer*.1)^1.5)
end end
function Pnt.setting_game() function Pnt.setting_game()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mDraw(drawableText.setting_game,640,15) mDraw(drawableText.setting_game,640,15)
setFont(40) setFont(35)
mStr("DAS:"..setting.das,290,205) mStr("DAS:"..setting.das,290,205)
mStr("ARR:"..setting.arr,610,205) mStr("ARR:"..setting.arr,610,205)
setFont(28) setFont(23)
mStr(text.softdropdas..setting.sddas,290,323) mStr(text.softdropdas..setting.sddas,290,323)
mStr(text.softdroparr..setting.sdarr,610,323) mStr(text.softdroparr..setting.sdarr,610,323)
end end
function Pnt.setting_graphic() function Pnt.setting_graphic()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mDraw(drawableText.setting_graphic,640,15) mDraw(drawableText.setting_graphic,640,15)
gc.draw(blockSkin[7-int(Timer()*2)%7],940,440,nil,2) gc.draw(blockSkin[7-int(Timer()*2)%7],890,390,nil,2)
end end
function Pnt.setting_sound() function Pnt.setting_sound()
gc.setColor(1,1,1) gc.setColor(1,1,1,.8)
mDraw(drawableText.setting_sound,640,15) mDraw(drawableText.setting_sound,640,15)
local t=Timer()
local x,y=790,370+10*sin(t*.4)
gc.translate(x,y)
gc.draw(miya_ch,0,0)
gc.setColor(1,1,1,.7)
gc.draw(miya_f1,4,47+4*sin(t*.9))
gc.draw(miya_f2,42,107+5*sin(t))
gc.draw(miya_f3,93,126+3*sin(t*.7))
gc.draw(miya_f4,129,98+3*sin(t*.7))
gc.translate(-x,-y)
end end
function Pnt.setting_key() function Pnt.setting_key()
local a=.3+sin(Timer()*15)*.1 local a=.3+sin(Timer()*15)*.1
@@ -558,7 +505,7 @@ function Pnt.setting_key()
200,45 200,45
) )
--Selection rect --Selection rect
gc.setColor(1,.3,.3) gc.setColor(1,.3,.3)
mDraw(drawableText.keyboard,340,35) mDraw(drawableText.keyboard,340,35)
mDraw(drawableText.keyboard,940,35) mDraw(drawableText.keyboard,940,35)
@@ -567,7 +514,7 @@ function Pnt.setting_key()
mDraw(drawableText.joystick,1140,35) mDraw(drawableText.joystick,1140,35)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(31) setFont(26)
for N=1,20 do for N=1,20 do
if N<11 then if N<11 then
gc.printf(text.actName[N],47,45*N+22,180,"right") gc.printf(text.actName[N],47,45*N+22,180,"right")
@@ -586,13 +533,16 @@ function Pnt.setting_key()
for y=65,515,45 do for y=65,515,45 do
gc.line(40,y,1240,y) gc.line(40,y,1240,y)
end end
setFont(40) setFont(35)
gc.print("Player:",170,590) gc.print("Player:",170,590)
gc.print(int(curBoard*.5+.5),300,590) gc.print(int(curBoard*.5+.5),300,590)
gc.print(curBoard.."/8",580,590) gc.print(curBoard.."/8",580,590)
gc.draw(drawableText.ctrlSetHelp,50,650) gc.draw(drawableText.ctrlSetHelp,50,650)
end end
function Pnt.setting_touch() function Pnt.setting_touch()
gc.setColor(1,1,1)
gc.setLineWidth(7)gc.rectangle("line",340,15,600,690)
gc.setLineWidth(3)gc.rectangle("line",490,85,300,600)
VirtualkeyPreview() VirtualkeyPreview()
local d=snapLevelValue[snapLevel] local d=snapLevelValue[snapLevel]
if d>=10 then if d>=10 then
@@ -613,12 +563,12 @@ function Pnt.setting_trackSetting()
mDraw(drawableText.VKCurW,640+50*setting.VKCurW,380) mDraw(drawableText.VKCurW,640+50*setting.VKCurW,380)
end end
function Pnt.help() function Pnt.help()
setFont(30) setFont(25)
gc.setColor(1,1,1) gc.setColor(1,1,1)
for i=1,#text.help do for i=1,#text.help do
gc.printf(text.help[i],140,10+40*i,1000,"center") gc.printf(text.help[i],140,10+40*i,1000,"center")
end end
setFont(24) setFont(19)
gc.print(text.used,30,330) gc.print(text.used,30,330)
gc.draw(titleImage,280,620,.1,1+.05*sin(Timer()*2),nil,206,35) gc.draw(titleImage,280,620,.1,1+.05*sin(Timer()*2),nil,206,35)
gc.setLineWidth(5) gc.setLineWidth(5)
@@ -627,13 +577,13 @@ function Pnt.help()
gc.draw(payCode,20,20) gc.draw(payCode,20,20)
gc.draw(groupCode,1080,20) gc.draw(groupCode,1080,20)
gc.setColor(1,1,1,sin(Timer()*10)*.5+.5) gc.setColor(1,1,1,sin(Timer()*10)*.5+.5)
setFont(35) setFont(30)
mStr(text.support,150,283) mStr(text.support,150,283)
setFont(25) setFont(20)
mStr(text.group,1170,210) mStr(text.group,1170,210)
end end
function Pnt.stat() function Pnt.stat()
setFont(28) setFont(23)
gc.setColor(1,1,1) gc.setColor(1,1,1)
for i=1,18 do for i=1,18 do
gc.print(text.stat[i],400,30*i-5) gc.print(text.stat[i],400,30*i-5)
@@ -647,7 +597,7 @@ function Pnt.history()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.setLineWidth(4) gc.setLineWidth(4)
gc.rectangle("line",30,45,1000,632) gc.rectangle("line",30,45,1000,632)
setFont(25) setFont(20)
for i=0,min(22,#updateLog-sel)do for i=0,min(22,#updateLog-sel)do
gc.print(updateLog[sel+i],40,50+27*(i)) gc.print(updateLog[sel+i],40,50+27*(i))
end end

1385
player.lua

File diff suppressed because it is too large Load Diff

View File

@@ -13,10 +13,12 @@ local scene={
local sceneInit={ local sceneInit={
quit=love.event.quit, quit=love.event.quit,
load=function() load=function()
loading=1--Loading mode loading={
loadnum=1--Loading counter 1,--Loading mode
loadprogress=0--Loading bar(0~1) 1,--Loading counter
loadTip=text.tips[math.random(#text.tips)] #voiceName,--Loading bar lenth(current)
text.tips[math.random(#text.tips)],--tip
}
end, end,
intro=function() intro=function()
count=0 count=0
@@ -30,7 +32,6 @@ local sceneInit={
if not players[1]then if not players[1]then
newDemoPlayer(1,900,35,1.1) newDemoPlayer(1,900,35,1.1)
end--create demo player end--create demo player
collectgarbage()
end, end,
music=function() music=function()
if bgmPlaying then if bgmPlaying then
@@ -81,6 +82,7 @@ local sceneInit={
curBG="none" curBG="none"
end, end,
setting_sound=function() setting_sound=function()
sel=0--last sound time
curBG="none" curBG="none"
end, end,
setting_key=function() setting_key=function()
@@ -125,19 +127,19 @@ local swapDeck_data={
}--Block id [ZSLJTOI] ,dir,x,y }--Block id [ZSLJTOI] ,dir,x,y
local gc=love.graphics local gc=love.graphics
local swap={ local swap={
none={1,0,NULL}, none={1,0,nil,NULL},
flash={8,1,function()gc.clear(1,1,1)end}, flash={8,1,nil,function()gc.clear(1,1,1)end},
fade={30,15,function(t) fade={30,15,"swipe",function(t)
local t=t>15 and 2-t/15 or t/15 local t=t>15 and 2-t/15 or t/15
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,1280,720)
end}, end},
slowFade={120,40,function(t) slowFade={180,90,nil,function(t)
local t=t>40 and 1.5-t/80 or t/40 local t=t>90 and 2-t/90 or t/90
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,1280,720)
end}, end},
deck={50,8,function(t) deck={50,8,nil,function(t)
gc.setColor(1,1,1) gc.setColor(1,1,1)
if t>8 then if t>8 then
local t=t<15 and 15 or t local t=t<15 and 15 or t
@@ -190,11 +192,12 @@ function scene.swapTo(tar,style)
if not style then style="fade"end if not style then style="fade"end
S.tar=tar S.tar=tar
S.style=style S.style=style
S.time=swap[style][1] local swap=swap[style]
S.mid=swap[style][2] S.time=swap[1]
S.draw=swap[style][3] S.mid=swap[2]
if swap[3]then SFX(swap[3])end
S.draw=swap[4]
widget_sel=nil widget_sel=nil
if style~="none"then SFX("swipe")end
end end
end end
function scene.back() function scene.back()

85
sound.lua Normal file
View File

@@ -0,0 +1,85 @@
local rnd=math.random
local rem=table.remove
local vibrateLevel={0,.015,.02,.03,.04,.05,.06,.07,.08,.09}
function VIB(t)
if setting.vib>0 then
love.system.vibrate(vibrateLevel[setting.vib+t])
end
end
function SFX(s,v,pos)
if setting.sfx>0 then
local S=sfx[s]--AU_Queue
local n=1
while S[n]:isPlaying()do
n=n+1
if not S[n]then
S[n]=S[n-1]:clone()
S[n]:seek(0)
break
end
end
S=S[n]--AU_SRC
if S:getChannelCount()==1 then
if pos then
pos=pos*setting.stereo*.1
S:setPosition(pos,1-pos^2,0)
else
S:setPosition(0,0,0)
end
end
S:setVolume((v or 1)*setting.sfx*.1)
S:play()
end
end
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
voiceQueue[getFreeVoiceChannel()]={voiceList[s][rnd(#voiceList[s])]}
--自动查找/创建空轨
end
end
end
function BGM(s)
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
local T=Task[i]
if T.code==Event_task.bgmFadeIn then
T.code=Event_task.bgmFadeOut
elseif T.code==Event_task.bgmFadeOut and T.data==s then
rem(Task,i)
end
end
if s then
newTask(Event_task.bgmFadeIn,nil,s)
bgm[s]:play()
end
bgmPlaying=s
else
if bgmPlaying then
local v=setting.bgm*.1
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

105
text.lua Normal file
View File

@@ -0,0 +1,105 @@
local gc=love.graphics
local rnd=math.random
local mStr=mStr
local rem=table.remove
local textFX={}
function textFX.appear(t)
mStr(t.text,t.x,t.y-t.font*.7)
end
function textFX.fly(t)
mStr(t.text,t.x+(t.c-.5)^3*300,t.y-t.font*.7)
end
function textFX.stretch(t)
gc.push("transform")
gc.translate(t.x,t.y)
if t.c<.3 then gc.scale((.3-t.c)*1.6+1,1)end
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function textFX.drive(t)
gc.push("transform")
gc.translate(t.x,t.y)
if t.c<.3 then gc.shear((.3-t.c)*2,0)end
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function textFX.spin(t)
gc.push("transform")
gc.translate(t.x,t.y)
if t.c<.3 then
gc.rotate((.3-t.c)^2*4)
end
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function textFX.flicker(t)
local _,τ,T,Τ=gc.getColor()
gc.setColor(_,τ,T,Τ*(rnd()+.5))
mStr(t.text,t.x,t.y-t.font*.7)
end
function textFX.zoomout(t)
gc.push("transform")
local k=t.c^.5*.1+1
gc.translate(t.x,t.y)
gc.scale(k,k)
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function textFX.beat(t)
gc.push("transform")
gc.translate(t.x,t.y)
if t.c<.3 then
local k=1.3-t.c^2/.3
gc.scale(k,k)
end
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function getTEXT(text,x,y,font,style,spd,stop)
return{
c=0,
text=text,
x=x or 0,
y=y or 0,
font=font or 40,
spd=(spd or 1)/60,
stop=stop,
draw=textFX[style]or error("unavailable type:"..style),
}
end--another version of TEXT()
function TEXT(text,x,y,font,style,spd,stop)
texts[#texts+1]={
c=0, --timer
text=text, --string
x=x or 0, --x
y=y or 0, --y
font=font or 40, --font
spd=(spd or 1)/60, --timing speed(1=last 1 sec)
stop=stop, --stop time(sustained text)
draw=textFX[style]or error("unavailable type:"..style), --draw method
}
end
function updateText(list)
for i=#list,1,-1 do
local t=list[i]
t.c=t.c+t.spd
if t.stop then
if t.c>t.stop then
t.c=t.stop
end
end
if t.c>60 then
rem(list,i)
end
end
end
function drawTexts(list)
for i=1,#list do
local t=list[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end
end

View File

@@ -1,12 +1,13 @@
local gc=love.graphics local gc=love.graphics
local N,c=gc.newImage local N=gc.newImage
local int=math.floor local int=math.floor
local function T(s,t)return gc.newText(setFont(s),t)end local function T(s,t)return gc.newText(setFont(s),t)end
local function C(x,y) local function C(x,y)
c=gc.newCanvas(x,y) local c=gc.newCanvas(x,y)
gc.setCanvas(c) gc.setCanvas(c)
return c return c
end end
local c
gc.setDefaultFilter("nearest","nearest") gc.setDefaultFilter("nearest","nearest")
blockImg=N("/image/block.png") blockImg=N("/image/block.png")
@@ -36,15 +37,38 @@ for i=1,7 do
end end end end
end end
puzzleMark={}
gc.setLineWidth(3)
for i=1,13 do
puzzleMark[i]=C(30,30)
if i>7 then
gc.setColor(blockColor[i])
gc.rectangle("line",7,7,16,16)
else
local c=blockColor[i]
gc.setColor(c[1],c[2],c[3],.6)
gc.rectangle("line",5,5,20,20)
gc.rectangle("line",10,10,10,10)
end
end
c=C(30,30)
gc.setColor(1,1,1)
gc.line(5,5,25,25)
gc.line(5,25,25,5)
puzzleMark[-1]=C(30,30)
gc.setColor(1,1,1,.9)
gc.draw(c)
c:release()
PTC={dust={}}--Particle systems PTC={dust={}}--Particle systems
C(6,6) c=C(6,6)
gc.clear(1,1,1) gc.clear(1,1,1)
PTC.dust0=gc.newParticleSystem(c,1000) PTC.dust0=gc.newParticleSystem(c,1000)
c:release()
PTC.dust0:setParticleLifetime(.2,.3) PTC.dust0:setParticleLifetime(.2,.3)
PTC.dust0:setEmissionRate(0) PTC.dust0:setEmissionRate(0)
PTC.dust0:setLinearAcceleration(-1500,-200,1500,200) PTC.dust0:setLinearAcceleration(-1500,-200,1500,200)
PTC.dust0:setColors(1,1,1,.5,1,1,1,0) PTC.dust0:setColors(1,1,1,.5,1,1,1,0)
c:release()
--Dust particles --Dust particles
gc.setDefaultFilter("linear","linear") gc.setDefaultFilter("linear","linear")
@@ -55,12 +79,17 @@ dialNeedle=N("/image/mess/dialNeedle.png")
badgeIcon=N("/image/mess/badge.png") badgeIcon=N("/image/mess/badge.png")
spinCenter=N("/image/mess/spinCenter.png") spinCenter=N("/image/mess/spinCenter.png")
batteryImage=N("/image/mess/power.png") batteryImage=N("/image/mess/power.png")
chargeImage=N("/image/mess/charge.png")
background1=N("/image/BG/bg1.jpg") background1=N("/image/BG/bg1.jpg")
background2=N("/image/BG/bg2.png") background2=N("/image/BG/bg2.png")
groupCode=N("/image/mess/groupcode.png") groupCode=N("/image/mess/groupcode.png")
payCode=N("/image/mess/paycode.png") payCode=N("/image/mess/paycode.png")
miya_ch=N("/image/miya/ch.png")
miya_f1=N("/image/miya/f1.png")
miya_f2=N("/image/miya/f2.png")
miya_f3=N("/image/miya/f3.png")
miya_f4=N("/image/miya/f4.png")
drawableText={ drawableText={
question=T(100,"?"), question=T(100,"?"),
bpm=T(15,"BPM"),kpm=T(15,"KPM"), bpm=T(15,"BPM"),kpm=T(15,"KPM"),
@@ -76,12 +105,15 @@ drawableText={
nextWave=T(30,"Next"), nextWave=T(30,"Next"),
combo=T(20,"Combo"), combo=T(20,"Combo"),
mxcmb=T(20,"Max Combo"), mxcmb=T(20,"Max Combo"),
pc=T(22,"Perfect Clear"), pc=T(20,"Perfect Clear"),
ko=T(25,"KO"), ko=T(25,"KO"),
modeName=T(30),levelName=T(30), modeName=T(30),levelName=T(30),
next=T(40),hold=T(40), next=T(40),hold=T(40),
pause=T(120),finish=T(120),
win=T(120),finish=T(120),
lose=T(120),pause=T(120),
custom=T(80), custom=T(80),
setting_game=T(80),setting_graphic=T(80),setting_sound=T(80), setting_game=T(80),setting_graphic=T(80),setting_sound=T(80),
keyboard=T(25),joystick=T(25), keyboard=T(25),joystick=T(25),

View File

@@ -6,46 +6,41 @@ local ins,rem=table.insert,table.remove
local Tmr={} local Tmr={}
function Tmr.load() function Tmr.load()
local t=Timer() local t=Timer()
local L=loading
::R:: ::R::
if loading==1 then if L[1]==1 then
if loadnum<=#voiceName then local N=voiceName[L[2]]
local N=voiceName[loadnum] for i=1,#voiceList[N]do
for i=1,#voiceList[N]do local V=voiceList[N][i]
voiceBank[voiceList[N][i]]={love.audio.newSource("VOICE/"..voiceList[N][i]..".ogg","static")} voiceBank[V]={love.audio.newSource("VOICE/"..V..".ogg","static")}
end
loadprogress=loadnum/#voiceName
loadnum=loadnum+1
else
loading=2
loadnum=1
end end
elseif loading==2 then L[2]=L[2]+1
if loadnum<=#bgm then if L[2]>L[3]then
local N=bgm[loadnum] L[1],L[2],L[3]=2,1,#bgm
bgm[N]=love.audio.newSource("/BGM/"..N..".ogg","stream") end
bgm[N]:setLooping(true) elseif L[1]==2 then
bgm[N]:setVolume(0) local N=bgm[L[2]]
loadprogress=loadnum/#bgm bgm[N]=love.audio.newSource("/BGM/"..N..".ogg","stream")
loadnum=loadnum+1 bgm[N]:setLooping(true)
else bgm[N]:setVolume(0)
L[2]=L[2]+1
if L[2]>L[3]then
for i=1,#bgm do bgm[i]=nil end for i=1,#bgm do bgm[i]=nil end
loading=3 L[1],L[2],L[3]=3,1,#sfx
loadnum=1
end end
elseif loading==3 then elseif L[1]==3 then
if loadnum<=#sfx then local S=sfx[L[2]]
sfx[sfx[loadnum]]={love.audio.newSource("/SFX/"..sfx[loadnum]..".ogg","static")} sfx[S]={love.audio.newSource("/SFX/"..S..".ogg","static")}
loadprogress=loadnum/#sfx L[2]=L[2]+1
loadnum=loadnum+1 if L[2]>L[3]then
else for i=1,L[2]do sfx[i]=nil end
for i=1,#sfx do sfx[i]=nil end L[1],L[2],L[3]=0,1,1
loading=4
loadnum=1
SFX("welcome",.2) SFX("welcome",.2)
end end
elseif loading==4 then else
loadnum=loadnum+1 L[2]=L[2]+1
if loadnum==48 then L[3]=L[2]
if L[2]>50 then
stat.run=stat.run+1 stat.run=stat.run+1
scene.swapTo("intro","none") scene.swapTo("intro","none")
end end
@@ -68,7 +63,7 @@ function Tmr.play(dt)
local b=FX_attack[i] local b=FX_attack[i]
b.t=b.t+1 b.t=b.t+1
if b.t>50 then if b.t>50 then
b.rad=b.rad*1.08+.2 b.rad=b.rad*1.05+.1
b.x,b.y=b.x2,b.y2 b.x,b.y=b.x2,b.y2
elseif b.t>10 then elseif b.t>10 then
local t=((b.t-10)*.025)t=(3-2*t)*t*t local t=((b.t-10)*.025)t=(3-2*t)*t*t
@@ -76,12 +71,12 @@ function Tmr.play(dt)
end end
if b.t<60 then if b.t<60 then
local L=FX_attack[i].drag local L=FX_attack[i].drag
if #L==6*setting.atkFX then if #L==4*setting.atkFX then
rem(L,1)rem(L,1) rem(L,1)rem(L,1)
end end
ins(L,b.x)ins(L,b.y) ins(L,b.x)ins(L,b.y)
else else
for i=1,#FX_attack do for i=i,#FX_attack do
FX_attack[i]=FX_attack[i+1] FX_attack[i]=FX_attack[i+1]
end end
end end
@@ -129,7 +124,7 @@ function Tmr.play(dt)
return return
end end
elseif restartCount>0 then elseif restartCount>0 then
restartCount=max(restartCount-2,0) restartCount=restartCount>2 and restartCount-2 or 0
end--Counting,include pre-das,directy RETURN,or restart counting end--Counting,include pre-das,directy RETURN,or restart counting
for p=1,#players do for p=1,#players do
local P=players[p] local P=players[p]
@@ -138,7 +133,7 @@ function Tmr.play(dt)
if modeEnv.royaleMode and frame%120==0 then freshMostDangerous()end if modeEnv.royaleMode and frame%120==0 then freshMostDangerous()end
end end
function Tmr.pause(dt) function Tmr.pause(dt)
if not gamefinished then if not gameResult then
pauseTime=pauseTime+dt pauseTime=pauseTime+dt
end end
if pauseTimer<50 and not wd.isMinimized()then if pauseTimer<50 and not wd.isMinimized()then

View File

@@ -1,7 +1,6 @@
local tm=love.timer local tm=love.timer
local gc=love.graphics local gc=love.graphics
local kb=love.keyboard local kb=love.keyboard
local setFont=setFont
local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min
local sub,find=string.sub,string.find local sub,find=string.sub,string.find
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
@@ -71,7 +70,7 @@ langName={"中文","全中文","English"}
local langID={"chi","chi_full","eng"} local langID={"chi","chi_full","eng"}
local drawableTextLoad={ local drawableTextLoad={
"next","hold", "next","hold",
"pause","finish", "win","finish","lose","pause",
"custom", "custom",
"setting_game", "setting_game",
"setting_graphic", "setting_graphic",
@@ -95,7 +94,7 @@ function swapLanguage(l)
royaleCtrlPad=gc.newCanvas(300,100) royaleCtrlPad=gc.newCanvas(300,100)
gc.setCanvas(royaleCtrlPad) gc.setCanvas(royaleCtrlPad)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(25) setFont(20)
gc.setLineWidth(2) gc.setLineWidth(2)
for i=1,4 do for i=1,4 do
gc.rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4) gc.rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4)
@@ -133,90 +132,6 @@ function restoreVirtualKey()
end end
local vibrateLevel={0,.015,.02,.03,.04,.05,.06,.07,.08,.09}
function VIB(t)
if setting.vib>0 then
love.system.vibrate(vibrateLevel[setting.vib+t])
end
end
function SFX(s,v,pos)
if setting.sfx>0 then
local S=sfx[s]--AU_Queue
local n=1
while S[n]:isPlaying()do
n=n+1
if not S[n]then
S[n]=S[n-1]:clone()
S[n]:seek(0)
break
end
end
S=S[n]--AU_SRC
if S:getChannelCount()==1 then
if pos then
pos=pos*setting.stereo*.1
S:setPosition(pos,1-pos^2,0)
else
S:setPosition(0,0,0)
end
end
S:setVolume((v or 1)*setting.sfx*.1)
S:play()
end
end
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
voiceQueue[getFreeVoiceChannel()]={voiceList[s][rnd(#voiceList[s])]}
--自动查找/创建空轨
end
end
end
function BGM(s)
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
local T=Task[i]
if T.code==Event_task.bgmFadeIn then
T.code=Event_task.bgmFadeOut
elseif T.code==Event_task.bgmFadeOut and T.data==s then
rem(Task,i)
end
end
if s then
newTask(Event_task.bgmFadeIn,nil,s)
bgm[s]:play()
end
bgmPlaying=s
else
if bgmPlaying then
local v=setting.bgm*.1
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
function updateStat() function updateStat()
local S=players[1].stat local S=players[1].stat
for k,v in next,S do for k,v in next,S do
@@ -264,9 +179,7 @@ end
function royaleLevelup() function royaleLevelup()
gameStage=gameStage+1 gameStage=gameStage+1
local spd local spd
if(gameStage==3 or gameStage>4)and players[1].alive then TEXT(text.royale_remain(#players.alive),640,200,40,"beat",.3)
players[1]:showText(text.royale_remain(#players.alive),"beat",50,-100,.3)
end
if gameStage==2 then if gameStage==2 then
spd=30 spd=30
elseif gameStage==3 then elseif gameStage==3 then
@@ -300,15 +213,16 @@ function royaleLevelup()
end end
function pauseGame() function pauseGame()
restartCount=0--Avoid strange darkness
pauseTimer=0--Pause timer for animation pauseTimer=0--Pause timer for animation
if not gamefinished then if not gameResult then
pauseCount=pauseCount+1 pauseCount=pauseCount+1
end end
for i=1,#players.alive do for i=1,#players do
local l=players.alive[i].keyPressing local l=players[i].keyPressing
for j=1,#l do for j=1,#l do
if l[j]then if l[j]then
players.alive[i]:releaseKey(j) players[i]:releaseKey(j)
end end
end end
end end
@@ -324,14 +238,16 @@ function loadGame(mode,level)
lv=level, lv=level,
} }
drawableText.modeName:set(text.modeName[mode]) drawableText.modeName:set(text.modeName[mode])
drawableText.levelName:set(modes[modeID[modeSel]].level[levelSel]) drawableText.levelName:set(modes[modeID[mode]].level[level])
needResetGameData=true needResetGameData=true
scene.swapTo("play","deck") scene.swapTo("play","deck")
end end
function resetPartGameData() function resetPartGameData()
gameResult=false
frame=30 frame=30
destroyPlayers() destroyPlayers()
modes[curMode.id].load() modes[curMode.id].load()
texts={}
if modeEnv.task then if modeEnv.task then
for i=1,#players do for i=1,#players do
newTask(Event_task[modeEnv.task],players[i]) newTask(Event_task[modeEnv.task],players[i])
@@ -346,7 +262,7 @@ function resetPartGameData()
collectgarbage() collectgarbage()
end end
function resetGameData() function resetGameData()
gamefinished=false gameResult=false
frame=0 frame=0
garbageSpeed=1 garbageSpeed=1
pushSpeed=3 pushSpeed=3
@@ -364,6 +280,7 @@ function resetGameData()
curBG=modeEnv.bg curBG=modeEnv.bg
BGM(modeEnv.bgm) BGM(modeEnv.bgm)
texts={}
FX_badge={} FX_badge={}
FX_attack={} FX_attack={}
for _,v in next,PTC.dust do for _,v in next,PTC.dust do
@@ -409,7 +326,6 @@ function gameStart()
end end
local dataOpt={ local dataOpt={
"run","game","time", "run","game","time",
"extraPiece","extraRate", "extraPiece","extraRate",
@@ -447,6 +363,7 @@ function saveData()
t=concat(t,"\r\n") t=concat(t,"\r\n")
userData:open("w") userData:open("w")
userData:write(t) userData:write(t)
userData:flush()
userData:close() userData:close()
end end
@@ -488,11 +405,19 @@ function loadSetting()
v=toN(v)if not v or v<0 then v=0 end v=toN(v)if not v or v<0 then v=0 end
setting[t]=int(v) setting[t]=int(v)
elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then
setting[t]=toN(v:match("[0123]"))or 0 setting[t]=toN(v:match("[012345]"))or 0
elseif t=="lang"then elseif t=="lang"then
setting[t]=toN(v:match("[123]"))or 1 setting[t]=toN(v:match("[123]"))or 1
elseif t=="skin"then elseif t=="skin"then
setting[t]=toN(v:match("[12345678]"))or 1 setting[t]=toN(v:match("[12345678]"))or 1
elseif t=="modesel"then
local t=toN(v)
if not(t or modes[modeID[t]])then
t=1
end
modeSel=t
elseif t=="levelsel"then
levelSel=toN(v)
elseif t=="keymap"then elseif t=="keymap"then
v=splitS(v,"/") v=splitS(v,"/")
for i=1,16 do for i=1,16 do
@@ -515,6 +440,9 @@ function loadSetting()
end end
end end
end end
if not modes[modeID[modeSel]].level[levelSel]then
levelSel=1
end
end end
local saveOpt={ local saveOpt={
"das","arr", "das","arr",
@@ -539,7 +467,7 @@ local saveOpt={
"sfx","bgm", "sfx","bgm",
"vib","voc", "vib","voc",
"stereo", "stereo",
"VKSwitch", "VKSwitch",
"VKTrack", "VKTrack",
"VKDodge", "VKDodge",
@@ -564,6 +492,8 @@ function saveSetting()
map[i]=concat(setting.keyMap[i],",") map[i]=concat(setting.keyMap[i],",")
end end
local t={ local t={
"modesel="..modeSel,
"levelsel="..levelSel,
"keymap="..toS(concat(map,"/")), "keymap="..toS(concat(map,"/")),
"VK="..toS(concat(vk,"/")), "VK="..toS(concat(vk,"/")),
} }
@@ -573,5 +503,6 @@ function saveSetting()
t=concat(t,"\r\n") t=concat(t,"\r\n")
userSetting:open("w") userSetting:open("w")
userSetting:write(t) userSetting:write(t)
userSetting:flush(t)
userSetting:close() userSetting:close()
end end

View File

@@ -1,10 +1,14 @@
local S=[=[ local S=[=[
Patron(rmb10+): Patron(rmb10+):
gggf/T080/Ykzl/zxc Fireboos
[D*a]? gggf
Sasoric
T080
Ykzl
zxc
?[D*a]
Future outlook: Future outlook:
Normal Things: Normal:
powerinfo switch powerinfo switch
splashing block splashing block
ajustable next count ajustable next count
@@ -18,13 +22,31 @@ Future outlook:
game recording game recording
new AI:task-Z new AI:task-Z
auto GUI in any screen size auto GUI in any screen size
Hard:
Technical things:
Encrypt source code(compile to byte code) Encrypt source code(compile to byte code)
infinite 1v1 infinite 1v1
square mode square mode
more FXs & 3d features & animations more FXs & 3d features & animations
0.8.2+:
GUI adjusted
added a cute cat
0.8.2:
new widget appearence
GUI adjusted
bug fixed
0.8.1:
more FX level
better battery info displaying
3 next in GMroll
bug fixed
0.8.0:
remake text system
more details
bug fixed
0.7.35:
bug fixed
0.7.34:
shaking FX more natural
0.7.33+: 0.7.33+:
MORE POWERFUL 9-stack AI MORE POWERFUL 9-stack AI
add stereo-setting slider add stereo-setting slider