Merge branch 'master' into resolve-conflict-with-MrZ626/master
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
local gc=love.graphics
|
||||
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
|
||||
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
local BG
|
||||
local scr=scr
|
||||
@@ -28,7 +29,7 @@ back.glow={
|
||||
local t=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08
|
||||
gc.clear(t,t,t)
|
||||
end,
|
||||
}--light-dark
|
||||
}--Light-dark
|
||||
back.rgb={
|
||||
init=function()
|
||||
t=0
|
||||
@@ -57,14 +58,159 @@ back.flink={
|
||||
else gc.clear(0,0,0)
|
||||
end
|
||||
end,
|
||||
}--flash after random time
|
||||
}--Flash after random time
|
||||
|
||||
local wingColor={
|
||||
{0., .9, .9,.626},
|
||||
{.3, 1., .3,.626},
|
||||
{.9, .9, 0.,.626},
|
||||
{1., .5, 0.,.626},
|
||||
{1., .3, .3,.626},
|
||||
{.5, 0., 1.,.626},
|
||||
{.3, .3, 1.,.626},
|
||||
{0., .9, .9,.626},
|
||||
}
|
||||
back.wing={
|
||||
init=function()
|
||||
gc.setDefaultFilter("linear","linear")
|
||||
bar=gc.newCanvas(41,1)
|
||||
gc.push("transform")
|
||||
gc.origin()
|
||||
gc.setCanvas(bar)
|
||||
for x=0,20 do
|
||||
gc.setColor(1,1,1,x/11)
|
||||
gc.rectangle("fill",x,0,1,1)
|
||||
gc.rectangle("fill",41-x,0,1,1)
|
||||
end
|
||||
gc.setCanvas()
|
||||
gc.pop()
|
||||
BG.resize()
|
||||
end,
|
||||
resize=function()
|
||||
crystal={}
|
||||
W,H=scr.w,scr.h
|
||||
for i=1,16 do
|
||||
crystal[i]={
|
||||
x=i<9 and W*.05*i or W*.05*(28-i),
|
||||
y=H*.1,
|
||||
a=0,
|
||||
va=0,
|
||||
f=i<9 and .012-i*.0005 or .012-(17-i)*.0005
|
||||
}
|
||||
end
|
||||
end,
|
||||
update=function()
|
||||
for i=1,16 do
|
||||
local B=crystal[i]
|
||||
B.a=B.a+B.va
|
||||
B.va=B.va*.986-B.a*B.f
|
||||
end
|
||||
end,
|
||||
draw=function()
|
||||
gc.clear(.06,.06,.06)
|
||||
local sy=H*.8
|
||||
for i=1,8 do
|
||||
gc.setColor(wingColor[i])
|
||||
local B=crystal[i]
|
||||
gc.draw(bar,B.x,B.y,B.a,1,sy,20,0)
|
||||
B=crystal[17-i]
|
||||
gc.draw(bar,B.x,B.y,B.a,1,sy,20,0)
|
||||
end
|
||||
end,
|
||||
event=function(level)
|
||||
for i=1,8 do
|
||||
local B=crystal[i]
|
||||
B.va=B.va+.001*level*(1+rnd())
|
||||
B=crystal[17-i]
|
||||
B.va=B.va-.001*level*(1+rnd())
|
||||
end
|
||||
end,
|
||||
discard=function()
|
||||
bar,crystal=nil
|
||||
end,
|
||||
}--Flandre's wing
|
||||
|
||||
local _
|
||||
back.fan={
|
||||
init=function()
|
||||
fan=_G.title_fan
|
||||
t=0
|
||||
petal={}
|
||||
BG.resize()
|
||||
end,
|
||||
resize=function()
|
||||
CX,CY=scr.w/2,scr.h/2
|
||||
W,H=scr.w,scr.h
|
||||
end,
|
||||
update=function()
|
||||
t=t+1
|
||||
if t%10==0 then
|
||||
ins(petal,{
|
||||
x=scr.w*rnd(),
|
||||
y=0,
|
||||
vy=2+rnd()*2,
|
||||
vx=rnd()*2-.5,
|
||||
rx=4+rnd()*4,
|
||||
ry=4+rnd()*4,
|
||||
})
|
||||
end
|
||||
for i=#petal,1,-1 do
|
||||
local P=petal[i]
|
||||
P.y=P.y+P.vy
|
||||
if P.y>H then
|
||||
rem(petal,i)
|
||||
else
|
||||
P.x=P.x+P.vx
|
||||
P.vx=P.vx+rnd()*.01
|
||||
P.rx=max(min(P.rx+rnd()-.5,10),2)
|
||||
P.ry=max(min(P.ry+rnd()-.5,10),2)
|
||||
end
|
||||
end
|
||||
end,
|
||||
draw=function()
|
||||
gc.push("transform")
|
||||
gc.translate(CX,CY+20*sin(t*.02))
|
||||
gc.scale(scr.k)
|
||||
gc.clear(.1,.1,.1)
|
||||
gc.setLineWidth(320)
|
||||
gc.setColor(.3,.2,.3)
|
||||
gc.arc("line","open",0,420,500,-.8*3.1416,-.2*3.1416)
|
||||
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(.7,.5,.65)
|
||||
gc.arc("line","open",0,420,660,-.799*3.1416,-.201*3.1416)
|
||||
gc.arc("line","open",0,420,340,-.808*3.1416,-.192*3.1416)
|
||||
gc.line(-281,224,-530,30.5)
|
||||
gc.line(281,224,530,30.5)
|
||||
|
||||
gc.setLineWidth(6)
|
||||
gc.setColor(.55,.5,.6)
|
||||
local F=fan
|
||||
for i=1,8 do
|
||||
gc.polygon("line",F[i])
|
||||
end
|
||||
|
||||
gc.setLineWidth(2)
|
||||
gc.setColor(.6,.3,.5)
|
||||
gc.origin()
|
||||
for i=1,#petal do
|
||||
local P=petal[i]
|
||||
gc.ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||
end
|
||||
gc.pop()
|
||||
end,
|
||||
discard=function()
|
||||
petal=nil
|
||||
end,
|
||||
}
|
||||
|
||||
back.aura={
|
||||
init=function()
|
||||
t=rnd()*3600
|
||||
BG.resize(scr.w,scr.h)
|
||||
end,
|
||||
resize=function(w,h)
|
||||
SHADER.aura:send("w",w*scr.dpi)
|
||||
SHADER.aura:send("w",scr.W)
|
||||
SHADER.aura:send("h",h*scr.dpi)
|
||||
end,
|
||||
update=function(dt)
|
||||
@@ -76,14 +222,14 @@ back.aura={
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--cool liquid background
|
||||
back.game1={
|
||||
}--Cool liquid background
|
||||
back.bg1={
|
||||
init=function()
|
||||
t=0
|
||||
BG.resize(scr.w)
|
||||
end,
|
||||
resize=function(w)
|
||||
SHADER.gradient1:send("w",w*scr.dpi)
|
||||
SHADER.gradient1:send("w",scr.W)
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
@@ -95,7 +241,7 @@ back.game1={
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Horizonal red-blue gradient
|
||||
back.game2={
|
||||
back.bg2={
|
||||
init=function()
|
||||
t=0
|
||||
BG.resize(nil,scr.h)
|
||||
@@ -113,13 +259,13 @@ back.game2={
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Vertical red-green gradient
|
||||
back.game3={
|
||||
back.rainbow={
|
||||
init=function()
|
||||
t=0
|
||||
BG.resize(scr.w,scr.h)
|
||||
end,
|
||||
resize=function(w,h)
|
||||
SHADER.rgb1:send("w",w*scr.dpi)
|
||||
SHADER.rgb1:send("w",scr.W)
|
||||
SHADER.rgb1:send("h",h*scr.dpi)
|
||||
end,
|
||||
update=function(dt)
|
||||
@@ -132,13 +278,13 @@ back.game3={
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Colorful RGB
|
||||
back.game4={
|
||||
back.rainbow2={
|
||||
init=function()
|
||||
t=0
|
||||
BG.resize(scr.w,scr.h)
|
||||
end,
|
||||
resize=function(w,h)
|
||||
SHADER.rgb2:send("w",w*scr.dpi)
|
||||
SHADER.rgb2:send("w",scr.W)
|
||||
SHADER.rgb2:send("h",h*scr.dpi)
|
||||
end,
|
||||
update=function(dt)
|
||||
@@ -151,7 +297,7 @@ back.game4={
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Blue RGB
|
||||
back.game5={
|
||||
back.lightning={
|
||||
init=function()
|
||||
t=0
|
||||
end,
|
||||
@@ -168,7 +314,7 @@ back.game5={
|
||||
|
||||
local blocks=require("parts/mino")
|
||||
local scs=require("parts/spinCenters")
|
||||
back.game6={
|
||||
back.lightning2={
|
||||
init=function()
|
||||
t=0
|
||||
colorLib=_G.SKIN.libColor
|
||||
@@ -201,8 +347,8 @@ back.matrix={
|
||||
draw=function()
|
||||
gc.scale(scr.k)
|
||||
gc.clear(.15,.15,.15)
|
||||
local Y=ceil(scr.h*scr.dpi/80)
|
||||
for x=1,ceil(scr.w*scr.dpi/80)do
|
||||
local Y=ceil(scr.H/80)
|
||||
for x=1,ceil(scr.W/80)do
|
||||
for y=1,Y do
|
||||
gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1)
|
||||
gc.rectangle("fill",80*x,80*y,-80,-80)
|
||||
@@ -222,19 +368,20 @@ back.space={
|
||||
local S=stars
|
||||
for i=1,1260,5 do
|
||||
local s=rnd(26,40)*.1
|
||||
S[i]=s*scr.k --size
|
||||
S[i+1]=rnd(W)-10 --x
|
||||
S[i+2]=rnd(H)-10 --y
|
||||
S[i+3]=(rnd()-.5)*.01*s --vx
|
||||
S[i+4]=(rnd()-.5)*.01*s --vy
|
||||
end--800 var
|
||||
S[i]=s*scr.k --Size
|
||||
S[i+1]=rnd(W)-10 --X
|
||||
S[i+2]=rnd(H)-10 --Y
|
||||
S[i+3]=(rnd()-.5)*.01*s --Vx
|
||||
S[i+4]=(rnd()-.5)*.01*s --Vy
|
||||
end
|
||||
end,
|
||||
update=function(dt)
|
||||
local S=stars
|
||||
--Star moving
|
||||
for i=1,1260,5 do
|
||||
S[i+1]=(S[i+1]+S[i+3])%W
|
||||
S[i+2]=(S[i+2]+S[i+4])%H
|
||||
end--star moving
|
||||
end
|
||||
end,
|
||||
draw=function()
|
||||
gc.clear(.2,.2,.2)
|
||||
@@ -250,17 +397,19 @@ back.space={
|
||||
gc.translate(10,10)
|
||||
end,
|
||||
discard=function()
|
||||
stars={}
|
||||
stars=nil
|
||||
end,
|
||||
}
|
||||
|
||||
--Make BG vars invisible
|
||||
for _,bg in next,back do
|
||||
if not bg.init then bg.init= NULL end setfenv(bg.init ,BGvars)
|
||||
if not bg.resize then bg.resize= NULL end setfenv(bg.resize ,BGvars)
|
||||
if not bg.update then bg.update= NULL end setfenv(bg.update ,BGvars)
|
||||
if not bg.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars)
|
||||
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars)
|
||||
end--make BG vars invisible
|
||||
if not bg.event then bg.event= NULL end setfenv(bg.event ,BGvars)
|
||||
if not bg.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars)
|
||||
end
|
||||
|
||||
BG={
|
||||
cur="none",
|
||||
@@ -268,6 +417,11 @@ BG={
|
||||
update=NULL,
|
||||
draw=back.none.draw,
|
||||
}
|
||||
function BG.send(data)
|
||||
if BG.event then
|
||||
BG.event(data)
|
||||
end
|
||||
end
|
||||
function BG.set(bg,data)
|
||||
if bg==BG.cur or not setting.bg then return end
|
||||
if BG.discard then
|
||||
@@ -280,8 +434,9 @@ function BG.set(bg,data)
|
||||
BG.init=bg.init or NULL
|
||||
BG.resize=bg.resize or NULL
|
||||
BG.update=bg.update or NULL
|
||||
BG.discard=bg.discard or NULL
|
||||
BG.draw=bg.draw or NULL
|
||||
BG.event=bg.event or NULL
|
||||
BG.discard=bg.discard or NULL
|
||||
BG.init()
|
||||
end
|
||||
return BG
|
||||
@@ -3,7 +3,7 @@ local rem=table.remove
|
||||
|
||||
local function fadeOut(id)
|
||||
local src=BGM.list[id]
|
||||
local v=src:getVolume()-.025*setting.bgm*.1
|
||||
local v=src:getVolume()-.025*setting.bgm*.01
|
||||
src:setVolume(v>0 and v or 0)
|
||||
if v<=0 then
|
||||
src:stop()
|
||||
@@ -12,9 +12,10 @@ local function fadeOut(id)
|
||||
end
|
||||
local function fadeIn(id)
|
||||
local src=BGM.list[id]
|
||||
local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1)
|
||||
local v=setting.bgm*.01
|
||||
v=min(v,src:getVolume()+.025*v)
|
||||
src:setVolume(v)
|
||||
if v>=setting.bgm*.1 then return true end
|
||||
if v>=setting.bgm*.01 then return true end
|
||||
end
|
||||
|
||||
local BGM={
|
||||
@@ -23,9 +24,11 @@ local BGM={
|
||||
--playing=[src:playing SRC]
|
||||
}
|
||||
BGM.list={
|
||||
"blank","way","race","newera","push","reason","infinite",
|
||||
"blank",
|
||||
"race","push","way","reason",
|
||||
"newera","oxygen","infinite",
|
||||
"secret7th","secret8th",
|
||||
"shining terminal","oxygen","distortion","far",
|
||||
"shining terminal","distortion","far",
|
||||
"rockblock","cruelty","final","8-bit happiness","end",
|
||||
"how feeling",
|
||||
}
|
||||
@@ -65,7 +68,7 @@ function BGM.play(s)
|
||||
end
|
||||
function BGM.freshVolume()
|
||||
if BGM.playing then
|
||||
local v=setting.bgm*.1
|
||||
local v=setting.bgm*.01
|
||||
if v>0 then
|
||||
BGM.playing:setVolume(v)
|
||||
if BGM.suspend then
|
||||
|
||||
@@ -9,7 +9,7 @@ local color={
|
||||
|
||||
lRed={1,.5,.5},
|
||||
lGreen={.5,1,.5},
|
||||
lBlue={.6,.6,1},
|
||||
lBlue={.6,.7,1},
|
||||
lCyan={.5,1,1},
|
||||
lMagenta={1,.5,1},
|
||||
lYellow={1,1,.5},
|
||||
@@ -32,7 +32,6 @@ local color={
|
||||
pink={1,0,.6},
|
||||
grass={.6,1,0},
|
||||
water={0,1,.6},
|
||||
bronze={.7,.4,0},
|
||||
white={1,1,1},
|
||||
purple={.5,0,1},
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ local function dumpTable(L,t)
|
||||
end
|
||||
return s..tabs[t-1].."}"
|
||||
end
|
||||
local function addToTable(G,base)--refresh default base with G-values
|
||||
local function addToTable(G,base)--Refresh default base with G-values
|
||||
for k,v in next,G do
|
||||
if type(v)==type(base[k])then
|
||||
if type(v)=="table"then
|
||||
@@ -79,8 +79,8 @@ local files={
|
||||
unlock= fs.newFile("unlock.dat"),
|
||||
}
|
||||
|
||||
local File={}
|
||||
function File.loadRecord(N)
|
||||
local FILE={}
|
||||
function FILE.loadRecord(N)
|
||||
local F=fs.newFile(N..".dat")
|
||||
if F:open("r")then
|
||||
local s=loadstring(F:read())
|
||||
@@ -93,7 +93,7 @@ function File.loadRecord(N)
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveRecord(N,L)
|
||||
function FILE.saveRecord(N,L)
|
||||
local F=fs.newFile(N..".dat")
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(L))
|
||||
@@ -102,11 +102,11 @@ function File.saveRecord(N,L)
|
||||
TEXT.show(text.recSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
|
||||
end
|
||||
end
|
||||
function File.delRecord(N)
|
||||
function FILE.delRecord(N)
|
||||
fs.remove(N..".dat")
|
||||
end
|
||||
|
||||
function File.loadUnlock()
|
||||
function FILE.loadUnlock()
|
||||
local F=files.unlock
|
||||
if F:open("r")then
|
||||
local s=F:read()
|
||||
@@ -119,7 +119,7 @@ function File.loadUnlock()
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveUnlock()
|
||||
function FILE.saveUnlock()
|
||||
local F=files.unlock
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(modeRanks))
|
||||
@@ -129,7 +129,7 @@ function File.saveUnlock()
|
||||
end
|
||||
end
|
||||
|
||||
function File.loadData()
|
||||
function FILE.loadData()
|
||||
local F=files.data
|
||||
if F:open("r")then
|
||||
local s=F:read()
|
||||
@@ -145,7 +145,7 @@ function File.loadData()
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveData()
|
||||
function FILE.saveData()
|
||||
local F=files.data
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(stat))
|
||||
@@ -155,7 +155,7 @@ function File.saveData()
|
||||
end
|
||||
end
|
||||
|
||||
function File.loadSetting()
|
||||
function FILE.loadSetting()
|
||||
local F=files.setting
|
||||
if F:open("r")then
|
||||
local s=F:read()
|
||||
@@ -170,7 +170,7 @@ function File.loadSetting()
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveSetting()
|
||||
function FILE.saveSetting()
|
||||
local F=files.setting
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(setting))
|
||||
@@ -180,7 +180,7 @@ function File.saveSetting()
|
||||
end
|
||||
end
|
||||
|
||||
function File.loadKeyMap()
|
||||
function FILE.loadKeyMap()
|
||||
local F=files.keyMap
|
||||
if F:open("r")then
|
||||
local s=loadstring(F:read())
|
||||
@@ -191,7 +191,7 @@ function File.loadKeyMap()
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveKeyMap()
|
||||
function FILE.saveKeyMap()
|
||||
local F=files.keyMap
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(keyMap))
|
||||
@@ -201,7 +201,7 @@ function File.saveKeyMap()
|
||||
end
|
||||
end
|
||||
|
||||
function File.loadVK()
|
||||
function FILE.loadVK()
|
||||
local F=files.VK
|
||||
if F:open("r")then
|
||||
local s=loadstring(F:read())
|
||||
@@ -212,7 +212,7 @@ function File.loadVK()
|
||||
end
|
||||
end
|
||||
end
|
||||
function File.saveVK()
|
||||
function FILE.saveVK()
|
||||
local F=files.VK
|
||||
F:open("w")
|
||||
local _,mes=F:write(dumpTable(VK_org))
|
||||
@@ -221,4 +221,4 @@ function File.saveVK()
|
||||
else TEXT.show(text.VKSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
|
||||
end
|
||||
end
|
||||
return File
|
||||
return FILE
|
||||
@@ -25,11 +25,12 @@ local Timer=love.timer.getTime
|
||||
local int,rnd,max,min=math.floor,math.random,math.max,math.min
|
||||
local abs=math.abs
|
||||
local ins,rem=table.insert,table.remove
|
||||
local byte=string.byte
|
||||
|
||||
local scr=scr
|
||||
local xOy=love.math.newTransform()
|
||||
local mx,my,mouseShow=-20,-20,false
|
||||
local touching=nil--first touching ID(userdata)
|
||||
local touching=nil--First touching ID(userdata)
|
||||
local touchDist=nil
|
||||
joysticks={}
|
||||
|
||||
@@ -127,12 +128,85 @@ local touchDown,touchUp,touchMove={},{},{}
|
||||
local keyDown,keyUp={},{}
|
||||
local gamepadDown,gamepadUp={},{}
|
||||
|
||||
function keyDown.calculator(k)
|
||||
local S=sceneTemp
|
||||
if byte(k)>=48 and byte(k)<=57 then
|
||||
if S.sym=="="then
|
||||
S.val=tonumber(k)
|
||||
S.sym=false
|
||||
elseif S.sym then
|
||||
if not S.reg then
|
||||
S.reg=S.val
|
||||
S.val=tonumber(k)
|
||||
elseif S.val<1e13 then
|
||||
S.val=S.val*10+tonumber(k)
|
||||
end
|
||||
else
|
||||
if S.val<1e13 then
|
||||
S.val=S.val*10+tonumber(k)
|
||||
end
|
||||
end
|
||||
elseif k=="backspace"then
|
||||
if S.val>0 then
|
||||
S.val=int(S.val/10)
|
||||
end
|
||||
elseif k=="+"or k=="="and kb.isDown("rshift","lshift")then
|
||||
S.sym="+"
|
||||
elseif k=="-"then
|
||||
S.sym="-"
|
||||
elseif k=="*"or k=="8"and kb.isDown("rshift","lshift")then
|
||||
S.sym="*"
|
||||
elseif k=="/"then
|
||||
S.sym="/"
|
||||
elseif k=="return"then
|
||||
if S.val then
|
||||
if S.sym and S.reg then
|
||||
S.val=
|
||||
S.sym=="+"and S.reg+S.val or
|
||||
S.sym=="-"and S.reg-S.val or
|
||||
S.sym=="*"and S.reg*S.val or
|
||||
S.sym=="/"and S.reg/S.val or
|
||||
-1
|
||||
end
|
||||
S.sym="="
|
||||
S.reg=false
|
||||
if S.val==626 then
|
||||
S.pass=true
|
||||
elseif S.val==196022 then
|
||||
S.pass=true
|
||||
marking=nil
|
||||
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
|
||||
SFX.play("clear")
|
||||
elseif S.val==72943816 then
|
||||
S.pass=true
|
||||
for name,M in next,Modes do
|
||||
if not modeRanks[name]then
|
||||
modeRanks[name]=M.score and 0 or 6
|
||||
end
|
||||
end
|
||||
FILE.saveUnlock()
|
||||
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
|
||||
SFX.play("clear_2")
|
||||
elseif S.val==137926261379 then
|
||||
SCN.go("debug")
|
||||
end
|
||||
end
|
||||
elseif k=="space"then
|
||||
if S.pass then
|
||||
SCN.swapTo("intro")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function keyDown.load(k)
|
||||
if k=="a"then
|
||||
sceneTemp.skip=true
|
||||
elseif k=="s"then
|
||||
marking=nil
|
||||
sceneTemp.skip=true
|
||||
elseif k=="escape"then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
function touchDown.load(id,x,y)
|
||||
@@ -145,19 +219,22 @@ function mouseDown.intro(x,y,k)
|
||||
if k==2 then
|
||||
VOC.play("bye")
|
||||
SCN.back()
|
||||
elseif newVersionLaunch then
|
||||
SCN.push("main","fade")
|
||||
SCN.swapTo("history","fade")
|
||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
||||
else
|
||||
SCN.goto("main")
|
||||
SCN.go("main")
|
||||
end
|
||||
end
|
||||
function touchDown.intro(id,x,y)
|
||||
SCN.goto("main")
|
||||
mouseDown.intro()
|
||||
end
|
||||
function keyDown.intro(key)
|
||||
if key=="escape"then
|
||||
VOC.play("bye")
|
||||
SCN.back()
|
||||
mouseDown.intro(nil,nil,2)
|
||||
else
|
||||
SCN.goto("main")
|
||||
mouseDown.intro()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -229,7 +306,7 @@ function touchMove.mode(id,x,y,dx,dy)
|
||||
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
|
||||
elseif not L[3]then
|
||||
x,y=xOy:inverseTransformPoint(tc.getPosition(L[1]))
|
||||
dx,dy=xOy:inverseTransformPoint(tc.getPosition(L[2]))--not delta!!!
|
||||
dx,dy=xOy:inverseTransformPoint(tc.getPosition(L[2]))--Not delta!!!
|
||||
local d=(x-dx)^2+(y-dy)^2
|
||||
if d>100 then
|
||||
d=d^.5
|
||||
@@ -270,7 +347,7 @@ function keyDown.mode(key)
|
||||
end
|
||||
elseif mapCam.sel=="custom_clear" or mapCam.sel=="custom_puzzle" then
|
||||
if key=="e"then
|
||||
SCN.goto("custom")
|
||||
SCN.go("custom")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -327,9 +404,9 @@ function keyDown.custom(key)
|
||||
BGM.play(customRange.bgm[customSel[sel]])
|
||||
end
|
||||
elseif key=="q"then
|
||||
SCN.goto("sequence")
|
||||
SCN.go("sequence")
|
||||
elseif key=="e"then
|
||||
SCN.swapTo("draw")
|
||||
SCN.swapTo("draw","swipe")
|
||||
elseif #key==1 then
|
||||
local T=tonumber(key)
|
||||
if T and T>=1 and T<=5 then
|
||||
@@ -360,8 +437,20 @@ function keyDown.sequence(key)
|
||||
local C=s.cur+1
|
||||
ins(preBag,C,key)
|
||||
s.cur=C
|
||||
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
|
||||
if #preBag>0 then
|
||||
love.system.setClipboardText("Techmino SEQ:"..copySequence())
|
||||
TEXT.show(text.copySuccess,640,225,50,"appear",.5)
|
||||
end
|
||||
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
|
||||
local str=love.system.getClipboardText()
|
||||
local p=string.find(str,":")--ptr*
|
||||
if p then str=string.sub(str,p+1)end
|
||||
if not pasteSequence(str)then
|
||||
TEXT.show(text.dataCorrupted,640,225,45,"flicker",.5)
|
||||
end
|
||||
elseif #key==1 then
|
||||
local i=(kb.isDown("lctrl","lshift","lalt","rctrl","rshift","ralt")and minoKey2 or minoKey)[key]
|
||||
local i=(kb.isDown("lshift","lalt","rshift","ralt")and minoKey2 or minoKey)[key]
|
||||
if i then
|
||||
local C=s.cur+1
|
||||
ins(preBag,C,i)
|
||||
@@ -385,6 +474,7 @@ function keyDown.sequence(key)
|
||||
preBag={}
|
||||
sceneTemp.cur=0
|
||||
sceneTemp.sure=0
|
||||
SFX.play("finesseError",.7)
|
||||
else
|
||||
sceneTemp.sure=50
|
||||
end
|
||||
@@ -449,6 +539,7 @@ function keyDown.draw(key)
|
||||
if sceneTemp.sure>20 then
|
||||
for y=1,20 do for x=1,10 do preField[y][x]=0 end end
|
||||
sceneTemp.sure=0
|
||||
SFX.play("finesseError",.7)
|
||||
else
|
||||
sceneTemp.sure=50
|
||||
end
|
||||
@@ -457,13 +548,19 @@ function keyDown.draw(key)
|
||||
preField[sy][sx]=pen
|
||||
end
|
||||
elseif key=="e"then
|
||||
SCN.swapTo("custom")
|
||||
SCN.swapTo("custom","swipe")
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="c"and kb.isDown("lctrl","rctrl")then
|
||||
copyBoard()
|
||||
elseif key=="v"and kb.isDown("lctrl","rctrl")then
|
||||
pasteBoard()
|
||||
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
|
||||
love.system.setClipboardText("Techmino Field:"..copyBoard())
|
||||
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
|
||||
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
|
||||
local str=love.system.getClipboardText()
|
||||
local p=string.find(str,":")--ptr*
|
||||
if p then str=string.sub(str,p+1)end
|
||||
if not pasteBoard(str)then
|
||||
TEXT.show(text.dataCorrupted,350,360,35,"flicker",.5)
|
||||
end
|
||||
else
|
||||
pen=penKey[key]or pen
|
||||
end
|
||||
@@ -596,70 +693,73 @@ function keyDown.pause(key)
|
||||
elseif key=="escape"then
|
||||
resumeGame()
|
||||
elseif key=="s"then
|
||||
SCN.goto("setting_sound")
|
||||
SCN.go("setting_sound")
|
||||
elseif key=="r"then
|
||||
TASK.clear("play")
|
||||
mergeStat(stat,players[1].stat)
|
||||
resetGameData()
|
||||
SCN.swapTo("play","none")
|
||||
elseif key=="p"and(game.result or game.replaying)then
|
||||
TASK.removeTask_code(TICK.autoPause)
|
||||
resetPartGameData(true)
|
||||
SCN.swapTo("play","none")
|
||||
end
|
||||
end
|
||||
|
||||
function touchDown.play(id,x,y)
|
||||
if setting.VKSwitch then
|
||||
local t=onVirtualkey(x,y)
|
||||
if t then
|
||||
players[1]:pressKey(t)
|
||||
if setting.VKSFX>0 then
|
||||
SFX.play("virtualKey",setting.VKSFX*.25)
|
||||
end
|
||||
virtualkey[t].isDown=true
|
||||
virtualkey[t].pressTime=10
|
||||
if setting.VKTrack then
|
||||
local B=virtualkey[t]
|
||||
if setting.VKDodge then--button collision (not accurate)
|
||||
for i=1,#virtualkey do
|
||||
local b=virtualkey[i]
|
||||
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--hit depth(Neg means distance)
|
||||
if d>0 then
|
||||
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
|
||||
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
|
||||
end
|
||||
if not setting.VKSwitch or game.replaying then return end
|
||||
|
||||
local t=onVirtualkey(x,y)
|
||||
if t then
|
||||
players[1]:pressKey(t)
|
||||
if setting.VKSFX>0 then
|
||||
SFX.play("virtualKey",setting.VKSFX*.25)
|
||||
end
|
||||
virtualkey[t].isDown=true
|
||||
virtualkey[t].pressTime=10
|
||||
if setting.VKTrack then
|
||||
local B=virtualkey[t]
|
||||
if setting.VKDodge then--Button collision (not accurate)
|
||||
for i=1,#virtualkey do
|
||||
local b=virtualkey[i]
|
||||
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--Hit depth(Neg means distance)
|
||||
if d>0 then
|
||||
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
|
||||
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
|
||||
end
|
||||
end
|
||||
local O=VK_org[t]
|
||||
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1
|
||||
local _OW=1-_FW-_CW
|
||||
|
||||
--Auto follow: finger, current, origin (weight from setting)
|
||||
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
|
||||
end
|
||||
VIB(setting.VKVIB)
|
||||
local O=VK_org[t]
|
||||
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1
|
||||
local _OW=1-_FW-_CW
|
||||
|
||||
--Auto follow: finger, current, origin (weight from setting)
|
||||
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
|
||||
end
|
||||
VIB(setting.VKVIB)
|
||||
end
|
||||
end
|
||||
function touchUp.play(id,x,y)
|
||||
if setting.VKSwitch then
|
||||
local t=onVirtualkey(x,y)
|
||||
if t then
|
||||
players[1]:releaseKey(t)
|
||||
end
|
||||
if not setting.VKSwitch or game.replaying then return end
|
||||
|
||||
local t=onVirtualkey(x,y)
|
||||
if t then
|
||||
players[1]:releaseKey(t)
|
||||
end
|
||||
end
|
||||
function touchMove.play(id,x,y,dx,dy)
|
||||
if setting.VKSwitch then
|
||||
local l=tc.getTouches()
|
||||
for n=1,#virtualkey do
|
||||
local B=virtualkey[n]
|
||||
for i=1,#l do
|
||||
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
|
||||
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
|
||||
goto next
|
||||
end
|
||||
if not setting.VKSwitch or game.replaying then return end
|
||||
|
||||
local l=tc.getTouches()
|
||||
for n=1,#virtualkey do
|
||||
local B=virtualkey[n]
|
||||
for i=1,#l do
|
||||
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
|
||||
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
|
||||
goto next
|
||||
end
|
||||
players[1]:releaseKey(n)
|
||||
::next::
|
||||
end
|
||||
players[1]:releaseKey(n)
|
||||
::next::
|
||||
end
|
||||
end
|
||||
function keyDown.play(key)
|
||||
@@ -667,6 +767,7 @@ function keyDown.play(key)
|
||||
pauseGame()
|
||||
return
|
||||
end
|
||||
if game.replaying then return end
|
||||
local m=keyMap
|
||||
for k=1,20 do
|
||||
if key==m[1][k]or key==m[2][k]then
|
||||
@@ -678,6 +779,7 @@ function keyDown.play(key)
|
||||
end
|
||||
end
|
||||
function keyUp.play(key)
|
||||
if game.replaying then return end
|
||||
local m=keyMap
|
||||
for k=1,20 do
|
||||
if key==m[1][k]or key==m[2][k]then
|
||||
@@ -689,6 +791,8 @@ function keyUp.play(key)
|
||||
end
|
||||
function gamepadDown.play(key)
|
||||
if key=="back"then SCN.back()return end
|
||||
if game.replaying then return end
|
||||
|
||||
local m=keyMap
|
||||
for k=1,20 do
|
||||
if key==m[3][k]or key==m[4][k]then
|
||||
@@ -700,65 +804,37 @@ function gamepadDown.play(key)
|
||||
end
|
||||
end
|
||||
function gamepadUp.play(key)
|
||||
local m=keyMap
|
||||
for p=1,players.human do
|
||||
for k=1,20 do
|
||||
if key==m[3][k]or key==m[4][k]then
|
||||
players[1]:releaseKey(k)
|
||||
virtualkey[k].isDown=false
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if game.replaying then return end
|
||||
|
||||
function keyDown.staff(key,RESET)
|
||||
if key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="\122"then
|
||||
if RESET or kb.isDown("\109")and kb.isDown("\114")then
|
||||
SCN.goto("debug")
|
||||
local m=keyMap
|
||||
for k=1,20 do
|
||||
if key==m[3][k]or key==m[4][k]then
|
||||
players[1]:releaseKey(k)
|
||||
virtualkey[k].isDown=false
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
function touchDown.staff(id,x,y)
|
||||
local pw=sceneTemp.pw
|
||||
local t=pw%4
|
||||
if
|
||||
t==0 and x<640 and y<360 or
|
||||
t==1 and x>640 and y<360 or
|
||||
t==2 and x<640 and y>360 or
|
||||
t==3 and x>640 and y>360
|
||||
then
|
||||
pw=pw+1
|
||||
if pw==8 then
|
||||
SCN.goto("debug")
|
||||
end
|
||||
else
|
||||
pw=x<640 and y<360==1 and 1 or 0
|
||||
end
|
||||
sceneTemp.pw=pw
|
||||
end
|
||||
|
||||
function wheelMoved.history(x,y)
|
||||
wheelScroll(y)
|
||||
end
|
||||
function keyDown.history(key)
|
||||
if key=="up"then
|
||||
sceneTemp[2]=max(sceneTemp[2]-1,1)
|
||||
sceneTemp.pos=max(sceneTemp.pos-1,1)
|
||||
elseif key=="down"then
|
||||
sceneTemp[2]=min(sceneTemp[2]+1,#sceneTemp[1])
|
||||
sceneTemp.pos=min(sceneTemp.pos+1,#sceneTemp.text)
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
-------------------------------------------------------------
|
||||
local lastX,lastY=0,0--last clickDown pos
|
||||
function love.mousepressed(x,y,k,t,num)
|
||||
if t then return end
|
||||
local lastX,lastY=0,0--Last clickDown pos
|
||||
function love.mousepressed(x,y,k,touch,num)
|
||||
if touch then return end
|
||||
mouseShow=true
|
||||
mx,my=xOy:inverseTransformPoint(x,y)
|
||||
if devMode==1 then print(mx,my)end
|
||||
if devMode==1 then DBP(mx,my)end
|
||||
if SCN.swapping then return end
|
||||
if mouseDown[SCN.cur]then
|
||||
mouseDown[SCN.cur](mx,my,k)
|
||||
@@ -769,6 +845,7 @@ function love.mousepressed(x,y,k,t,num)
|
||||
WIDGET.press(mx,my)
|
||||
end
|
||||
lastX,lastY=mx,my
|
||||
sysFX.newRipple(.3,mx,my,30)
|
||||
end
|
||||
function love.mousemoved(x,y,dx,dy,t)
|
||||
if t then return end
|
||||
@@ -785,10 +862,9 @@ function love.mousemoved(x,y,dx,dy,t)
|
||||
WIDGET.moveCursor(mx,my)
|
||||
end
|
||||
end
|
||||
function love.mousereleased(x,y,k,t,num)
|
||||
if t then return end
|
||||
function love.mousereleased(x,y,k,touch,num)
|
||||
if touch or SCN.swapping then return end
|
||||
mx,my=xOy:inverseTransformPoint(x,y)
|
||||
if t or SCN.swapping then return end
|
||||
if mouseUp[SCN.cur]then
|
||||
mouseUp[SCN.cur](mx,my,k)
|
||||
end
|
||||
@@ -808,7 +884,7 @@ function love.touchpressed(id,x,y)
|
||||
touching=id
|
||||
love.touchmoved(id,x,y,0,0)
|
||||
end
|
||||
touchDist=nil--reset distance
|
||||
touchDist=nil--Reset distance
|
||||
x,y=xOy:inverseTransformPoint(x,y)
|
||||
lastX,lastY=x,y
|
||||
if touchDown[SCN.cur]then
|
||||
@@ -843,27 +919,18 @@ function love.touchreleased(id,x,y)
|
||||
if touchUp[SCN.cur]then
|
||||
touchUp[SCN.cur](id,x,y)
|
||||
end
|
||||
if(x-lastX)^2+(y-lastY)^2<26 and touchClick[SCN.cur]then
|
||||
touchClick[SCN.cur](x,y,k)
|
||||
if(x-lastX)^2+(y-lastY)^2<26 then
|
||||
if touchClick[SCN.cur]then
|
||||
touchClick[SCN.cur](x,y,k)
|
||||
end
|
||||
sysFX.newRipple(.3,x,y,30)
|
||||
end
|
||||
end
|
||||
function love.keypressed(i)
|
||||
mouseShow=false
|
||||
if not devMode then
|
||||
if i~="f8"then
|
||||
if SCN.swapping then return end
|
||||
|
||||
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
|
||||
elseif i=="escape"then SCN.back()
|
||||
else WIDGET.keyPressed(i)
|
||||
end
|
||||
else
|
||||
devMode=1
|
||||
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
|
||||
end
|
||||
else
|
||||
if devMode then
|
||||
if i=="f5"then
|
||||
print("DEBUG:")
|
||||
DBP("DEBUG:")
|
||||
elseif i=="f8"then devMode=nil TEXT.show("DEBUG OFF",640,360,80,"fly",.8)
|
||||
elseif i=="f9"then devMode=1 TEXT.show("DEBUG 1",640,360,80,"fly",.8)
|
||||
elseif i=="f10"then devMode=2 TEXT.show("DEBUG 2",640,360,80,"fly",.8)
|
||||
@@ -885,7 +952,7 @@ function love.keypressed(i)
|
||||
assert(false,"Techmino:挂了")
|
||||
elseif i=="e"then
|
||||
for k,v in next,_G do
|
||||
print(k,v)
|
||||
DBP(k,v)
|
||||
end
|
||||
elseif WIDGET.sel then
|
||||
local W=WIDGET.sel
|
||||
@@ -901,7 +968,22 @@ function love.keypressed(i)
|
||||
elseif i=="]"then W.font=W.font+1
|
||||
end
|
||||
end
|
||||
else
|
||||
goto NORMAL
|
||||
end
|
||||
return
|
||||
end
|
||||
::NORMAL::
|
||||
if i~="f8"then
|
||||
if SCN.swapping then return end
|
||||
|
||||
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
|
||||
elseif i=="escape"then SCN.back()
|
||||
else WIDGET.keyPressed(i)
|
||||
end
|
||||
else
|
||||
devMode=1
|
||||
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
|
||||
end
|
||||
end
|
||||
function love.keyreleased(i)
|
||||
@@ -970,10 +1052,11 @@ function love.lowmemory()
|
||||
collectgarbage()
|
||||
end
|
||||
function love.resize(w,h)
|
||||
scr.w,scr.h=w,h
|
||||
scr.w,scr.h,scr.dpi=w,h,gc.getDPIScale()
|
||||
scr.W,scr.H=scr.w*scr.dpi,scr.h*scr.dpi
|
||||
scr.r=h/w
|
||||
scr.rad=(w^2+h^2)^.5
|
||||
scr.dpi=gc.getDPIScale()
|
||||
|
||||
if scr.r>=.5625 then
|
||||
scr.k=w/1280
|
||||
scr.x,scr.y=0,(h-w*9/16)*.5
|
||||
@@ -989,13 +1072,77 @@ function love.resize(w,h)
|
||||
end
|
||||
function love.focus(f)
|
||||
if f then
|
||||
TASK.new(TICK.autoResize,{0})
|
||||
love.timer.step()
|
||||
elseif SCN.cur=="play"and setting.autoPause then
|
||||
pauseGame()
|
||||
end
|
||||
end
|
||||
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
||||
function love.errorhandler(msg)
|
||||
local PUMP,POLL=love.event.pump,love.event.poll
|
||||
love.mouse.setVisible(true)
|
||||
love.audio.stop()
|
||||
local err={"Error:"..msg}
|
||||
local trace=debug.traceback("",2)
|
||||
local c=2
|
||||
for l in string.gmatch(trace,"(.-)\n")do
|
||||
if c>2 then
|
||||
if not string.find(l,"boot")then
|
||||
err[c]=string.gsub(l,"^\t*","")
|
||||
c=c+1
|
||||
end
|
||||
else
|
||||
err[2]="Traceback"
|
||||
c=3
|
||||
end
|
||||
end
|
||||
print(table.concat(err,"\n"),1,c-2)
|
||||
gc.reset()
|
||||
local CAP
|
||||
local function _(_)CAP=gc.newImage(_)end
|
||||
gc.captureScreenshot(_)
|
||||
gc.present()
|
||||
setting.sfx=setting.voc--only for error "voice" played with voice volume,not saved
|
||||
if SFX.list.error then SFX.play("error",.8)end
|
||||
local BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
|
||||
local needDraw=true
|
||||
return function()
|
||||
PUMP()
|
||||
for E,a,b,c,d,e in POLL()do
|
||||
if E=="quit"or a=="escape"then
|
||||
destroyPlayers()
|
||||
return 1
|
||||
elseif E=="resize"then
|
||||
love.resize(a,b)
|
||||
needDraw=true
|
||||
elseif E=="focus"then
|
||||
needDraw=true
|
||||
end
|
||||
end
|
||||
if needDraw then
|
||||
gc.discard()
|
||||
gc.clear(BGcolor)
|
||||
gc.setColor(1,1,1)
|
||||
gc.push("transform")
|
||||
gc.replaceTransform(xOy)
|
||||
gc.draw(CAP,100,365,nil,512/CAP:getWidth(),288/CAP:getHeight())
|
||||
setFont(120)gc.print(":(",100,40)
|
||||
setFont(38)gc.printf(text.errorMsg,100,200,1280-100)
|
||||
setFont(20)
|
||||
gc.print(system.."-"..gameVersion,100,660)
|
||||
gc.print("scene:"..SCN.cur,400,660)
|
||||
gc.printf(err[1],626,360,1260-626)
|
||||
gc.print("TRACEBACK",626,426)
|
||||
for i=4,#err-2 do
|
||||
gc.print(err[i],626,370+20*i)
|
||||
end
|
||||
gc.pop()
|
||||
gc.present()
|
||||
needDraw=false
|
||||
end
|
||||
love.timer.sleep(.2)
|
||||
end
|
||||
end
|
||||
local scs={.5,1.5,.5,1.5,.5,1.5,.5,1.5,.5,1.5,1,1,0,2}
|
||||
local devColor={
|
||||
color.white,
|
||||
color.lMagenta,
|
||||
@@ -1012,9 +1159,10 @@ function love.run()
|
||||
|
||||
local waitTime=1/60
|
||||
local LIST={}
|
||||
local lastFrame=T.getTime()
|
||||
|
||||
local lastFrame=Timer()
|
||||
local lastFreshPow=lastFrame
|
||||
local FCT=0--framedraw counter
|
||||
local FCT=0--Framedraw counter
|
||||
|
||||
love.resize(gc.getWidth(),gc.getHeight())
|
||||
SCN.init("load")--Scene Launch
|
||||
@@ -1071,7 +1219,7 @@ function love.run()
|
||||
local R=int(r)%7+1
|
||||
_=SKIN.libColor[setting.skin[R]]
|
||||
gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3))
|
||||
gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,scs[2*R]-.5,#blocks[R][0]-scs[2*R-1]+.5)
|
||||
gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,scs[2*R],#blocks[R][0]-scs[2*R-1])
|
||||
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
|
||||
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
|
||||
end
|
||||
@@ -1087,7 +1235,7 @@ function love.run()
|
||||
|
||||
--Draw scene swapping animation
|
||||
if SCN.swapping then
|
||||
_=SCN.swap
|
||||
_=SCN.stat
|
||||
_.draw(_.time)
|
||||
end
|
||||
|
||||
@@ -1109,8 +1257,8 @@ function love.run()
|
||||
for i=1,#LIST do
|
||||
gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000)
|
||||
end
|
||||
if devMode==3 then WAIT(.26)
|
||||
elseif devMode==4 then WAIT(.626)
|
||||
if devMode==3 then WAIT(.1)
|
||||
elseif devMode==4 then WAIT(.5)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1119,13 +1267,18 @@ function love.run()
|
||||
end
|
||||
|
||||
--Fresh power info.
|
||||
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
|
||||
if Timer()-lastFreshPow>2 and setting.powerInfo and loadingFinished then
|
||||
updatePowerInfo()
|
||||
lastFreshPow=Timer()
|
||||
_=gc.getWidth()
|
||||
if _~=scr.w then
|
||||
love.resize(_,gc.getHeight())
|
||||
end
|
||||
end
|
||||
|
||||
--Keep 60fps
|
||||
if Timer()-lastFrame<.005 then WAIT(.01)end
|
||||
while Timer()-lastFrame<.0159 do WAIT(.001)end
|
||||
_=Timer()-lastFrame
|
||||
if _<.016 then WAIT(.016-_)end
|
||||
while Timer()-lastFrame<1/60-0.000005 do WAIT(0)end
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ local function draw(L)
|
||||
lightRenderShader:send("xresolution",L.size);
|
||||
shadowMapShader:send("yresolution",L.size);
|
||||
|
||||
--get up-left of light
|
||||
--Get up-left of light
|
||||
local X=L.x-L.size*.5
|
||||
local Y=L.y-L.size*.5
|
||||
|
||||
@@ -74,10 +74,10 @@ function LIGHT.add(x,y,R,F)
|
||||
--Methods
|
||||
id=id,
|
||||
x=x,y=y,size=R,
|
||||
blackCanvas=gc.newCanvas(R,R),--solid canvas
|
||||
blackCanvas=gc.newCanvas(R,R),--Solid canvas
|
||||
shadowCanvas=gc.newCanvas(R,1),--1D vis-depth canvas
|
||||
renderCanvas=gc.newCanvas(R,R),--light canvas
|
||||
blackFn=F,--solid draw funcion
|
||||
renderCanvas=gc.newCanvas(R,R),--Light canvas
|
||||
blackFn=F,--Solid draw funcion
|
||||
|
||||
|
||||
move=move,
|
||||
|
||||
@@ -9,11 +9,11 @@ local mStr=mStr
|
||||
local scr=scr
|
||||
local scs=require("parts/spinCenters")
|
||||
local modeRankColor={
|
||||
color.bronze, --Rank1
|
||||
color.lGrey, --Rank2
|
||||
color.lYellow, --Rank3
|
||||
color.lPurple, --Rank4
|
||||
color.lCyan, --Rank5
|
||||
color.dRed, --D
|
||||
color.dOrange, --C
|
||||
color.lYellow, --B
|
||||
color.lBlue, --A
|
||||
color.lCyan, --S
|
||||
color.lGreen, --Special
|
||||
}
|
||||
local rankString={
|
||||
@@ -66,7 +66,7 @@ local function drawVirtualkey()
|
||||
gc.setLineWidth(B.r*.07)
|
||||
gc.circle("line",B.x,B.y,B.r,10)--Button outline
|
||||
_=V[i].pressTime
|
||||
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--icon
|
||||
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--Icon
|
||||
if _>0 then
|
||||
gc.setColor(1,1,1,a*_*.08)
|
||||
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
|
||||
@@ -94,6 +94,16 @@ end
|
||||
|
||||
local Pnt={}
|
||||
|
||||
function Pnt.calculator()
|
||||
local S=sceneTemp
|
||||
gc.setLineWidth(4)
|
||||
gc.rectangle("line",100,80,650,150)
|
||||
setFont(45)
|
||||
if S.reg then gc.printf(S.reg,0,100,720,"right")end
|
||||
if S.val then gc.printf(S.val,0,150,720,"right")end
|
||||
setFont(50)
|
||||
if S.sym then gc.print(S.sym,126,150)end
|
||||
end
|
||||
function Pnt.load()
|
||||
local S=sceneTemp
|
||||
gc.setLineWidth(4)
|
||||
@@ -101,13 +111,15 @@ function Pnt.load()
|
||||
gc.rectangle("fill",300,330,S.cur/S.tar*680,60,5)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",300,330,680,60,5)
|
||||
setFont(35)
|
||||
gc.print(text.load[S.phase],340,335)
|
||||
if S.phase~=0 then
|
||||
gc.printf(S.cur.."/"..S.tar,795,335,150,"right")
|
||||
if not setting.appLock then
|
||||
setFont(35)
|
||||
gc.print(text.load[S.phase],340,335)
|
||||
if S.phase~=0 then
|
||||
gc.printf(S.cur.."/"..S.tar,795,335,150,"right")
|
||||
end
|
||||
setFont(25)
|
||||
mStr(S.tip,640,400)
|
||||
end
|
||||
setFont(25)
|
||||
mStr(S.tip,640,400)
|
||||
end
|
||||
|
||||
local titleTransform={
|
||||
@@ -186,6 +198,7 @@ function Pnt.mode()
|
||||
local sel=cam.sel
|
||||
setFont(30)
|
||||
|
||||
--Draw lines connecting modes
|
||||
gc.setLineWidth(8)
|
||||
gc.setColor(1,1,1,.2)
|
||||
for name,M in next,Modes do
|
||||
@@ -195,7 +208,7 @@ function Pnt.mode()
|
||||
gc.line(M.x,M.y,m.x,m.y)
|
||||
end
|
||||
end
|
||||
end--lines connecting modes
|
||||
end
|
||||
|
||||
for name,M in next,Modes do
|
||||
if R[name]then
|
||||
@@ -217,7 +230,7 @@ function Pnt.mode()
|
||||
gc.setLineWidth(10)
|
||||
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
|
||||
end
|
||||
elseif M.shape==2 then--diamond
|
||||
elseif M.shape==2 then--Diamond
|
||||
gc.circle("fill",M.x,M.y,S+5,4)
|
||||
if sel==name then
|
||||
gc.setColor(1,1,1)
|
||||
@@ -353,10 +366,14 @@ function Pnt.sequence()
|
||||
gc.print(len,120,300)
|
||||
|
||||
local L=TEXTURE.miniBlock
|
||||
local lib=SKIN.libColor
|
||||
local set=setting.skin
|
||||
|
||||
local x,y=120,126
|
||||
local cx,cy=120,126
|
||||
for i=1,len do
|
||||
local B=L[bag[i]]
|
||||
gc.setColor(lib[set[bag[i]]])
|
||||
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
|
||||
x=x+B:getWidth()*15+10
|
||||
if x>1126 then
|
||||
@@ -373,10 +390,9 @@ function Pnt.sequence()
|
||||
--Confirm reset
|
||||
if s.sure>0 then
|
||||
gc.setColor(1,1,1,s.sure*.02)
|
||||
gc.draw(drawableText.question,1035,570)
|
||||
gc.draw(drawableText.question,980,470)
|
||||
end
|
||||
end
|
||||
|
||||
function Pnt.draw()
|
||||
local sx,sy=sceneTemp.x,sceneTemp.y
|
||||
gc.translate(200,60)
|
||||
@@ -441,6 +457,7 @@ function Pnt.play()
|
||||
for p=1,#players do
|
||||
players[p]:draw()
|
||||
end
|
||||
|
||||
gc.setLineWidth(5)
|
||||
for i=1,#FX_attack do
|
||||
local A=FX_attack[i]
|
||||
@@ -463,9 +480,11 @@ function Pnt.play()
|
||||
gc.rotate(A.t*.1)
|
||||
gc.circle("fill",0,0,A.rad,A.corner)
|
||||
gc.pop()
|
||||
end--FX animation
|
||||
end
|
||||
|
||||
gc.setColor(1,1,1)
|
||||
if setting.VKSwitch then drawVirtualkey()end
|
||||
|
||||
if modeEnv.royaleMode then
|
||||
for i=1,#FX_badge do
|
||||
local b=FX_badge[i]
|
||||
@@ -501,12 +520,18 @@ function Pnt.play()
|
||||
gc.draw(drawableText.modeName,485,10)
|
||||
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10)
|
||||
|
||||
--Danger
|
||||
--Replaying
|
||||
if game.replaying then
|
||||
gc.setColor(1,1,Timer()%1>.5 and 1 or 0)
|
||||
mText(drawableText.replaying,410,17)
|
||||
end
|
||||
|
||||
--Warning
|
||||
gc.push("transform")
|
||||
gc.origin()
|
||||
if restartCount>0 then
|
||||
gc.setColor(0,0,0,restartCount*.05)
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
gc.rectangle("fill",0,0,scr.W,scr.H)
|
||||
end
|
||||
if game.warnLVL>0 then
|
||||
gc.setColor(0,0,0,0)
|
||||
@@ -517,10 +542,10 @@ function Pnt.play()
|
||||
end
|
||||
gc.pop()
|
||||
end
|
||||
|
||||
local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}for i=1,6 do hexList[i]=hexList[i]*150 end
|
||||
local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25}
|
||||
local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13}
|
||||
|
||||
function Pnt.pause()
|
||||
local S=sceneTemp
|
||||
local T=S.timer*.02
|
||||
@@ -531,7 +556,7 @@ function Pnt.pause()
|
||||
gc.setColor(.15,.15,.15,_)
|
||||
gc.push("transform")
|
||||
gc.origin()
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
gc.rectangle("fill",0,0,scr.W,scr.H)
|
||||
gc.pop()
|
||||
|
||||
--Pause Info
|
||||
@@ -611,14 +636,14 @@ end
|
||||
function Pnt.setting_game()
|
||||
gc.setColor(1,1,1)
|
||||
mText(drawableText.setting_game,640,15)
|
||||
gc.draw(blockSkin[int(Timer()*2)%11+1],720,540,Timer()%6.28319,2,nil,15,15)
|
||||
gc.draw(blockSkin[int(Timer()*2)%11+1],590,540,Timer()%6.28319,2,nil,15,15)
|
||||
end
|
||||
function Pnt.setting_video()
|
||||
gc.setColor(1,1,1)
|
||||
mText(drawableText.setting_video,640,15)
|
||||
end
|
||||
function Pnt.setting_sound()
|
||||
gc.setColor(1,1,1,.8)
|
||||
gc.setColor(1,1,1)
|
||||
mText(drawableText.setting_sound,640,15)
|
||||
local t=Timer()
|
||||
local _=sceneTemp.jump
|
||||
@@ -632,6 +657,7 @@ function Pnt.setting_sound()
|
||||
gc.draw(IMG.miyaF4,129,98+3*sin(t*.7))
|
||||
gc.translate(-x,-y)
|
||||
end
|
||||
|
||||
local function timeConv(t)
|
||||
return t.."F "..int(t*16.67).."ms"
|
||||
end
|
||||
@@ -724,7 +750,7 @@ function Pnt.setting_skin()
|
||||
for N=1,7 do
|
||||
local face=setting.face[N]
|
||||
local B=blocks[N][face]
|
||||
local x,y=-25+140*N-scs[N][face][2]*30,325+scs[N][face][1]*30
|
||||
local x,y=-55+140*N-scs[N][face][2]*30,355+scs[N][face][1]*30
|
||||
local col=#B[1]
|
||||
for i=1,#B do for j=1,col do
|
||||
if B[i][j]then
|
||||
@@ -843,6 +869,6 @@ function Pnt.history()
|
||||
gc.rectangle("line",30,45,1000,632)
|
||||
setFont(20)
|
||||
local _=sceneTemp
|
||||
gc.print(_[1][_[2]],40,50)
|
||||
gc.print(_.text[_.pos],40,50)
|
||||
end
|
||||
return Pnt
|
||||
@@ -1,23 +1,20 @@
|
||||
local gc=love.graphics
|
||||
local int,max,log=math.floor,math.max,math.log
|
||||
local int,abs=math.floor,math.abs
|
||||
local max,log=math.max,math.log
|
||||
local rnd,sin,cos=math.random,math.sin,math.cos
|
||||
local format=string.format
|
||||
local scr=scr
|
||||
local SCN={
|
||||
cur="load",--Current scene
|
||||
swapping=false,--ifSwapping
|
||||
swap={
|
||||
tar=nil, --Swapping target
|
||||
style=nil, --Swapping style
|
||||
mid=nil, --Loading point
|
||||
time=nil, --Full swap time
|
||||
draw=nil, --Swap draw func
|
||||
},
|
||||
seq={"quit","slowFade"},--Back sequence
|
||||
}--scene datas,returned
|
||||
|
||||
local sceneInit={}
|
||||
sceneInit.quit=love.event.quit
|
||||
function sceneInit.calculator()
|
||||
sceneTemp={
|
||||
reg=false,
|
||||
val=0,
|
||||
sym=false,
|
||||
pass=false,
|
||||
}
|
||||
end
|
||||
function sceneInit.load()
|
||||
sceneTemp={
|
||||
phase=1,--Loading stage
|
||||
@@ -50,11 +47,11 @@ end
|
||||
function sceneInit.main()
|
||||
BG.set("space")
|
||||
BGM.play("blank")
|
||||
destroyPlayers()
|
||||
|
||||
modeEnv={}
|
||||
if not players[1]then
|
||||
PLY.newDemoPlayer(1,900,35,1.1)
|
||||
end--Create demo player
|
||||
--Create demo player
|
||||
destroyPlayers()
|
||||
PLY.newDemoPlayer(1,900,35,1.1)
|
||||
end
|
||||
function sceneInit.music()
|
||||
if BGM.nowPlay then
|
||||
@@ -120,27 +117,27 @@ function sceneInit.pause(org)
|
||||
timer=org=="play"and 0 or 50,
|
||||
list={
|
||||
toTime(S.time),
|
||||
S.key.."/"..S.rotate.."/"..S.hold,
|
||||
format("%d/%d/%d",S.key,S.rotate,S.hold),
|
||||
format("%d %.2fPPS",S.piece,S.piece/S.time),
|
||||
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
|
||||
format("%d(%d) %.2fAPM",S.atk,S.digatk,S.atk/S.time*60),
|
||||
format("%d(%d-%d)",S.pend,S.recv,S.recv-S.pend),
|
||||
format("%d/%d/%d/%d",S.clears[1],S.clears[2],S.clears[3],S.clears[4]),
|
||||
format("(%d)/%d/%d/%d",S.spins[1],S.spins[2],S.spins[3],S.spins[4]),
|
||||
format("%d/%d;%d/%d",S.b2b,S.b3b,S.pc,S.hpc),
|
||||
format("%d[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
|
||||
format("%d/%d ; %d/%d",S.b2b,S.b3b,S.pc,S.hpc),
|
||||
format("%d [%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
|
||||
},
|
||||
|
||||
--from right-down, 60 degree each
|
||||
--From right-down, 60 degree each
|
||||
radar={
|
||||
(S.off+S.dig)/S.time*60,--DefPM
|
||||
(S.off)/S.time*60, --OffPM
|
||||
(S.send+S.dig)/S.time*60,--ADPM
|
||||
S.atk/S.time*60, --AtkPM
|
||||
S.send/S.time*60, --SendPM
|
||||
S.piece/S.time*24, --LinePM
|
||||
S.dig/S.time*60, --DigPM
|
||||
},
|
||||
val={1/80,1/40,1/60,1/60,1/100,1/40},
|
||||
val={1/80,1/80,1/80,1/60,1/100,1/40},
|
||||
timing=org=="play",
|
||||
}
|
||||
local _=sceneTemp
|
||||
@@ -186,7 +183,10 @@ function sceneInit.setting_video()
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.setting_sound()
|
||||
sceneTemp={last=0,jump=0}--last sound time,animation count(10 to 0)
|
||||
sceneTemp={
|
||||
last=0,--Last sound time
|
||||
jump=0,--Animation timer(10 to 0)
|
||||
}
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.setting_control()
|
||||
@@ -197,7 +197,7 @@ function sceneInit.setting_control()
|
||||
dir=1,
|
||||
wait=30,
|
||||
}
|
||||
BG.set("game1")
|
||||
BG.set("bg1")
|
||||
end
|
||||
function sceneInit.setting_key()
|
||||
sceneTemp={
|
||||
@@ -207,7 +207,7 @@ function sceneInit.setting_key()
|
||||
}
|
||||
end
|
||||
function sceneInit.setting_touch()
|
||||
BG.set("game3")
|
||||
BG.set("rainbow")
|
||||
sceneTemp={
|
||||
default=1,
|
||||
snap=1,
|
||||
@@ -222,7 +222,6 @@ function sceneInit.help()
|
||||
end
|
||||
function sceneInit.staff()
|
||||
sceneTemp={
|
||||
pw=0,
|
||||
time=0,
|
||||
v=1,
|
||||
}
|
||||
@@ -265,12 +264,19 @@ function sceneInit.stat()
|
||||
end
|
||||
end
|
||||
function sceneInit.history()
|
||||
BG.set("game3")
|
||||
sceneTemp={require("parts/updateLog"),1}--scroll pos
|
||||
BG.set("rainbow")
|
||||
sceneTemp={
|
||||
text=require("parts/updateLog"),--Text list
|
||||
pos=1,--Scroll pos
|
||||
}
|
||||
if newVersionLaunch then
|
||||
newVersionLaunch=nil
|
||||
sceneTemp.pos=4
|
||||
end
|
||||
end
|
||||
function sceneInit.debug()
|
||||
sceneTemp={
|
||||
ct=0,
|
||||
reset=false,
|
||||
}
|
||||
end
|
||||
function sceneInit.quit()
|
||||
@@ -282,47 +288,55 @@ function sceneInit.quit()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local swap={
|
||||
none={1,0,NULL},
|
||||
flash={8,1,function()gc.clear(1,1,1)end},
|
||||
fade={30,15,function(t)
|
||||
local t=t>15 and 2-t/15 or t/15
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
end},
|
||||
fade_togame={120,20,function(t)
|
||||
local t=t>20 and (120-t)/100 or t/20
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
end},
|
||||
slowFade={180,90,function(t)
|
||||
local t=t>90 and 2-t/90 or t/90
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
end},
|
||||
}--Scene swapping animations
|
||||
local backFunc={
|
||||
load=love.event.quit,
|
||||
pause=function()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
local sceneBack={}
|
||||
function sceneBack.load()
|
||||
love.event.quit()
|
||||
end
|
||||
function sceneBack.pause()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
if not game.replaying then
|
||||
mergeStat(stat,players[1].stat)
|
||||
TASK.clear("play")
|
||||
end,
|
||||
setting_game= function()FILE.saveSetting()end,
|
||||
setting_video= function()FILE.saveSetting()end,
|
||||
setting_sound= function()FILE.saveSetting()end,
|
||||
setting_touch= function()FILE.saveVK()end,
|
||||
setting_key= function()FILE.saveKeyMap()end,
|
||||
setting_lang= function()FILE.saveSetting()end,
|
||||
}
|
||||
end
|
||||
FILE.saveData()
|
||||
TASK.clear("play")
|
||||
end
|
||||
function sceneBack.setting_game()
|
||||
FILE.saveSetting()
|
||||
end
|
||||
function sceneBack.setting_video()
|
||||
FILE.saveSetting()
|
||||
end
|
||||
function sceneBack.setting_sound()
|
||||
FILE.saveSetting()
|
||||
end
|
||||
function sceneBack.setting_touch()
|
||||
FILE.saveVK()
|
||||
end
|
||||
function sceneBack.setting_key()
|
||||
FILE.saveKeyMap()
|
||||
end
|
||||
function sceneBack.setting_lang()
|
||||
FILE.saveSetting()
|
||||
end
|
||||
|
||||
local SCN={
|
||||
cur="load",--Current scene
|
||||
swapping=false,--If Swapping
|
||||
stat={
|
||||
tar=nil, --Swapping target
|
||||
style=nil, --Swapping style
|
||||
mid=nil, --Loading point
|
||||
time=nil, --Full swap time
|
||||
draw=nil, --Swap draw func
|
||||
},
|
||||
seq={"quit","slowFade"},--Back sequence
|
||||
}--Scene datas, returned
|
||||
|
||||
function SCN.swapUpdate()
|
||||
local S=SCN.swap
|
||||
local S=SCN.stat
|
||||
S.time=S.time-1
|
||||
if S.time==S.mid then
|
||||
SCN.init(S.tar,SCN.cur)
|
||||
SCN.cur=S.tar
|
||||
WIDGET.set(Widgets[S.tar])
|
||||
collectgarbage()
|
||||
--Scene swapped this moment
|
||||
end
|
||||
@@ -332,6 +346,8 @@ function SCN.swapUpdate()
|
||||
end
|
||||
function SCN.init(s,org)
|
||||
if sceneInit[s]then sceneInit[s](org)end
|
||||
SCN.cur=s
|
||||
WIDGET.set(Widgets[s])
|
||||
end
|
||||
function SCN.push(tar,style)
|
||||
if not SCN.swapping then
|
||||
@@ -342,10 +358,37 @@ function SCN.push(tar,style)
|
||||
end
|
||||
function SCN.pop()
|
||||
local _=SCN.seq
|
||||
_[#_-1]=nil
|
||||
_[#_],_[#_-1]=nil
|
||||
end
|
||||
function SCN.swapTo(tar,style)
|
||||
local S=SCN.swap
|
||||
|
||||
local swap={
|
||||
none={1,0,NULL},--swap time, change time, draw function
|
||||
flash={8,1,function()gc.clear(1,1,1)end},
|
||||
fade={30,15,function(t)
|
||||
local t=t>15 and 2-t/15 or t/15
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.W,scr.H)
|
||||
end},
|
||||
fade_togame={120,20,function(t)
|
||||
local t=t>20 and(120-t)/100 or t/20
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.W,scr.H)
|
||||
end},
|
||||
slowFade={180,90,function(t)
|
||||
local t=t>90 and 2-t/90 or t/90
|
||||
gc.setColor(0,0,0,t)
|
||||
gc.rectangle("fill",0,0,scr.W,scr.H)
|
||||
end},
|
||||
swipe={30,15,function(t)
|
||||
t=t/30
|
||||
gc.setColor(.1,.1,.1,1-abs(t-.5))
|
||||
t=t*t*(3-2*t)*2-1
|
||||
local w=scr.W
|
||||
gc.rectangle("fill",t*w,0,w,scr.H)
|
||||
end},
|
||||
}--Scene swapping animations
|
||||
function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
|
||||
local S=SCN.stat
|
||||
if not SCN.swapping and tar~=SCN.cur then
|
||||
SCN.swapping=true
|
||||
if not style then style="fade"end
|
||||
@@ -357,17 +400,18 @@ function SCN.swapTo(tar,style)
|
||||
S.draw=swap[3]
|
||||
end
|
||||
end
|
||||
function SCN.goto(tar,style)
|
||||
function SCN.go(tar,style)--Normal scene swapping, can back
|
||||
SCN.push()SCN.swapTo(tar,style)
|
||||
end
|
||||
function SCN.back()
|
||||
if backFunc[SCN.cur] then backFunc[SCN.cur]()end
|
||||
--func when scene end
|
||||
--Leave scene
|
||||
if sceneBack[SCN.cur] then sceneBack[SCN.cur]()end
|
||||
|
||||
--Poll&Back to previous Scene
|
||||
local m=#SCN.seq
|
||||
if m>0 then
|
||||
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
|
||||
SCN.seq[m],SCN.seq[m-1]=nil
|
||||
--Poll&Back to preScene
|
||||
end
|
||||
end
|
||||
return SCN
|
||||
@@ -34,11 +34,11 @@ function SFX.loadAll()
|
||||
end
|
||||
end
|
||||
function SFX.fieldPlay(s,v,P)
|
||||
SFX.play(s,v,(P.curX+P.sc[2]-6.5)*.15)
|
||||
SFX.play(s,v,(P.curX+P.sc[2]-5.5)*.15)
|
||||
end
|
||||
function SFX.play(s,vol,pos,force)
|
||||
if setting.sfx==0 and not force then return end
|
||||
local S=SFX.list[s]--source list
|
||||
function SFX.play(s,vol,pos)
|
||||
if setting.sfx==0 then return end
|
||||
local S=SFX.list[s]--Source list
|
||||
if not S then return end
|
||||
local n=1
|
||||
while S[n]:isPlaying()do
|
||||
@@ -58,11 +58,31 @@ function SFX.play(s,vol,pos,force)
|
||||
S:setPosition(0,0,0)
|
||||
end
|
||||
end
|
||||
if not force then
|
||||
S:setVolume((vol or 1)*setting.sfx*.1)
|
||||
else
|
||||
S:setVolume(vol*.1)
|
||||
S:setVolume(((vol or 1)*setting.sfx*.01)^1.626)
|
||||
S:play()
|
||||
end
|
||||
function SFX.fplay(s,vol,pos)
|
||||
local S=SFX.list[s]--Source list
|
||||
if not S then return end
|
||||
local n=1
|
||||
while S[n]:isPlaying()do
|
||||
n=n+1
|
||||
if not S[n]then
|
||||
S[n]=S[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((vol*.01)^1.626)
|
||||
S:play()
|
||||
end
|
||||
function SFX.reset()
|
||||
|
||||
@@ -9,6 +9,6 @@ return{
|
||||
aura=N("aura"),
|
||||
gradient1=N("grad1"),--Horizonal red-blue gradient
|
||||
gradient2=N("grad2"),--Vertical red-green gradient
|
||||
rgb1=N("rgb1"),--colorful RGB
|
||||
rgb2=N("rgb2"),--blue RGB
|
||||
rgb1=N("rgb1"),--Colorful RGB
|
||||
rgb2=N("rgb2"),--Blue RGB
|
||||
}
|
||||
@@ -3,6 +3,6 @@ extern float level;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
float dx=abs(scr_pos.x/w-0.5);
|
||||
float dy=abs(scr_pos.y/h-0.5);
|
||||
float a=(max(dx,dy)*2.-.626)*level;
|
||||
float a=(max(dx*2.6,dy*1.8)-.626)*level;
|
||||
return vec4(1.,0.,0.,a);
|
||||
}
|
||||
@@ -1,31 +1,47 @@
|
||||
local gc=love.graphics
|
||||
local setColor=gc.setColor
|
||||
local setWidth=gc.setLineWidth
|
||||
local rect=gc.rectangle
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
local fx={}
|
||||
|
||||
local FXupdate={}
|
||||
function FXupdate.ripple(S,dt)
|
||||
S.t=S.t+dt*S.rate
|
||||
return S.t>=1
|
||||
end
|
||||
function FXupdate.rectRipple(S,dt)
|
||||
S.t=S.t+dt*S.rate
|
||||
return S.t>=1
|
||||
end
|
||||
function FXupdate.shade(S,dt)
|
||||
S.t=S.t+dt*S.rate
|
||||
return S.t>=1
|
||||
end
|
||||
|
||||
local FXdraw={}
|
||||
function FXdraw.ripple(S)
|
||||
setWidth(2)
|
||||
local t=S.t
|
||||
setColor(1,1,1,1-t)
|
||||
gc.circle("line",S.x,S.y,t*(2-t)*S.r)
|
||||
end
|
||||
function FXdraw.rectRipple(S)
|
||||
setWidth(6)
|
||||
setColor(1,1,1,1-S.t)
|
||||
local r=(10*S.t)^1.2
|
||||
rect("line",S[1]-r,S[2]-r,S[3]+2*r,S[4]+2*r)
|
||||
gc.rectangle("line",S.x-r,S.y-r,S.w+2*r,S.h+2*r)
|
||||
end
|
||||
function FXdraw.shade(S)
|
||||
setColor(S[1],S[2],S[3],1-S.t)
|
||||
rect("fill",S[4],S[5],S[6],S[7],2)
|
||||
setColor(S.r,S.g,S.b,1-S.t)
|
||||
gc.rectangle("fill",S.x,S.y,S.w,S.h,2)
|
||||
end
|
||||
|
||||
local sysFX={}
|
||||
function sysFX.update(dt)
|
||||
for i=#fx,1,-1 do
|
||||
local S=fx[i]
|
||||
S.t=S.t+dt*S.rate
|
||||
if S.t>=1 then
|
||||
for i=i,#fx do
|
||||
fx[i]=fx[i+1]
|
||||
end
|
||||
if fx[i]:update(dt) then
|
||||
rem(fx,i)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -34,9 +50,33 @@ function sysFX.draw()
|
||||
fx[i]:draw()
|
||||
end
|
||||
end
|
||||
--0=ripple,x,y,w,h
|
||||
--1=shade,r,g,b,x,y,w,h
|
||||
function sysFX.new(type,duration,...)
|
||||
fx[#fx+1]={draw=FXdraw[type],t=0,rate=1/duration,...}
|
||||
|
||||
function sysFX.newRipple(duration,x,y,r)
|
||||
fx[#fx+1]={
|
||||
update=FXupdate.ripple,
|
||||
draw=FXdraw.ripple,
|
||||
t=0,
|
||||
rate=1/duration,
|
||||
x=x,y=y,r=r,
|
||||
}
|
||||
end
|
||||
function sysFX.newRectRipple(duration,x,y,w,h)
|
||||
fx[#fx+1]={
|
||||
update=FXupdate.rectRipple,
|
||||
draw=FXdraw.rectRipple,
|
||||
t=0,
|
||||
rate=1/duration,
|
||||
x=x,y=y,w=w,h=h,
|
||||
}
|
||||
end
|
||||
function sysFX.newShade(duration,r,g,b,x,y,w,h)
|
||||
fx[#fx+1]={
|
||||
update=FXupdate.shade,
|
||||
draw=FXdraw.shade,
|
||||
t=0,
|
||||
rate=1/duration,
|
||||
r=r,g=g,b=b,
|
||||
x=x,y=y,w=w,h=h,
|
||||
}
|
||||
end
|
||||
return sysFX
|
||||
@@ -74,7 +74,7 @@ local TEXT={}
|
||||
function TEXT.clear()
|
||||
texts={}
|
||||
end
|
||||
function TEXT.getText(text,x,y,font,style,spd,stop)
|
||||
function TEXT.getText(text,x,y,font,style,spd,stop)--Another version of TEXT()
|
||||
return{
|
||||
c=0,
|
||||
text=text,
|
||||
@@ -85,17 +85,17 @@ function TEXT.getText(text,x,y,font,style,spd,stop)
|
||||
stop=stop,
|
||||
draw=textFX[style]or assert(false,"unavailable type:"..style),
|
||||
}
|
||||
end--another version of TEXT()
|
||||
end
|
||||
function TEXT.show(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 assert(false,"unavailable type:"..style), --draw method
|
||||
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 assert(false,"unavailable type:"..style), --Draw method
|
||||
}
|
||||
end
|
||||
function TEXT.update(list)
|
||||
|
||||
@@ -18,13 +18,20 @@ function Tmr.load()
|
||||
elseif S.phase==4 then
|
||||
IMG.loadOne(S.cur)
|
||||
elseif S.phase==5 then
|
||||
local m=Modes[S.cur]--mode template
|
||||
local M=require("modes/"..m.name)--mode file
|
||||
local m=Modes[S.cur]--Mode template
|
||||
local M=require("modes/"..m.name)--Mode file
|
||||
Modes[m.name],Modes[S.cur]=M
|
||||
for k,v in next,m do
|
||||
M[k]=v
|
||||
end
|
||||
M.records=FILE.loadRecord(m.name)or M.score and{}
|
||||
if M.score then
|
||||
if modeRanks[M.name]==6 then
|
||||
modeRanks[M.name]=0
|
||||
end
|
||||
else
|
||||
modeRanks[M.name]=6
|
||||
end
|
||||
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
|
||||
-- M.icon=gc.newImage("image/modeIcon/custom.png")
|
||||
elseif S.phase==6 then
|
||||
@@ -32,14 +39,17 @@ function Tmr.load()
|
||||
SKIN.load()
|
||||
stat.run=stat.run+1
|
||||
--------------------------
|
||||
SFX.play("welcome_sfx")
|
||||
VOC.play("welcome")
|
||||
if not setting.appLock then
|
||||
SFX.play("welcome_sfx")
|
||||
VOC.play("welcome")
|
||||
end
|
||||
else
|
||||
S.cur=S.cur+1
|
||||
S.tar=S.cur
|
||||
if S.cur>62.6 then
|
||||
SCN.swapTo("intro","none")
|
||||
SCN.swapTo(setting.appLock and "calculator"or"intro","none")
|
||||
end
|
||||
loadingFinished=true
|
||||
return
|
||||
end
|
||||
S.cur=S.cur+1
|
||||
@@ -113,12 +123,12 @@ function Tmr.mode(dt)
|
||||
elseif y<-1900*k then y=-1900*k
|
||||
end
|
||||
cam.x,cam.y=x,y
|
||||
--keyboard controlling
|
||||
--Keyboard controlling
|
||||
|
||||
cam.x1=cam.x1*.85+x*.15
|
||||
cam.y1=cam.y1*.85+y*.15
|
||||
cam.k1=cam.k1*.85+k*.15
|
||||
local _=SCN.swap.tar
|
||||
local _=SCN.stat.tar
|
||||
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
|
||||
if cam.zoomMethod==1 then
|
||||
if cam.sel then
|
||||
@@ -141,9 +151,11 @@ function Tmr.draw()
|
||||
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
||||
end
|
||||
function Tmr.play(dt)
|
||||
local _
|
||||
game.frame=game.frame+1
|
||||
stat.time=stat.time+dt
|
||||
local P1=players[1]
|
||||
|
||||
--Update attack FX
|
||||
for i=#FX_attack,1,-1 do
|
||||
local b=FX_attack[i]
|
||||
b.t=b.t+1
|
||||
@@ -151,15 +163,16 @@ function Tmr.play(dt)
|
||||
b.rad=b.rad*1.05+.1
|
||||
b.x,b.y=b.x2,b.y2
|
||||
elseif b.t>10 then
|
||||
local t=((b.t-10)*.025)t=(3-2*t)*t*t
|
||||
b.x,b.y=b.x1*(1-t)+b.x2*t,b.y1*(1-t)+b.y2*t
|
||||
_=(b.t-10)*.025
|
||||
_=(3-2*_)*_*_
|
||||
b.x,b.y=b.x1*(1-_)+b.x2*_,b.y1*(1-_)+b.y2*_
|
||||
end
|
||||
if b.t<60 then
|
||||
local L=FX_attack[i].drag
|
||||
if #L==4*setting.atkFX then
|
||||
rem(L,1)rem(L,1)
|
||||
_=FX_attack[i].drag
|
||||
if #_==4*setting.atkFX then
|
||||
rem(_,1)rem(_,1)
|
||||
end
|
||||
ins(L,b.x)ins(L,b.y)
|
||||
ins(_,b.x)ins(_,b.y)
|
||||
else
|
||||
for i=i,#FX_attack do
|
||||
FX_attack[i]=FX_attack[i+1]
|
||||
@@ -167,6 +180,7 @@ function Tmr.play(dt)
|
||||
end
|
||||
end
|
||||
|
||||
--Update badge FX
|
||||
for i=#FX_badge,1,-1 do
|
||||
local b=FX_badge[i]
|
||||
b.t=b.t+1
|
||||
@@ -174,14 +188,38 @@ function Tmr.play(dt)
|
||||
rem(FX_badge,i)
|
||||
end
|
||||
end
|
||||
local _
|
||||
for i=1,#virtualkey do
|
||||
_=virtualkey[i]
|
||||
if _.pressTime>0 then
|
||||
_.pressTime=_.pressTime-1
|
||||
|
||||
--Update virtualkey animation
|
||||
if setting.VKSwitch then
|
||||
for i=1,#virtualkey do
|
||||
_=virtualkey[i]
|
||||
if _.pressTime>0 then
|
||||
_.pressTime=_.pressTime-1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local P1=players[1]
|
||||
|
||||
--Replay
|
||||
if game.replaying then
|
||||
_=game.replaying
|
||||
local L=game.rec
|
||||
while game.frame==L[_]do
|
||||
local k=L[_+1]
|
||||
if k>0 then
|
||||
P1:pressKey(k)
|
||||
virtualkey[k].isDown=true
|
||||
virtualkey[k].pressTime=10
|
||||
else
|
||||
virtualkey[-k].isDown=false
|
||||
P1:releaseKey(-k)
|
||||
end
|
||||
_=_+2
|
||||
end
|
||||
game.replaying=_
|
||||
end
|
||||
--Counting,include pre-das,directy RETURN,or restart counting
|
||||
if game.frame<180 then
|
||||
if game.frame==179 then
|
||||
gameStart()
|
||||
@@ -204,27 +242,31 @@ function Tmr.play(dt)
|
||||
restartCount=restartCount+1
|
||||
if restartCount>20 then
|
||||
TASK.clear("play")
|
||||
mergeStat(stat,P1.stat)
|
||||
resetGameData()
|
||||
resetPartGameData()
|
||||
return
|
||||
end
|
||||
elseif restartCount>0 then
|
||||
restartCount=restartCount>2 and restartCount-2 or 0
|
||||
end--Counting,include pre-das,directy RETURN,or restart counting
|
||||
end
|
||||
|
||||
--Update players
|
||||
for p=1,#players do
|
||||
local P=players[p]
|
||||
P:update(dt)
|
||||
end
|
||||
|
||||
--Fresh royale target
|
||||
if game.frame%120==0 then
|
||||
if modeEnv.royaleMode then freshMostDangerous()end
|
||||
end
|
||||
|
||||
--Warning check
|
||||
if P1.alive then
|
||||
if game.frame%26==0 and setting.warn then
|
||||
local F=P1.field
|
||||
local M=#F
|
||||
local height=0--max height of row 4~7
|
||||
local height=0--Max height of row 4~7
|
||||
for x=4,7 do
|
||||
for y=M,1,-1 do
|
||||
for y=#F,1,-1 do
|
||||
if F[y][x]>0 then
|
||||
if y>height then
|
||||
height=y
|
||||
@@ -235,13 +277,13 @@ function Tmr.play(dt)
|
||||
end
|
||||
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
|
||||
end
|
||||
local M=game.warnLVL
|
||||
if M<game.warnLVL0 then
|
||||
M=M*.95+game.warnLVL0*.05
|
||||
elseif M>0 then
|
||||
M=max(M-.026,0)
|
||||
_=game.warnLVL
|
||||
if _<game.warnLVL0 then
|
||||
_=_*.95+game.warnLVL0*.05
|
||||
elseif _>0 then
|
||||
_=max(_-.026,0)
|
||||
end
|
||||
game.warnLVL=M
|
||||
game.warnLVL=_
|
||||
elseif game.warnLVL>0 then
|
||||
game.warnLVL=max(game.warnLVL-.026,0)
|
||||
end
|
||||
@@ -273,7 +315,15 @@ function Tmr.setting_control()
|
||||
if T.das>0 then
|
||||
T.das=T.das-1
|
||||
if T.das==0 then
|
||||
T.pos=T.pos+T.dir
|
||||
if T.arr==0 then
|
||||
T.pos=T.pos+7*T.dir
|
||||
T.das=setting.das
|
||||
T.arr=setting.arr
|
||||
T.dir=-T.dir
|
||||
T.wait=26
|
||||
else
|
||||
T.pos=T.pos+T.dir
|
||||
end
|
||||
end
|
||||
else
|
||||
T.arr=T.arr-1
|
||||
@@ -301,8 +351,6 @@ function Tmr.staff(dt)
|
||||
S.time=S.time+S.v*dt
|
||||
if S.time>45 then
|
||||
S.time=45
|
||||
elseif S.time<-10 then
|
||||
S.time=-10
|
||||
end
|
||||
end
|
||||
return Tmr
|
||||
@@ -57,7 +57,7 @@ local function getVoice(str)
|
||||
end
|
||||
end
|
||||
return L[n]
|
||||
--load voice with string
|
||||
--Load voice with string
|
||||
end
|
||||
function VOC.loadOne(_)
|
||||
local N=VOC.name[_]
|
||||
@@ -91,24 +91,24 @@ function VOC.update()
|
||||
end
|
||||
elseif Q.s==1 then--Waiting load source
|
||||
Q[1]=getVoice(Q[1])
|
||||
Q[1]:setVolume(setting.voc*.1)
|
||||
Q[1]:setVolume(setting.voc*.01)
|
||||
Q[1]:play()
|
||||
Q.s=Q[2]and 2 or 4
|
||||
elseif Q.s==2 then--playing 1,ready 2
|
||||
elseif Q.s==2 then--Playing 1,ready 2
|
||||
if Q[1]:getDuration()-Q[1]:tell()<.08 then
|
||||
Q[2]=getVoice(Q[2])
|
||||
Q[2]:setVolume(setting.voc*.1)
|
||||
Q[2]:setVolume(setting.voc*.01)
|
||||
Q[2]:play()
|
||||
Q.s=3
|
||||
end
|
||||
elseif Q.s==3 then--playing 12 same time
|
||||
elseif Q.s==3 then--Playing 12 same time
|
||||
if not Q[1]:isPlaying()then
|
||||
for i=1,#Q do
|
||||
Q[i]=Q[i+1]
|
||||
end
|
||||
Q.s=Q[2]and 2 or 4
|
||||
end
|
||||
elseif Q.s==4 then--playing last
|
||||
elseif Q.s==4 then--Playing last
|
||||
if not Q[1].isPlaying(Q[1])then
|
||||
Q[1]=nil
|
||||
Q.s=0
|
||||
@@ -121,13 +121,13 @@ function VOC.play(s,chn)
|
||||
if chn then
|
||||
local L=voiceQueue[chn]
|
||||
local _=VOC.list[s]
|
||||
if not _ then print("no VOC called:"..s)return end
|
||||
if not _ then return end
|
||||
L[#L+1]=_[rnd(#_)]
|
||||
L.s=1
|
||||
--add to queue[chn]
|
||||
--Add to queue[chn]
|
||||
else
|
||||
voiceQueue[VOC.getFreeChannel()]={s=1,VOC.list[s][rnd(#VOC.list[s])]}
|
||||
--create new channel & play
|
||||
--Create new channel & play
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,48 +3,62 @@ local kb=love.keyboard
|
||||
local int,abs=math.floor,math.abs
|
||||
local format=string.format
|
||||
local color=color
|
||||
|
||||
local EMPTY={}
|
||||
local setFont=setFont
|
||||
|
||||
local button={
|
||||
type="button",
|
||||
ATV=0,--activating time(0~8)
|
||||
ATV=0,--Activating time(0~8)
|
||||
}
|
||||
function button:reset()
|
||||
self.ATV=0
|
||||
end
|
||||
function button:isAbove(x,y)
|
||||
return x>self.x-self.ATV and x<self.x+self.w+2*self.ATV and y>self.y-self.ATV and y<self.y+self.h+2*self.ATV
|
||||
local ATV=self.ATV
|
||||
return
|
||||
x>self.x-ATV and
|
||||
y>self.y-ATV and
|
||||
x<self.x+self.w+2*ATV and
|
||||
y<self.y+self.h+2*ATV
|
||||
end
|
||||
function button:getCenter()
|
||||
return self.x+self.w*.5,self.y+self.h*.5
|
||||
end
|
||||
function button:FX()
|
||||
sysFX.new("ripple",.16,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV)
|
||||
local ATV=self.ATV
|
||||
sysFX.newRectRipple(
|
||||
.16,
|
||||
self.x-ATV,
|
||||
self.y-ATV,
|
||||
self.w+2*ATV,
|
||||
self.h+2*ATV
|
||||
,5
|
||||
)
|
||||
end
|
||||
function button:update()
|
||||
local ATV=self.ATV
|
||||
if WIDGET.sel==self then
|
||||
if self.ATV<8 then self.ATV=self.ATV+1 end
|
||||
if ATV<8 then self.ATV=ATV+1 end
|
||||
else
|
||||
if self.ATV>0 then self.ATV=self.ATV-1 end
|
||||
if ATV>0 then self.ATV=ATV-.5 end
|
||||
end
|
||||
end
|
||||
function button:draw()
|
||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||
local ATV=self.ATV
|
||||
local r,g,b=unpack(self.color)
|
||||
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
||||
gc.rectangle("fill",x-self.ATV,y-self.ATV,w+2*self.ATV,h+2*self.ATV)
|
||||
if self.ATV>0 then
|
||||
gc.rectangle("fill",x-ATV,y-ATV,w+2*ATV,h+2*ATV)
|
||||
if ATV>0 then
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1,self.ATV*.125)
|
||||
gc.rectangle("line",x-self.ATV+2,y-self.ATV+2,w+2*self.ATV-4,h+2*self.ATV-4)
|
||||
gc.setColor(1,1,1,ATV*.125)
|
||||
gc.rectangle("line",x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4)
|
||||
end
|
||||
local t=self.text
|
||||
if t then
|
||||
if type(t)=="function"then t=t()end
|
||||
setFont(self.font)
|
||||
local y0=y+h*.5-self.font*.7
|
||||
gc.setColor(1,1,1,.3)
|
||||
local y0=y+h*.5-self.font*.7-ATV*.5
|
||||
gc.setColor(1,1,1,.2+ATV*.05)
|
||||
gc.printf(t,x-2,y0-2,w,"center")
|
||||
gc.printf(t,x-2,y0+2,w,"center")
|
||||
gc.printf(t,x+2,y0-2,w,"center")
|
||||
@@ -54,13 +68,63 @@ function button:draw()
|
||||
end
|
||||
end
|
||||
function button:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font))
|
||||
DBP(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font))
|
||||
end
|
||||
|
||||
local key={
|
||||
type="key",
|
||||
ATV=0,--Activating time(0~4)
|
||||
}
|
||||
function key:reset()
|
||||
self.ATV=0
|
||||
end
|
||||
function key:isAbove(x,y)
|
||||
local ATV=self.ATV
|
||||
return
|
||||
x>self.x and
|
||||
y>self.y and
|
||||
x<self.x+self.w and
|
||||
y<self.y+self.h
|
||||
end
|
||||
function key:getCenter()
|
||||
return self.x+self.w*.5,self.y+self.h*.5
|
||||
end
|
||||
function key:update()
|
||||
local ATV=self.ATV
|
||||
if WIDGET.sel==self then
|
||||
if ATV<4 then self.ATV=ATV+1 end
|
||||
else
|
||||
if ATV>0 then self.ATV=ATV-.5 end
|
||||
end
|
||||
end
|
||||
function key:draw()
|
||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||
local ATV=self.ATV
|
||||
local r,g,b=unpack(self.color)
|
||||
|
||||
gc.setColor(1,1,1,ATV*.125)
|
||||
gc.rectangle("fill",x,y,w,h)
|
||||
|
||||
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
||||
gc.setLineWidth(4)
|
||||
gc.rectangle("line",x,y,w,h)
|
||||
|
||||
local t=self.text
|
||||
if t then
|
||||
if type(t)=="function"then t=t()end
|
||||
setFont(self.font)
|
||||
gc.setColor(r,g,b,1.2)
|
||||
gc.printf(t,x,y+h*.5-self.font*.7,w,"center")
|
||||
end
|
||||
end
|
||||
function key:getInfo()
|
||||
DBP(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font))
|
||||
end
|
||||
|
||||
local switch={
|
||||
type="switch",
|
||||
ATV=0,--activating time(0~8)
|
||||
CHK=0,--check alpha(0~6)
|
||||
ATV=0,--Activating time(0~8)
|
||||
CHK=0,--Check alpha(0~6)
|
||||
}
|
||||
function switch:reset()
|
||||
self.ATV=0
|
||||
@@ -75,7 +139,7 @@ end
|
||||
function switch:update()
|
||||
local _=self.ATV
|
||||
if WIDGET.sel==self then if _<8 then self.ATV=_+1 end
|
||||
else if _>0 then self.ATV=_-1 end
|
||||
else if _>0 then self.ATV=_-.5 end
|
||||
end
|
||||
_=self.CHK
|
||||
if self:disp()then if _<6 then self.CHK=_+1 end
|
||||
@@ -84,10 +148,11 @@ function switch:update()
|
||||
end
|
||||
function switch:draw()
|
||||
local x,y=self.x,self.y-25
|
||||
local ATV=self.ATV
|
||||
|
||||
--Checked
|
||||
if self.ATV>0 then
|
||||
gc.setColor(1,1,1,self.ATV*.08)
|
||||
if ATV>0 then
|
||||
gc.setColor(1,1,1,ATV*.08)
|
||||
gc.rectangle("fill",x,y,50,50)
|
||||
end
|
||||
if self.CHK>0 then
|
||||
@@ -98,7 +163,7 @@ function switch:draw()
|
||||
|
||||
--Frame
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1,.6+self.ATV*.05)
|
||||
gc.setColor(1,1,1,.6+ATV*.05)
|
||||
gc.rectangle("line",x,y,50,50)
|
||||
|
||||
--Text
|
||||
@@ -106,17 +171,17 @@ function switch:draw()
|
||||
if t then
|
||||
gc.setColor(1,1,1)
|
||||
setFont(self.font)
|
||||
gc.printf(t,x-412,y+20-self.font*.7,400,"right")
|
||||
gc.printf(t,x-412-ATV,y+20-self.font*.7,400,"right")
|
||||
end
|
||||
end
|
||||
function switch:getInfo()
|
||||
print(format("x=%d,y=%d,font=%d",self.x,self.y,self.font))
|
||||
DBP(format("x=%d,y=%d,font=%d",self.x,self.y,self.font))
|
||||
end
|
||||
|
||||
local slider={
|
||||
type="slider",
|
||||
ATV=0,--activating time(0~8)
|
||||
pos=0,--position shown
|
||||
ATV=0,--Activating time(0~8)
|
||||
pos=0,--Position shown
|
||||
}
|
||||
function slider:reset()
|
||||
self.ATV=0
|
||||
@@ -133,7 +198,7 @@ function slider:update()
|
||||
if WIDGET.sel==self then
|
||||
if _<6 then self.ATV=_+1 end
|
||||
else
|
||||
if _>0 then self.ATV=_-1 end
|
||||
if _>0 then self.ATV=_-.5 end
|
||||
end
|
||||
if not(self.hide and self.hide())then
|
||||
self.pos=self.pos*.7+self.disp()*.3
|
||||
@@ -141,52 +206,58 @@ function slider:update()
|
||||
end
|
||||
function slider:draw()
|
||||
local x,y=self.x,self.y
|
||||
local ATV=self.ATV
|
||||
local x2=x+self.w
|
||||
|
||||
gc.setColor(1,1,1,.5+ATV*.06)
|
||||
|
||||
--Units
|
||||
gc.setColor(1,1,1,.5+self.ATV*.06)
|
||||
gc.setLineWidth(2)
|
||||
local x1,x2=x,x+self.w
|
||||
for p=0,self.unit do
|
||||
local x=x1+(x2-x1)*p/self.unit
|
||||
gc.line(x,y+7,x,y-7)
|
||||
if self.showUnit then
|
||||
gc.setLineWidth(2)
|
||||
for p=0,self.unit do
|
||||
local x=x+(x2-x)*p/self.unit
|
||||
gc.line(x,y+7,x,y-7)
|
||||
end
|
||||
end
|
||||
|
||||
--Axis
|
||||
gc.setLineWidth(4)
|
||||
gc.line(x1,y,x2,y)
|
||||
gc.line(x,y,x2,y)
|
||||
|
||||
--Block
|
||||
local bx,by,bw,bh=x+(x2-x)*self.pos/self.unit-10-ATV*.5,y-16-ATV,20+ATV,32+2*ATV
|
||||
gc.setColor(.8,.8,.8)
|
||||
gc.rectangle("fill",bx,by,bw,bh)
|
||||
if ATV>0 then
|
||||
gc.setLineWidth(2)
|
||||
gc.setColor(1,1,1,ATV*.16)
|
||||
gc.rectangle("line",bx+1,by+1,bw-2,bh-2)
|
||||
end
|
||||
|
||||
--Text
|
||||
local t=self.text
|
||||
if t then
|
||||
gc.setColor(1,1,1)
|
||||
setFont(self.font)
|
||||
gc.printf(t,x-312,y-self.font*.7,300,"right")
|
||||
end
|
||||
|
||||
--Block
|
||||
local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV*.5,y-16-self.ATV,20+self.ATV,32+2*self.ATV
|
||||
gc.setColor(.8,.8,.8)
|
||||
gc.rectangle("fill",x,y,w,h)
|
||||
if self.ATV>0 then
|
||||
gc.setLineWidth(2)
|
||||
gc.setColor(1,1,1,self.ATV*.16)
|
||||
gc.rectangle("line",x+1,y+1,w-2,h-2)
|
||||
gc.printf(t,x-312-ATV,y-self.font*.7,300,"right")
|
||||
end
|
||||
end
|
||||
function slider:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))
|
||||
DBP(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))
|
||||
end
|
||||
|
||||
local WIDGET={}
|
||||
WIDGET.active=EMPTY--table, contains all active widgets
|
||||
WIDGET.sel=nil--selected widget
|
||||
WIDGET.active={}--Table, contains all active widgets
|
||||
WIDGET.sel=nil--Selected widget
|
||||
function WIDGET.set(L)
|
||||
WIDGET.sel=nil
|
||||
WIDGET.active=L or EMPTY
|
||||
WIDGET.active=L or{}
|
||||
|
||||
--Reset all widgets
|
||||
if L then
|
||||
for _,W in next,L do
|
||||
W:reset()
|
||||
end--Reset all widgets
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -238,6 +309,29 @@ function WIDGET.newButton(D)
|
||||
hide= D.hide,
|
||||
}for k,v in next,button do _[k]=v end return _
|
||||
end
|
||||
function WIDGET.newKey(D)
|
||||
local _={
|
||||
name= D.name,
|
||||
|
||||
x= D.x-D.w*.5,
|
||||
y= D.y-D.h*.5,
|
||||
w= D.w,
|
||||
h= D.h,
|
||||
|
||||
resCtr={
|
||||
D.x,D.y,
|
||||
D.x-D.w*.35,D.y-D.h*.35,
|
||||
D.x-D.w*.35,D.y+D.h*.35,
|
||||
D.x+D.w*.35,D.y-D.h*.35,
|
||||
D.x+D.w*.35,D.y+D.h*.35,
|
||||
},
|
||||
|
||||
color= color[D.color]or D.color,
|
||||
font= D.font,
|
||||
code= D.code,
|
||||
hide= D.hide,
|
||||
}for k,v in next,key do _[k]=v end return _
|
||||
end
|
||||
function WIDGET.newSwitch(D)
|
||||
local _={
|
||||
name= D.name,
|
||||
@@ -276,6 +370,7 @@ function WIDGET.newSlider(D)
|
||||
},
|
||||
|
||||
unit= D.unit,
|
||||
showUnit=not D.noUnit,
|
||||
font= D.font,
|
||||
change= D.change,
|
||||
disp= D.disp,
|
||||
@@ -300,7 +395,9 @@ function WIDGET.press(x,y)
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX.play("button")
|
||||
VOC.play("nya")
|
||||
elseif W.type=="key"then
|
||||
W.code()
|
||||
SFX.play("lock")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
SFX.play("move",.6)
|
||||
@@ -331,7 +428,7 @@ function WIDGET.keyPressed(i)
|
||||
WIDGET.press()
|
||||
end
|
||||
elseif kb.isDown("lshift","lalt","lctrl")then
|
||||
--when hold [↑], control slider with left/right
|
||||
--When hold [↑], control slider with left/right
|
||||
if i=="left"or i=="right"then
|
||||
local W=WIDGET.sel
|
||||
if W then
|
||||
@@ -354,7 +451,7 @@ function WIDGET.keyPressed(i)
|
||||
if i=="left"or i=="right"then
|
||||
for i=1,#WIDGET.active do
|
||||
local W1=WIDGET.active[i]
|
||||
if W~=W1 then
|
||||
if W~=W1 and W1.resCtr then
|
||||
local L=W1.resCtr
|
||||
for j=1,#L,2 do
|
||||
local x,y=L[j],L[j+1]
|
||||
@@ -372,7 +469,7 @@ function WIDGET.keyPressed(i)
|
||||
else
|
||||
for i=1,#WIDGET.active do
|
||||
local W1=WIDGET.active[i]
|
||||
if W~=W1 then
|
||||
if W~=W1 and W1.resCtr then
|
||||
local L=W1.resCtr
|
||||
for j=1,#L,2 do
|
||||
local x,y=L[j],L[j+1]
|
||||
@@ -412,7 +509,7 @@ function WIDGET.gamepadPressed(i)
|
||||
elseif i=="a"or i=="b"then
|
||||
local W=WIDGET.sel
|
||||
if W then
|
||||
if W.type=="button"then
|
||||
if W.type=="button"or W.type=="key"then
|
||||
WIDGET.press()
|
||||
elseif W.type=="slider"then
|
||||
local p=W.disp()
|
||||
|
||||
@@ -69,8 +69,8 @@ local virtualkeySet={
|
||||
{16,970, 50,30},--down10
|
||||
{17,1030, 50,30},--dropLeft
|
||||
{18,1090, 50,30},--dropRight
|
||||
{19,1150, 50,30},--addLeft
|
||||
{20,1210, 50,30},--addRight
|
||||
{19,1150, 50,30},--zangiLeft
|
||||
{20,1210, 50,30},--zangiRight
|
||||
},--PC key feedback(top&in a row)
|
||||
}
|
||||
|
||||
@@ -87,29 +87,49 @@ local function VKAdisp(n) return function()return VK_org[n].ava end end
|
||||
local function VKAcode(n) return function()VK_org[n].ava=not VK_org[n].ava end end
|
||||
local function setLang(n) return function()LANG.set(n)setting.lang=n end end
|
||||
|
||||
--newXXX
|
||||
--NewXXX
|
||||
newText=WIDGET.newText
|
||||
newImage=WIDGET.newImage
|
||||
newButton=WIDGET.newButton
|
||||
newKey=WIDGET.newKey
|
||||
newSwitch=WIDGET.newSwitch
|
||||
newSlider=WIDGET.newSlider
|
||||
|
||||
--All widgets
|
||||
local Widgets={
|
||||
load={},intro={},quit={},
|
||||
calculator={
|
||||
newKey({name="_1", x=150,y=300,w=90,h=90, color="white", font=50,code=pressKey("1")}),
|
||||
newKey({name="_2", x=250,y=300,w=90,h=90, color="white", font=50,code=pressKey("2")}),
|
||||
newKey({name="_3", x=350,y=300,w=90,h=90, color="white", font=50,code=pressKey("3")}),
|
||||
newKey({name="_4", x=150,y=400,w=90,h=90, color="white", font=50,code=pressKey("4")}),
|
||||
newKey({name="_5", x=250,y=400,w=90,h=90, color="white", font=50,code=pressKey("5")}),
|
||||
newKey({name="_6", x=350,y=400,w=90,h=90, color="white", font=50,code=pressKey("6")}),
|
||||
newKey({name="_7", x=150,y=500,w=90,h=90, color="white", font=50,code=pressKey("7")}),
|
||||
newKey({name="_8", x=250,y=500,w=90,h=90, color="white", font=50,code=pressKey("8")}),
|
||||
newKey({name="_9", x=350,y=500,w=90,h=90, color="white", font=50,code=pressKey("9")}),
|
||||
newKey({name="_0", x=150,y=600,w=90,h=90, color="white", font=50,code=pressKey("0")}),
|
||||
newKey({name="<", x=250,y=600,w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
|
||||
newKey({name="=", x=350,y=600,w=90,h=90, color="lYellow",font=50,code=pressKey("return")}),
|
||||
newKey({name="+", x=450,y=300,w=90,h=90, color="lBlue", font=50,code=pressKey("+")}),
|
||||
newKey({name="-", x=450,y=400,w=90,h=90, color="lBlue", font=50,code=pressKey("-")}),
|
||||
newKey({name="*", x=450,y=500,w=90,h=90, color="lBlue", font=50,code=pressKey("*")}),
|
||||
newKey({name="/", x=450,y=600,w=90,h=90, color="lBlue", font=50,code=pressKey("/")}),
|
||||
newButton({name="play", x=640,y=600,w=180,h=90, color="lGreen", font=40,code=pressKey("space"),hide=function()return not sceneTemp.pass end}),
|
||||
},
|
||||
main={
|
||||
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.goto("mode")end}),
|
||||
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.goto("setting_game")end}),
|
||||
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.goto("music")end}),
|
||||
newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.goto("help")end}),
|
||||
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.goto("stat")end}),
|
||||
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay)end}),
|
||||
newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=function()SCN.goto("setting_lang")end}),
|
||||
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.go("mode")end}),
|
||||
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.go("setting_game")end}),
|
||||
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.go("music")end}),
|
||||
newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.go("help")end}),
|
||||
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.go("stat")end}),
|
||||
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay,true)end}),
|
||||
newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=function()SCN.go("setting_lang")end}),
|
||||
newButton({name="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
|
||||
},
|
||||
mode={
|
||||
newButton({name="setting",x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
|
||||
SCN.goto("custom")
|
||||
newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
|
||||
SCN.go("custom")
|
||||
end,
|
||||
hide=function()
|
||||
return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"
|
||||
@@ -118,17 +138,17 @@ local Widgets={
|
||||
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
|
||||
},
|
||||
music={
|
||||
newSlider({name="bgm", x=760, y=80, w=400,unit=10, font=35,change=function()BGM.freshVolume()end,disp=SETval("bgm"),code=SETsto("bgm")}),
|
||||
newSlider({name="bgm", x=760, y=80, w=400,unit=100, noUnit=true, font=35,change=function()BGM.freshVolume()end,disp=SETval("bgm"),code=SETsto("bgm")}),
|
||||
newButton({name="up", x=1100, y=200, w=120,h=120, color="white", font=55,code=pressKey("up")}),
|
||||
newButton({name="play", x=1100, y=340, w=120,h=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
|
||||
newButton({name="down", x=1100, y=480, w=120,h=120, color="white", font=55,code=pressKey("down")}),
|
||||
newButton({name="back", x=640, y=630, w=230,h=90, color="white", font=40,code=BACK}),
|
||||
},
|
||||
custom={
|
||||
newButton({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
|
||||
newButton({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
|
||||
newButton({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
|
||||
newButton({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
|
||||
newKey({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
|
||||
newKey({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
|
||||
newKey({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
|
||||
newKey({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
|
||||
|
||||
newButton({name="set1", x=940, y=320, w=260,h=70, color="lYellow",font=32,code=pressKey("1")}),
|
||||
newButton({name="set2", x=940, y=400, w=260,h=70, color="lYellow",font=32,code=pressKey("2")}),
|
||||
@@ -141,116 +161,111 @@ local Widgets={
|
||||
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
||||
},
|
||||
sequence={
|
||||
newButton({name="Z", x=150, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
|
||||
newButton({name="S", x=250, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
|
||||
newButton({name="J", x=350, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
|
||||
newButton({name="L", x=450, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
|
||||
newButton({name="T", x=550, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
|
||||
newButton({name="O", x=650, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
|
||||
newButton({name="I", x=750, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
|
||||
newKey({name="Z", x=100, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
|
||||
newKey({name="S", x=200, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
|
||||
newKey({name="J", x=300, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
|
||||
newKey({name="L", x=400, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
|
||||
newKey({name="T", x=500, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
|
||||
newKey({name="O", x=600, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
|
||||
newKey({name="I", x=700, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
|
||||
|
||||
newButton({name="Z5", x=150, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(8)}),
|
||||
newButton({name="S5", x=250, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(9)}),
|
||||
newButton({name="P", x=350, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(10)}),
|
||||
newButton({name="Q", x=450, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(11)}),
|
||||
newButton({name="F", x=550, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(12)}),
|
||||
newButton({name="E", x=650, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(13)}),
|
||||
newButton({name="T5", x=750, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(14)}),
|
||||
newButton({name="U", x=850, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(15)}),
|
||||
newButton({name="V", x=950, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(16)}),
|
||||
newButton({name="W", x=150, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(17)}),
|
||||
newButton({name="X", x=250, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(18)}),
|
||||
newButton({name="J5", x=350, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(19)}),
|
||||
newButton({name="L5", x=450, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(20)}),
|
||||
newButton({name="R", x=550, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(21)}),
|
||||
newButton({name="Y", x=650, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(22)}),
|
||||
newButton({name="N", x=750, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(23)}),
|
||||
newButton({name="H", x=850, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(24)}),
|
||||
newButton({name="I5", x=950, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(25)}),
|
||||
newKey({name="Z5", x=100, y=540, w=90,h=90, color="grey", font=50,code=pressKey(8)}),
|
||||
newKey({name="S5", x=200, y=540, w=90,h=90, color="grey", font=50,code=pressKey(9)}),
|
||||
newKey({name="P", x=300, y=540, w=90,h=90, color="grey", font=50,code=pressKey(10)}),
|
||||
newKey({name="Q", x=400, y=540, w=90,h=90, color="grey", font=50,code=pressKey(11)}),
|
||||
newKey({name="F", x=500, y=540, w=90,h=90, color="grey", font=50,code=pressKey(12)}),
|
||||
newKey({name="E", x=600, y=540, w=90,h=90, color="grey", font=50,code=pressKey(13)}),
|
||||
newKey({name="T5", x=700, y=540, w=90,h=90, color="grey", font=50,code=pressKey(14)}),
|
||||
newKey({name="U", x=800, y=540, w=90,h=90, color="grey", font=50,code=pressKey(15)}),
|
||||
newKey({name="V", x=900, y=540, w=90,h=90, color="grey", font=50,code=pressKey(16)}),
|
||||
newKey({name="W", x=100, y=640, w=90,h=90, color="grey", font=50,code=pressKey(17)}),
|
||||
newKey({name="X", x=200, y=640, w=90,h=90, color="grey", font=50,code=pressKey(18)}),
|
||||
newKey({name="J5", x=300, y=640, w=90,h=90, color="grey", font=50,code=pressKey(19)}),
|
||||
newKey({name="L5", x=400, y=640, w=90,h=90, color="grey", font=50,code=pressKey(20)}),
|
||||
newKey({name="R", x=500, y=640, w=90,h=90, color="grey", font=50,code=pressKey(21)}),
|
||||
newKey({name="Y", x=600, y=640, w=90,h=90, color="grey", font=50,code=pressKey(22)}),
|
||||
newKey({name="N", x=700, y=640, w=90,h=90, color="grey", font=50,code=pressKey(23)}),
|
||||
newKey({name="H", x=800, y=640, w=90,h=90, color="grey", font=50,code=pressKey(24)}),
|
||||
newKey({name="I5", x=900, y=640, w=90,h=90, color="grey", font=50,code=pressKey(25)}),
|
||||
|
||||
newButton({name="left", x=850, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
|
||||
newButton({name="right", x=950, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
|
||||
newButton({name="backsp", x=1050, y=440, w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
|
||||
newButton({name="reset", x=1050, y=540, w=90,h=90, color="lRed", font=50,code=pressKey("delete")}),
|
||||
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
||||
newKey({name="left", x=800, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
|
||||
newKey({name="right", x=900, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
|
||||
newKey({name="backsp", x=1000, y=440, w=90,h=90, color="lYellow",font=50,code=pressKey("backspace")}),
|
||||
newKey({name="reset", x=1000, y=540, w=90,h=90, color="lYellow",font=50,code=pressKey("delete")}),
|
||||
newButton({name="copy", x=1140, y=440, w=170,h=90, color="lRed", font=40,code=pressKey("cC"),hide=function()return #preBag==0 end}),
|
||||
newButton({name="paste", x=1140, y=540, w=170,h=90, color="lBlue", font=40,code=pressKey("cV")}),
|
||||
newButton({name="back", x=1090, y=640, w=270,h=90, color="white", font=50,code=BACK}),
|
||||
},
|
||||
draw={
|
||||
newButton({name="b1", x=500+65*1, y=150,w=58,h=58, color="red", font=30,code=setPen(1)}),--B1
|
||||
newButton({name="b2", x=500+65*2, y=150,w=58,h=58, color="orange", font=30,code=setPen(2)}),--B2
|
||||
newButton({name="b3", x=500+65*3, y=150,w=58,h=58, color="yellow", font=30,code=setPen(3)}),--B3
|
||||
newButton({name="b4", x=500+65*4, y=150,w=58,h=58, color="grass", font=30,code=setPen(4)}),--B4
|
||||
newButton({name="b5", x=500+65*5, y=150,w=58,h=58, color="green", font=30,code=setPen(5)}),--B5
|
||||
newButton({name="b6", x=500+65*6, y=150,w=58,h=58, color="water", font=30,code=setPen(6)}),--B6
|
||||
newButton({name="b7", x=500+65*7, y=150,w=58,h=58, color="cyan", font=30,code=setPen(7)}),--B7
|
||||
newButton({name="b8", x=500+65*8, y=150,w=58,h=58, color="blue", font=30,code=setPen(8)}),--B8
|
||||
newButton({name="b9", x=500+65*9, y=150,w=58,h=58, color="purple", font=30,code=setPen(9)}),--B9
|
||||
newButton({name="b10", x=500+65*10,y=150,w=58,h=58, color="magenta",font=30,code=setPen(10)}),--B10
|
||||
newButton({name="b11", x=500+65*11,y=150,w=58,h=58, color="pink", font=30,code=setPen(11)}),--B11
|
||||
newButton({name="b1", x=500+65*1, y=150, w=58, h=58, color="red", font=30,code=setPen(1)}),--B1
|
||||
newButton({name="b2", x=500+65*2, y=150, w=58, h=58, color="orange", font=30,code=setPen(2)}),--B2
|
||||
newButton({name="b3", x=500+65*3, y=150, w=58, h=58, color="yellow", font=30,code=setPen(3)}),--B3
|
||||
newButton({name="b4", x=500+65*4, y=150, w=58, h=58, color="grass", font=30,code=setPen(4)}),--B4
|
||||
newButton({name="b5", x=500+65*5, y=150, w=58, h=58, color="green", font=30,code=setPen(5)}),--B5
|
||||
newButton({name="b6", x=500+65*6, y=150, w=58, h=58, color="water", font=30,code=setPen(6)}),--B6
|
||||
newButton({name="b7", x=500+65*7, y=150, w=58, h=58, color="cyan", font=30,code=setPen(7)}),--B7
|
||||
newButton({name="b8", x=500+65*8, y=150, w=58, h=58, color="blue", font=30,code=setPen(8)}),--B8
|
||||
newButton({name="b9", x=500+65*9, y=150, w=58, h=58, color="purple", font=30,code=setPen(9)}),--B9
|
||||
newButton({name="b10", x=500+65*10,y=150, w=58, h=58, color="magenta",font=30,code=setPen(10)}),--B10
|
||||
newButton({name="b11", x=500+65*11,y=150, w=58, h=58, color="pink", font=30,code=setPen(11)}),--B11
|
||||
|
||||
newButton({name="b12", x=500+65*1, y=230,w=58,h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
|
||||
newButton({name="b13", x=500+65*2, y=230,w=58,h=58, color="grey", font=30,code=setPen(13)}),--GB1
|
||||
newButton({name="b14", x=500+65*3, y=230,w=58,h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
|
||||
newButton({name="b15", x=500+65*4, y=230,w=58,h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
|
||||
newButton({name="b16", x=500+65*5, y=230,w=58,h=58, color="dRed", font=30,code=setPen(16)}),--GB4
|
||||
newButton({name="b17", x=500+65*6, y=230,w=58,h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
|
||||
newButton({name="b12", x=500+65*1, y=230, w=58, h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
|
||||
newButton({name="b13", x=500+65*2, y=230, w=58, h=58, color="grey", font=30,code=setPen(13)}),--GB1
|
||||
newButton({name="b14", x=500+65*3, y=230, w=58, h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
|
||||
newButton({name="b15", x=500+65*4, y=230, w=58, h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
|
||||
newButton({name="b16", x=500+65*5, y=230, w=58, h=58, color="dRed", font=30,code=setPen(16)}),--GB4
|
||||
newButton({name="b17", x=500+65*6, y=230, w=58, h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
|
||||
|
||||
newButton({name="any", x=600, y=360, w=120,h=120, color="lGrey", font=40,code=setPen(0)}),
|
||||
newButton({name="space", x=730, y=360, w=120,h=120, color="grey", font=65,code=setPen(-1)}),
|
||||
newButton({name="clear", x=1200, y=500, w=120,h=120, color="white", font=40,code=pressKey("delete")}),
|
||||
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
|
||||
newButton({name="copy", x=920, y=640, w=120,h=120, color="lRed", font=35,code=function()copyBoard()end}),
|
||||
newButton({name="paste", x=1060, y=640, w=120,h=120, color="lBlue", font=35,code=function()pasteBoard()end}),
|
||||
newButton({name="custom", x=110, y=80, w=140,h=80, color="white", font=35,code=function()SCN.goto("custom")end}),
|
||||
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
||||
newButton({name="any", x=600, y=360, w=120, h=120, color="lGrey", font=40,code=setPen(0)}),
|
||||
newButton({name="space", x=730, y=360, w=120, h=120, color="grey", font=65,code=setPen(-1)}),
|
||||
newButton({name="clear", x=1200, y=500, w=120, h=120, color="white", font=40,code=pressKey("delete")}),
|
||||
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
|
||||
newButton({name="copy", x=920, y=640, w=120, h=120, color="lRed", font=35,code=pressKey("cC")}),
|
||||
newButton({name="paste", x=1060, y=640, w=120, h=120, color="lBlue", font=35,code=pressKey("cV")}),
|
||||
newButton({name="custom", x=110, y=80, w=140, h=80, color="white", font=35,code=pressKey("e")}),
|
||||
newButton({name="back", x=1200, y=640, w=120, h=120, color="white", font=35,code=BACK}),
|
||||
},
|
||||
play={
|
||||
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
|
||||
},
|
||||
pause={
|
||||
newButton({name="resume", x=640,y=290,w=240,h=100,color="white",font=30,code=function()resumeGame()end}),
|
||||
newButton({name="restart", x=640,y=445,w=240,h=100,color="white",font=33,
|
||||
code=function()
|
||||
TASK.removeTask_code(TICK.autoPause)
|
||||
mergeStat(stat,players[1].stat)
|
||||
resetGameData()
|
||||
SCN.swapTo("play","none")
|
||||
end}),
|
||||
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue",font=35,
|
||||
code=function()
|
||||
SCN.goto("setting_sound")
|
||||
end}),
|
||||
newButton({name="quit", x=640, y=600, w=240,h=100,color="white",font=35,code=BACK}),
|
||||
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}),
|
||||
newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not(game.result or game.replaying)end}),
|
||||
newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}),
|
||||
newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=33,code=pressKey("r")}),
|
||||
newButton({name="quit", x=640, y=600, w=240,h=100,color="lGrey", font=35,code=BACK}),
|
||||
},
|
||||
setting_game={
|
||||
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video")end}),
|
||||
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound")end}),
|
||||
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.goto("setting_control")end}),
|
||||
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.goto("setting_key")end}),
|
||||
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.goto("setting_touch")end}),
|
||||
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
|
||||
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
|
||||
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.go("setting_control")end}),
|
||||
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.go("setting_key")end}),
|
||||
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.go("setting_touch")end}),
|
||||
newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime")}),
|
||||
newSlider({name="maxNext", x=350, y=440, w=300,unit=6, font=30,disp=SETval("maxNext"), code=SETsto("maxNext")}),
|
||||
newSwitch({name="autoPause",x=350, y=540, font=20,disp=SETval("autoPause"),code=SETrev("autoPause")}),
|
||||
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function()
|
||||
SCN.goto("setting_skin")
|
||||
newButton({name="layout", x=460, y=540, w=140,h=70,color="white", font=35,code=function()
|
||||
SCN.go("setting_skin")
|
||||
end}),
|
||||
newSwitch({name="quickR", x=1050,y=320,font=35, disp=SETval("quickR"), code=SETrev("quickR")}),
|
||||
newSwitch({name="swap", x=1050,y=400,font=20, disp=SETval("swap"), code=SETrev("swap")}),
|
||||
newSwitch({name="fine", x=1050,y=480,font=20, disp=SETval("fine"), code=SETrev("fine")}),
|
||||
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
newSwitch({name="autoPause",x=1080, y=320, font=20,disp=SETval("autoPause"), code=SETrev("autoPause")}),
|
||||
newSwitch({name="swap", x=1080, y=380, font=20,disp=SETval("swap"), code=SETrev("swap")}),
|
||||
newSwitch({name="fine", x=1080, y=440, font=20,disp=SETval("fine"), code=SETrev("fine")}),
|
||||
newSwitch({name="appLock", x=1080, y=500, font=20,disp=SETval("appLock"), code=SETrev("appLock")}),
|
||||
newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}),
|
||||
},
|
||||
setting_video={
|
||||
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound")end}),
|
||||
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
|
||||
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
|
||||
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
|
||||
newSwitch({name="ghost", x=250, y=180,font=35, disp=SETval("ghost"), code=SETrev("ghost")}),
|
||||
newSwitch({name="smooth", x=250, y=260,font=25, disp=SETval("smooth"), code=SETrev("smooth")}),
|
||||
newSwitch({name="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}),
|
||||
newSwitch({name="grid", x=500, y=260,font=30, disp=SETval("grid"), code=SETrev("grid")}),
|
||||
newSwitch({name="grid", x=500, y=260,font=35, disp=SETval("grid"), code=SETrev("grid")}),
|
||||
newSwitch({name="bagLine", x=730, y=180,font=30, disp=SETval("bagLine"), code=SETrev("bagLine")}),
|
||||
newSlider({name="lockFX", x=350, y=340,w=373,unit=3, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}),
|
||||
newSlider({name="dropFX", x=350, y=400,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}),
|
||||
newSlider({name="clearFX", x=350, y=460,w=373,unit=3, font=32,disp=SETval("clearFX"), code=SETsto("clearFX")}),
|
||||
newSlider({name="shakeFX", x=350, y=520,w=373,unit=5, font=32,disp=SETval("shakeFX"), code=SETsto("shakeFX")}),
|
||||
newSlider({name="atkFX", x=350, y=580,w=373,unit=5, font=32,disp=SETval("atkFX"), code=SETsto("atkFX")}),
|
||||
newSlider({name="lockFX", x=350, y=340,w=373,unit=5, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}),
|
||||
newSlider({name="dropFX", x=350, y=390,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}),
|
||||
newSlider({name="moveFX", x=350, y=440,w=373,unit=5, font=32,disp=SETval("moveFX"), code=SETsto("moveFX")}),
|
||||
newSlider({name="clearFX", x=350, y=490,w=373,unit=5, font=32,disp=SETval("clearFX"), code=SETsto("clearFX")}),
|
||||
newSlider({name="shakeFX", x=350, y=540,w=373,unit=5, font=32,disp=SETval("shakeFX"), code=SETsto("shakeFX")}),
|
||||
newSlider({name="atkFX", x=350, y=590,w=373,unit=5, font=32,disp=SETval("atkFX"), code=SETsto("atkFX")}),
|
||||
newSlider({name="frame", x=350, y=640,w=373,unit=10,font=30,
|
||||
disp=function()
|
||||
return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4
|
||||
@@ -258,15 +273,15 @@ local Widgets={
|
||||
code=function(i)
|
||||
setting.frameMul=i<5 and 5*i+20 or 10*i
|
||||
end}),
|
||||
newSwitch({name="text", x=1050, y=180, font=35,disp=SETval("text"),code=SETrev("text")}),
|
||||
newSwitch({name="warn", x=1050, y=260, font=35,disp=SETval("warn"),code=SETrev("warn")}),
|
||||
newSwitch({name="fullscreen",x=1050,y=340, font=35,disp=SETval("fullscreen"),
|
||||
newSwitch({name="text", x=1050, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
|
||||
newSwitch({name="warn", x=1050, y=260,font=35,disp=SETval("warn"),code=SETrev("warn")}),
|
||||
newSwitch({name="fullscreen",x=1050,y=340,font=35,disp=SETval("fullscreen"),
|
||||
code=function()
|
||||
setting.fullscreen=not setting.fullscreen
|
||||
love.window.setFullscreen(setting.fullscreen)
|
||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
||||
end}),
|
||||
newSwitch({name="bg", x=1050, y=420, font=35,disp=SETval("bg"),
|
||||
newSwitch({name="bg", x=1050, y=420,font=35,disp=SETval("bg"),
|
||||
code=function()
|
||||
BG.set("none")
|
||||
setting.bg=not setting.bg
|
||||
@@ -279,14 +294,14 @@ local Widgets={
|
||||
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
setting_sound={
|
||||
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
|
||||
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video")end}),
|
||||
newSlider({name="sfx", x=180, y=200,w=400,unit=10,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
|
||||
newSlider({name="stereo", x=180, y=500,w=400,unit=10,font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
|
||||
newSlider({name="spawn", x=180, y=300,w=400,unit=10,font=30,change=function()SFX.play("spawn_1",setting.spawn,nil,true)end, disp=SETval("spawn"), code=SETsto("spawn")}),
|
||||
newSlider({name="bgm", x=180, y=400,w=400,unit=10,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
|
||||
newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
|
||||
newSlider({name="voc", x=750, y=300,w=400,unit=10,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
|
||||
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
|
||||
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
|
||||
newSlider({name="sfx", x=180, y=200,w=400,unit=100,noUnit=true,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
|
||||
newSlider({name="stereo", x=180, y=500,w=400,unit=10, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
|
||||
newSlider({name="spawn", x=180, y=300,w=400,unit=100,noUnit=true,font=30,change=function()SFX.fplay("spawn_1",setting.spawn)end, disp=SETval("spawn"), code=SETsto("spawn")}),
|
||||
newSlider({name="bgm", x=180, y=400,w=400,unit=100,noUnit=true,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
|
||||
newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
|
||||
newSlider({name="voc", x=750, y=300,w=400,unit=100,noUnit=true,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
|
||||
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
setting_control={
|
||||
@@ -333,7 +348,7 @@ local Widgets={
|
||||
newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",font=30,code=nextDir(3)}),
|
||||
newButton({name="spin4", x=550,y=540,w=90,h=65,color="white",font=30,code=nextDir(4)}),
|
||||
newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",font=30,code=nextDir(5)}),
|
||||
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--cannot rotate O
|
||||
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--Cannot rotate O
|
||||
newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",font=30,code=nextDir(7)}),
|
||||
|
||||
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
|
||||
@@ -357,6 +372,8 @@ local Widgets={
|
||||
for i=1,#VK_org do
|
||||
VK_org[i].ava=false
|
||||
end
|
||||
|
||||
--Replace keys
|
||||
for n=1,#D do
|
||||
local T=D[n]
|
||||
if T[1]then
|
||||
@@ -364,7 +381,7 @@ local Widgets={
|
||||
B.ava=true
|
||||
B.x,B.y,B.r=T[2],T[3],T[4]
|
||||
end
|
||||
end--Replace keys
|
||||
end
|
||||
sceneTemp.default=sceneTemp.default%5+1
|
||||
sceneTemp.sel=nil
|
||||
end}),
|
||||
@@ -374,7 +391,7 @@ local Widgets={
|
||||
end}),
|
||||
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
|
||||
code=function()
|
||||
SCN.goto("setting_touchSwitch")
|
||||
SCN.go("setting_touchSwitch")
|
||||
end}),
|
||||
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
|
||||
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,
|
||||
@@ -420,7 +437,7 @@ local Widgets={
|
||||
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
|
||||
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
|
||||
code=function()
|
||||
SCN.goto("setting_trackSetting")
|
||||
SCN.go("setting_trackSetting")
|
||||
end,
|
||||
hide=function()
|
||||
return not setting.VKTrack
|
||||
@@ -439,11 +456,12 @@ local Widgets={
|
||||
newButton({name="chi2", x=380, y=100,w=200,h=120,color="white",font=45,code=setLang(2)}),
|
||||
newButton({name="eng", x=600, y=100,w=200,h=120,color="white",font=45,code=setLang(3)}),
|
||||
newButton({name="str", x=820, y=100,w=200,h=120,color="white",font=45,code=setLang(4)}),
|
||||
newButton({name="yygq", x=1040, y=100,w=200,h=120,color="white",font=45,code=setLang(5)}),
|
||||
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
help={
|
||||
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("staff")end}),
|
||||
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("history")end}),
|
||||
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("staff")end}),
|
||||
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("history")end}),
|
||||
newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
|
||||
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
@@ -451,8 +469,8 @@ local Widgets={
|
||||
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
history={
|
||||
newButton({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp[2]==1 end}),
|
||||
newButton({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp[2]==#sceneTemp[1]end}),
|
||||
newKey({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp.pos==1 end}),
|
||||
newKey({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp.pos==#sceneTemp.text end}),
|
||||
newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}),
|
||||
},
|
||||
stat={
|
||||
@@ -460,46 +478,51 @@ local Widgets={
|
||||
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
debug={
|
||||
newButton({name="killWTM", x=340, y=200,w=260,h=100,color="white",font=35,
|
||||
newButton({name="reset", x=640,y=200,w=260,h=100,color="yellow",font=40,
|
||||
code=function()
|
||||
marking=nil
|
||||
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
|
||||
SFX.play("clear")
|
||||
sceneTemp.reset=true
|
||||
end,
|
||||
hide=function()
|
||||
return not marking
|
||||
return sceneTemp.reset
|
||||
end}),
|
||||
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,
|
||||
newButton({name="reset1", x=340,y=400,w=260,h=100,color="red",font=40,
|
||||
code=function()
|
||||
for name,M in next,Modes do
|
||||
if not modeRanks[name]then
|
||||
modeRanks[name]=M.score and 0 or 6
|
||||
love.filesystem.remove("unlock.dat")
|
||||
SFX.play("finesseError_long")
|
||||
TEXT.show("rank resetted",640,300,60,"stretch",.4)
|
||||
TEXT.show("effected after restart game",640,360,60,"stretch",.4)
|
||||
TEXT.show("play one game if you regret",640,390,40,"stretch",.4)
|
||||
end,
|
||||
hide=function()
|
||||
return not sceneTemp.reset
|
||||
end}),
|
||||
newButton({name="reset2", x=640,y=400,w=260,h=100,color="red",font=40,
|
||||
code=function()
|
||||
love.filesystem.remove("data.dat")
|
||||
SFX.play("finesseError_long")
|
||||
TEXT.show("game data resetted",640,300,60,"stretch",.4)
|
||||
TEXT.show("effected after restart game",640,360,60,"stretch",.4)
|
||||
TEXT.show("play one game if you regret",640,390,40,"stretch",.4)
|
||||
end,
|
||||
hide=function()
|
||||
return not sceneTemp.reset
|
||||
end}),
|
||||
newButton({name="reset3", x=940,y=400,w=260,h=100,color="red",font=40,
|
||||
code=function()
|
||||
local L=love.filesystem.getDirectoryItems("")
|
||||
for i=1,#L do
|
||||
local s=L[i]
|
||||
if s:sub(-4)==".dat"then
|
||||
love.filesystem.remove(s)
|
||||
end
|
||||
end
|
||||
FILE.saveUnlock()
|
||||
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
|
||||
SFX.play("clear_2")
|
||||
end}),
|
||||
newButton({name="reset", x=940,y=200,w=260,h=100,color="white",font=40,
|
||||
code=function()
|
||||
sceneTemp.ct=sceneTemp.ct+1
|
||||
if sceneTemp.ct==1 then
|
||||
TEXT.show("RESET ALL DATA?",640,360,50,"appear",.5)
|
||||
elseif sceneTemp.ct==5 then
|
||||
TEXT.show("SURE?????",640,360,80,"beat",.5)
|
||||
elseif sceneTemp.ct==10 then
|
||||
local L=love.filesystem.getDirectoryItems("")
|
||||
for i=1,#L do
|
||||
local s=L[i]
|
||||
if s:sub(-4)==".dat"then
|
||||
love.filesystem.remove(s)
|
||||
end
|
||||
end
|
||||
SFX.play("clear_4")SFX.play("finesseError_long")
|
||||
TEXT.clear()
|
||||
TEXT.show("ALL SAVING FILE DELETED",640,360,60,"stretch",.4)
|
||||
SCN.back()
|
||||
end
|
||||
SFX.play("clear_4")SFX.play("finesseError_long")
|
||||
TEXT.show("all file deleted",640,330,60,"stretch",.4)
|
||||
TEXT.show("effected after restart game",640,390,60,"stretch",.4)
|
||||
SCN.back()
|
||||
end,
|
||||
hide=function()
|
||||
return not sceneTemp.reset
|
||||
end}),
|
||||
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
||||
},
|
||||
|
||||
20
conf.lua
20
conf.lua
@@ -1,10 +1,10 @@
|
||||
gameVersion="Alpha V0.9.3"
|
||||
gameVersion="Alpha V0.10.4"
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--saving folder
|
||||
t.identity="Techmino"--Saving folder
|
||||
t.version="11.1"
|
||||
t.gammacorrect=false
|
||||
t.appendidentity=true--search files in source then in save directory
|
||||
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
|
||||
t.appendidentity=true--Search files in source then in save directory
|
||||
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
|
||||
if t.audio then t.audio.mixwithsystem=true end
|
||||
|
||||
local W=t.window
|
||||
@@ -16,12 +16,12 @@ function love.conf(t)
|
||||
W.resizable=true
|
||||
W.fullscreentype="desktop"--"exclusive"
|
||||
W.fullscreen=false
|
||||
W.vsync=nil--60FPS
|
||||
W.msaa=false--num of samples to use with multi-sampled antialiasing
|
||||
W.depth=0--bits/samp of depth buffer
|
||||
W.stencil=1--bits/samp of stencil buffer
|
||||
W.display=1--monitor ID
|
||||
W.highdpi=true--high-dpi mode for the window on a Retina display
|
||||
W.vsync=0--Do not limit FPS
|
||||
W.msaa=false--Num of samples to use with multi-sampled antialiasing
|
||||
W.depth=0--Bits/samp of depth buffer
|
||||
W.stencil=1--Bits/samp of stencil buffer
|
||||
W.display=1--Monitor ID
|
||||
W.highdpi=true--High-dpi mode for the window on a Retina display
|
||||
W.x,W.y=nil
|
||||
|
||||
local M=t.modules
|
||||
|
||||
20
document.txt
20
document.txt
@@ -11,16 +11,15 @@ spin判定:
|
||||
|
||||
攻击系统:
|
||||
普通消除:
|
||||
消1/2/3/4攻击0.25/1.25/2.25/4
|
||||
消1/2/3/4攻击0.5/1.5/2.5/4
|
||||
特殊消除:
|
||||
spin1/2/3攻击2/4/6,若mini则减半
|
||||
spin1/2/3攻击2/4/6,若mini则减至一半
|
||||
B2B:加1(techrash/spin1/spin2)或2(spin3)攻击
|
||||
B3B:在B2B效果之上消四再加1,spin再加0.5*消行数攻击,二者都+1额外抵挡
|
||||
堆楼连击:0,0,1,1,2,2,2,3,3,3,4,4,3, 之后都是2
|
||||
挖掘连击:0,0,1,1,2,2,3,3,4,4,4, 之后都是5
|
||||
连击:给予上述攻击[连击数*20%]的加成,上限200%,连消3次之后额外加1攻击
|
||||
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
|
||||
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
|
||||
全消:将上述伤害之和开根号,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
|
||||
全消:将上述伤害之和减半,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
|
||||
根据上述规则计算后,向下取整,攻击打出
|
||||
|
||||
分数系统:
|
||||
@@ -37,7 +36,7 @@ spin判定:
|
||||
back to back(B2B)点数说明:
|
||||
B2B点数的范围在0~1200,在点数>=40时进行特殊消除为B2B,>1000时特殊消除为B3B
|
||||
普通消除-250
|
||||
spin1/2/3:+50/100/180(mini变为原来40%)
|
||||
spin1/2/3:+50/100/180(mini变为原来25%)
|
||||
消四:+100
|
||||
空spin:+20,此法得到的点数不能超过1000
|
||||
当点数在1000以上时空放一块-40(不减到低于1000)
|
||||
@@ -67,16 +66,15 @@ Spin detection:
|
||||
|
||||
Attack system:
|
||||
Regular line clears:
|
||||
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
|
||||
Single/Double/Triple/Techrash sends 0.5/1.5/2.5/4
|
||||
Special line clears:
|
||||
Spin Single/Double/Triple sends 2/4/6, half if Mini
|
||||
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
|
||||
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
|
||||
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
|
||||
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
|
||||
Combo: each combo gives 20% more attack (capped at 200%), extra 1 attack after 3 combo
|
||||
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
|
||||
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
|
||||
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
|
||||
Perfect Clear: half all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
|
||||
After calculating all above, the damage value will be rounded down then sent
|
||||
|
||||
Score system:
|
||||
@@ -93,7 +91,7 @@ Countering:
|
||||
Back to Back (B2B) gauge:
|
||||
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
|
||||
A regular line clear -250
|
||||
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
|
||||
Spin Single/Double/Triple +50/100/180 (x25% if Mini)
|
||||
Techrash +100
|
||||
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
|
||||
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
|
||||
|
||||
BIN
image/skin/retro(notypey).png
Normal file
BIN
image/skin/retro(notypey).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
image/skin/retro_grey(notypey).png
Normal file
BIN
image/skin/retro_grey(notypey).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
108
main.lua
108
main.lua
@@ -1,12 +1,16 @@
|
||||
--[[
|
||||
______ __ _
|
||||
/_ __/___ _____ / /_ ____ ___ (_)____ ____
|
||||
/ / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \
|
||||
/ / / __// /__ / / / // / / / / // // / / // /_/ /
|
||||
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
|
||||
Techmino is my first "huge project"
|
||||
optimization is welcomed if you also love tetromino game
|
||||
]]
|
||||
______ __ _
|
||||
/_ __/___ _____ / /_ ____ ___ (_)____ ____
|
||||
/ / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \
|
||||
/ / / __// /__ / / / // / / / / // // / / // /_/ /
|
||||
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
|
||||
Techmino is my first "huge project"
|
||||
optimization is welcomed if you also love tetromino game
|
||||
]]--
|
||||
|
||||
--?
|
||||
function NULL()end
|
||||
DBP=print--use this if need debugging print
|
||||
|
||||
--Global Setting & Vars
|
||||
math.randomseed(os.time()*626)
|
||||
@@ -14,32 +18,53 @@ love.keyboard.setKeyRepeat(true)
|
||||
love.keyboard.setTextInput(false)
|
||||
love.mouse.setVisible(false)
|
||||
|
||||
function NULL()end
|
||||
system=love.system.getOS()
|
||||
game={}
|
||||
mapCam={
|
||||
sel=nil,--selected mode ID
|
||||
sel=nil,--Selected mode ID
|
||||
|
||||
x=0,y=0,k=1,--camera pos/k
|
||||
x1=0,y1=0,k1=1,--camera pos/k shown
|
||||
--basic paras
|
||||
--Basic paragrams
|
||||
x=0,y=0,k=1,--Camera pos/k
|
||||
x1=0,y1=0,k1=1,--Camera pos/k shown
|
||||
|
||||
keyCtrl=false,--if controlling with key
|
||||
--If controlling with key
|
||||
keyCtrl=false,
|
||||
|
||||
--For auto zooming when enter/leave scene
|
||||
zoomMethod=nil,
|
||||
zoomK=nil,
|
||||
--for auto zooming when enter/leave scene
|
||||
}
|
||||
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--wid,hei,radius,scale K
|
||||
scr={x=0,y=0,w=0,h=0,W=0,H=0,rad=0,k=1}--wid,hei,radius,scale K
|
||||
|
||||
customSel={1,22,1,1,7,3,1,1,8,4,1,1,1}
|
||||
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
|
||||
preBag={}
|
||||
|
||||
players={alive={},human=0}
|
||||
--blockSkin,blockSkinMini={},{}--redefined in SKIN.change
|
||||
game={
|
||||
frame=0, --Frame count
|
||||
result=false, --Game result (string)
|
||||
pauseTime=0, --Time paused
|
||||
pauseCount=0, --Pausing count
|
||||
garbageSpeed=1, --Garbage timing speed
|
||||
warnLVL0=0, --Warning level
|
||||
warnLVL=0, --Warning level (show)
|
||||
recording=false, --If recording
|
||||
replaying=false, --If replaying
|
||||
seed=math.random(999999999),--Game seed
|
||||
setting={}, --Game settings
|
||||
rec={}, --Recording list, key,time,key,time...
|
||||
|
||||
require("Zframework")--load Zframework
|
||||
--Data for royale mode
|
||||
stage=nil, --Game stage
|
||||
mostBadge=nil, --Most badge owner
|
||||
secBadge=nil, --Second badge owner
|
||||
mostDangerous=nil, --Most dangerous player
|
||||
secDangerous=nil, --Second dangerous player
|
||||
}--Global game data
|
||||
players={alive={}}--Players data
|
||||
curMode=nil--Current mode object
|
||||
--blockSkin,blockSkinMini={},{}--Redefined in SKIN.change
|
||||
|
||||
require("Zframework")--Load Zframework
|
||||
|
||||
--Load modules
|
||||
blocks= require("parts/mino")
|
||||
@@ -58,7 +83,7 @@ Modes= require("parts/modes")
|
||||
TICK= require("parts/tick")
|
||||
|
||||
|
||||
--load files & settings
|
||||
--Load files & settings
|
||||
modeRanks={sprint_10=0}
|
||||
|
||||
local fs=love.filesystem
|
||||
@@ -74,6 +99,9 @@ else
|
||||
setting.swap=false
|
||||
setting.vib=2
|
||||
setting.powerInfo=true
|
||||
setting.fullscreen=true
|
||||
love.window.setFullscreen(true)
|
||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
||||
end
|
||||
end
|
||||
LANG.set(setting.lang)
|
||||
@@ -87,23 +115,35 @@ if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
|
||||
if fs.getInfo("tech_ultimate.dat")then fs.remove("tech_ultimate.dat")end
|
||||
if fs.getInfo("tech_ultimate+.dat")then fs.remove("tech_ultimate+.dat")end
|
||||
|
||||
--update data file
|
||||
S=stat
|
||||
while #modeRanks>73 do
|
||||
table.remove(modeRanks)
|
||||
end
|
||||
if modeRanks[73]==6 then modeRanks[73]=0 end
|
||||
if modeRanks[1]then--rename key of modeRanks
|
||||
local L=modeRanks
|
||||
for i=1,#L do
|
||||
L[Modes[i].name],L[i]=L[i]
|
||||
--Update modeRanks
|
||||
R=modeRanks
|
||||
for k,v in next,R do
|
||||
if type(k)=="number"then
|
||||
local save=v
|
||||
if not R[Modes[k].name]then
|
||||
R[Modes[k].name]=v
|
||||
end
|
||||
R[k]=nil
|
||||
end
|
||||
end
|
||||
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then
|
||||
if R.master_adavnce then
|
||||
R.master_advance,R.master_adavnce=R.master_adavnce
|
||||
end
|
||||
if not text.modes[stat.lastPlay]then
|
||||
stat.lastPlay="sprint_10"
|
||||
end
|
||||
|
||||
--Update data file
|
||||
S=stat
|
||||
if type(setting.spawn)~="number"then
|
||||
setting.spawn=0
|
||||
end
|
||||
if S.version~=gameVersion then
|
||||
S.version=gameVersion
|
||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
||||
newVersionLaunch=true
|
||||
|
||||
fs.remove("sprintPenta.dat")
|
||||
fs.remove("master_adavnce.dat")
|
||||
fs.remove("master_beginner.dat")
|
||||
end
|
||||
S=nil
|
||||
R,S=nil
|
||||
@@ -2,7 +2,8 @@ local int,max,min=math.floor,math.max,math.min
|
||||
local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
|
||||
local function score(P)
|
||||
local F=false
|
||||
if P.modeData.point<70 then--if Less then MM
|
||||
--If Less then MM
|
||||
if P.modeData.point<70 then
|
||||
local R=#P.clearedRow
|
||||
if R==0 then return end
|
||||
if R==4 then R=10 end
|
||||
@@ -28,6 +29,7 @@ return{
|
||||
P.modeData.point=min(P.modeData.point+16,80)
|
||||
P.modeData.event=sectionName[int(P.modeData.point*.1)+1]
|
||||
P:win("finish")
|
||||
return true
|
||||
end
|
||||
end,
|
||||
bg="aura",bgm="far",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd=math.floor,math.random
|
||||
local int=math.floor
|
||||
return{
|
||||
color=color.magenta,
|
||||
env={
|
||||
@@ -14,12 +14,12 @@ return{
|
||||
local t
|
||||
if D.event<20 then
|
||||
t=1500-30*D.event--1500~900
|
||||
B[p]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
B[p+1]= {pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
B[p]= {pos=P:RND(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
B[p+1]= {pos=P:RND(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
else
|
||||
t=900-10*(D.event-20)--900~600
|
||||
B[p]= {pos=rnd(10),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
B[p+1]= {pos=rnd(4,7),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5}
|
||||
B[p]= {pos=P:RND(10),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
B[p+1]= {pos=P:RND(4,7),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5}
|
||||
end
|
||||
B.sum=B.sum+22
|
||||
P.stat.recv=P.stat.recv+22
|
||||
@@ -34,7 +34,7 @@ return{
|
||||
end
|
||||
end
|
||||
end,
|
||||
bg="game4",bgm="push",
|
||||
bg="rainbow2",bgm="way",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd,min=math.floor,math.random,math.min
|
||||
local int,min=math.floor,math.min
|
||||
return{
|
||||
color=color.lYellow,
|
||||
env={
|
||||
@@ -13,18 +13,18 @@ return{
|
||||
local s,t
|
||||
if D.event<10 then
|
||||
t=800-10*D.event--800~700
|
||||
B[p]= {pos=rnd(5,6),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
B[p+1]= {pos=rnd(4,7),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4}
|
||||
B[p]= {pos=P:RND(5,6),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
B[p+1]= {pos=P:RND(4,7),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4}
|
||||
s=20
|
||||
elseif D.event<20 then
|
||||
t=800-10*D.event--700~600
|
||||
B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
B[p+1]= {pos=rnd(4,7),amount=13,countdown=t,cd0=t+62,time=0,sent=false,lv=5}
|
||||
B[p]= {pos=P:RND(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4}
|
||||
B[p+1]= {pos=P:RND(4,7),amount=13,countdown=t,cd0=t+62,time=0,sent=false,lv=5}
|
||||
s=24
|
||||
else
|
||||
t=600-15*(min(D.event-20,10))--600~450
|
||||
B[p]= {pos=rnd(2)*9-8,amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5}
|
||||
B[p+1]= {pos=rnd(3,8),amount=14,countdown=t+62,cd0=t,time=0,sent=false,lv=5}
|
||||
B[p]= {pos=P:RND(2)*9-8,amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5}
|
||||
B[p+1]= {pos=P:RND(3,8),amount=14,countdown=t+62,cd0=t,time=0,sent=false,lv=5}
|
||||
s=28
|
||||
end
|
||||
B.sum=B.sum+s
|
||||
@@ -43,7 +43,7 @@ return{
|
||||
end
|
||||
end
|
||||
end,
|
||||
bg="game4",bgm="shining terminal",
|
||||
bg="rainbow2",bgm="shining terminal",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -13,7 +13,7 @@ return{
|
||||
hold=false,
|
||||
dropPiece=function(P)P:lose()end,
|
||||
task=nil,
|
||||
bg="game1",bgm="newera",
|
||||
bg="bg1",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -7,7 +7,7 @@ return{
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=10,
|
||||
target=200,
|
||||
bg="glow",bgm="newera",
|
||||
bg="glow",bgm="reason",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -4,13 +4,13 @@ return{
|
||||
color=color.magenta,
|
||||
env={
|
||||
drop=15,lock=45,
|
||||
fall=10,lock=60,
|
||||
fall=10,
|
||||
center=false,
|
||||
visible="none",
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret7th",
|
||||
bg="rgb",bgm="reason",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -11,7 +11,7 @@ return{
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret8th",
|
||||
bg="rgb",bgm="reason",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -7,7 +7,6 @@ return{
|
||||
freshLimit=10,
|
||||
visible="fast",
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=10,
|
||||
target=200,
|
||||
bg="glow",bgm="reason",
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@ return{
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret7th",
|
||||
bg="rgb",bgm="way",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -13,7 +13,7 @@ return{
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=100,
|
||||
bg="none",bgm="secret7th",
|
||||
bg="none",bgm="way",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local rnd,min=math.random,math.min
|
||||
local min=math.min
|
||||
local function check_c4w(P)
|
||||
for i=1,#P.clearedRow do
|
||||
P.field[#P.field+1]=freeRow.get(13)
|
||||
@@ -35,7 +35,7 @@ return{
|
||||
P.visTime[i]=freeRow.get(20)
|
||||
for x=4,7 do F[i][x]=0 end
|
||||
end
|
||||
local r=rnd(6)
|
||||
local r=P:RND(6)
|
||||
if r==1 then F[1][5],F[1][4],F[2][4]=13,13,13
|
||||
elseif r==2 then F[1][6],F[1][7],F[2][7]=13,13,13
|
||||
elseif r==3 then F[1][4],F[2][4],F[2][5]=13,13,13
|
||||
@@ -59,7 +59,7 @@ return{
|
||||
if L==100 then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=36 and 5 or
|
||||
T<=40 and 5 or
|
||||
T<=60 and 4 or
|
||||
3
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local rnd,min=math.random,math.min
|
||||
local min=math.min
|
||||
local function check_c4w(P)
|
||||
for i=1,#P.clearedRow do
|
||||
P.field[#P.field+1]=freeRow.get(13)
|
||||
@@ -33,7 +33,7 @@ return{
|
||||
P.visTime[i]=freeRow.get(20)
|
||||
for x=4,7 do F[i][x]=0 end
|
||||
end
|
||||
local r=rnd(6)
|
||||
local r=P:RND(6)
|
||||
if r==1 then F[1][5],F[1][4],F[2][4]=13,13,13
|
||||
elseif r==2 then F[1][6],F[1][7],F[2][7]=13,13,13
|
||||
elseif r==3 then F[1][4],F[2][4],F[2][5]=13,13,13
|
||||
|
||||
@@ -31,7 +31,11 @@ return{
|
||||
end
|
||||
modeEnv._20G=modeEnv.drop==0
|
||||
modeEnv.oncehold=customSel[6]==1
|
||||
if preBag[1]then modeEnv.bag=preBag end
|
||||
if preBag[1]then
|
||||
modeEnv.bag=preBag
|
||||
else
|
||||
modeEnv.bag=nil
|
||||
end
|
||||
modeEnv.target=0
|
||||
PLY.newPlayer(1,340,15)
|
||||
local L=modeEnv.opponent
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd=math.floor,math.random
|
||||
local int=math.floor
|
||||
return{
|
||||
color=color.red,
|
||||
env={
|
||||
@@ -14,7 +14,7 @@ return{
|
||||
if P.modeData.counter>=t then
|
||||
P.modeData.counter=0
|
||||
for _=1,4 do
|
||||
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=5*t,cd0=5*t,time=0,sent=false,lv=2}
|
||||
P.atkBuffer[#P.atkBuffer+1]={pos=P:RND(10),amount=1,countdown=5*t,cd0=5*t,time=0,sent=false,lv=2}
|
||||
end
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+4
|
||||
P.stat.recv=P.stat.recv+4
|
||||
@@ -37,7 +37,7 @@ return{
|
||||
end
|
||||
end
|
||||
end,
|
||||
bg="game4",bgm="shining terminal",
|
||||
bg="rainbow2",bgm="shining terminal",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd=math.floor,math.random
|
||||
local int=math.floor
|
||||
return{
|
||||
color=color.green,
|
||||
env={
|
||||
@@ -14,7 +14,7 @@ return{
|
||||
if P.modeData.counter>=t then
|
||||
P.modeData.counter=0
|
||||
for _=1,3 do
|
||||
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(2,9),amount=1,countdown=2*t,cd0=2*t,time=0,sent=false,lv=1}
|
||||
P.atkBuffer[#P.atkBuffer+1]={pos=P:RND(2,9),amount=1,countdown=2*t,cd0=2*t,time=0,sent=false,lv=1}
|
||||
end
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+3
|
||||
P.stat.recv=P.stat.recv+3
|
||||
@@ -37,7 +37,7 @@ return{
|
||||
end
|
||||
end
|
||||
end,
|
||||
bg="game4",bgm="way",
|
||||
bg="rainbow2",bgm="way",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.magenta,
|
||||
env={
|
||||
@@ -10,13 +10,13 @@ return{
|
||||
local D=P.modeData
|
||||
D.counter=D.counter+1
|
||||
if D.counter>=max(90,180-D.event)then
|
||||
P:garbageRise(10,1,rnd(10))
|
||||
P:garbageRise(10,1,P:RND(10))
|
||||
P.stat.recv=P.stat.recv+1
|
||||
D.counter=0
|
||||
D.event=D.event+1
|
||||
end
|
||||
end,
|
||||
bg="game2",bgm="push",
|
||||
bg="bg2",bgm="way",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.lYellow,
|
||||
env={
|
||||
@@ -9,13 +9,13 @@ return{
|
||||
local D=P.modeData
|
||||
D.counter=D.counter+1
|
||||
if D.counter>=max(30,80-.3*D.event)then
|
||||
P:garbageRise(13+D.event%5,1,rnd(10))
|
||||
P:garbageRise(13+D.event%5,1,P:RND(10))
|
||||
P.stat.recv=P.stat.recv+1
|
||||
D.counter=0
|
||||
D.event=D.event+1
|
||||
end
|
||||
end,
|
||||
bg="game2",bgm="secret7th",
|
||||
bg="bg2",bgm="shining terminal",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local rnd,min,rem=math.random,math.min,table.remove
|
||||
local min,rem=math.min,table.remove
|
||||
return{
|
||||
color=color.red,
|
||||
env={
|
||||
@@ -11,13 +11,14 @@ return{
|
||||
local height=freeRow.get(0)
|
||||
local max=#P.field
|
||||
if max>0 then
|
||||
--Get heights
|
||||
for x=1,10 do
|
||||
local h=max
|
||||
while P.field[h][x]==0 and h>1 do
|
||||
h=h-1
|
||||
end
|
||||
height[x]=h
|
||||
end--get heights
|
||||
end
|
||||
else
|
||||
for x=1,10 do
|
||||
height[x]=0
|
||||
@@ -42,8 +43,8 @@ return{
|
||||
goto END
|
||||
end
|
||||
|
||||
--give I when no hole
|
||||
d=-999--height difference
|
||||
--Give I when no hole
|
||||
d=-999--Height difference
|
||||
--A=hole mark
|
||||
for x=2,11 do
|
||||
local _=height[x]-height[x-1]
|
||||
@@ -59,7 +60,7 @@ return{
|
||||
res[A+2]=7
|
||||
end
|
||||
|
||||
--give O when no d=0/give T when no d=1
|
||||
--Give O when no d=0/give T when no d=1
|
||||
d=0--d=0 count
|
||||
A=0--d=1 count
|
||||
for x=2,10 do
|
||||
@@ -87,7 +88,7 @@ return{
|
||||
|
||||
::END::
|
||||
freeRow.discard(height)
|
||||
P:getNext(res[rnd(#res)])
|
||||
P:getNext(res[P:RND(#res)])
|
||||
end
|
||||
end,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
local format,rnd=string.format,math.random
|
||||
local format=string.format
|
||||
local function check_rise(P)
|
||||
if #P.clearedRow==0 then
|
||||
local L=P.garbageBeneath
|
||||
if L>0 then
|
||||
if L<3 then
|
||||
P:showTextF(text.almost,0,-120,80,"beat",.8)
|
||||
elseif L<5 then
|
||||
P:showTextF(text.great,0,-120,80,"fly",.8)
|
||||
end
|
||||
end
|
||||
for i=1,8-P.garbageBeneath do
|
||||
P:garbageRise(13,1,rnd(10))
|
||||
P:garbageRise(13,1,P:RND(10))
|
||||
end
|
||||
else
|
||||
if P.garbageBeneath==0 then
|
||||
P:showTextF(text.awesome,0,-120,80,"beat",.6)
|
||||
SFX.play("clear")
|
||||
BG.send(26)
|
||||
for i=1,8-P.garbageBeneath do
|
||||
P:garbageRise(13,1,P:RND(10))
|
||||
end
|
||||
else
|
||||
BG.send(#P.clearedRow)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -13,13 +32,14 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=check_rise,
|
||||
pushSpeed=1,
|
||||
bg="glow",bgm="infinite",
|
||||
pushSpeed=1.2,
|
||||
bg="wing",bgm="infinite",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
local P=players[1]
|
||||
for _=1,8 do
|
||||
players[1]:garbageRise(13,1,rnd(10))
|
||||
P:garbageRise(13,1,P:RND(10))
|
||||
end
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
|
||||
@@ -21,7 +21,7 @@ return{
|
||||
mindas=7,minarr=1,minsdarr=1,
|
||||
drop=.5,wait=8,fall=20,
|
||||
target=50,dropPiece=check,
|
||||
bg="game2",bgm="push",
|
||||
bg="bg2",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
slowMark=true,
|
||||
|
||||
@@ -17,11 +17,10 @@ return{
|
||||
color=color.green,
|
||||
env={
|
||||
noFly=true,
|
||||
minsdarr=1,
|
||||
wait=8,fall=20,
|
||||
target=10,dropPiece=check_LVup,
|
||||
mindas=7,minarr=1,minsdarr=1,
|
||||
bg="game2",bgm="push",
|
||||
bg="bg2",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
slowMark=true,
|
||||
|
||||
@@ -14,9 +14,10 @@ local function score(P)
|
||||
if P.modeData.point%100==99 then
|
||||
SFX.play("blip_1")
|
||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
||||
local s=P.modeData.event+1;P.modeData.event=s--level up!
|
||||
--Level up!
|
||||
local s=P.modeData.event+1;P.modeData.event=s
|
||||
local E=P.gameEnv
|
||||
BG.set(s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5")
|
||||
BG.set(s==1 and"rainbow"or s==2 and"rainbow2"or s==3 and"lightning"or s==4 and"lightning2"or"lightning")
|
||||
E.lock=death_lock[s]
|
||||
E.wait=death_wait[s]
|
||||
E.fall=death_fall[s]
|
||||
@@ -43,7 +44,7 @@ return{
|
||||
fall=death_fall[1],
|
||||
dropPiece=score,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="secret7th",
|
||||
bg="bg2",bgm="secret7th",
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
@@ -55,10 +56,10 @@ return{
|
||||
mStr((P.modeData.event+1)*100,-81,370)
|
||||
gc.rectangle("fill",-125,375,90,4)
|
||||
end,
|
||||
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
|
||||
score=function(P)return{P.modeData.point,P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
|
||||
comp=function(a,b)
|
||||
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
|
||||
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
|
||||
end,
|
||||
getRank=function(P)
|
||||
local S=P.modeData.point
|
||||
@@ -13,9 +13,10 @@ local function score(P)
|
||||
if P.modeData.point%100==99 then
|
||||
SFX.play("blip_1")
|
||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
||||
local s=P.modeData.event+1;P.modeData.event=s--level up!
|
||||
--Level up!
|
||||
local s=P.modeData.event+1;P.modeData.event=s
|
||||
local E=P.gameEnv
|
||||
BG.set(s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4")
|
||||
BG.set(s==1 and"bg1"or s==2 and"bg2"or s==3 and"rainbow"or "rainbow2")
|
||||
E.lock=rush_lock[s]
|
||||
E.wait=rush_wait[s]
|
||||
E.fall=rush_fall[s]
|
||||
@@ -47,7 +48,7 @@ return{
|
||||
fall=rush_fall[1],
|
||||
dropPiece=score,
|
||||
freshLimit=15,
|
||||
bg="game1",bgm="secret8th",
|
||||
bg="bg1",bgm="secret8th",
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
@@ -59,25 +60,25 @@ return{
|
||||
mStr((P.modeData.event+1)*100,-81,370)
|
||||
gc.rectangle("fill",-125,375,90,4)
|
||||
end,
|
||||
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
|
||||
score=function(P)return{P.modeData.point,P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
|
||||
comp=function(a,b)
|
||||
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
|
||||
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
|
||||
end,
|
||||
getRank=function(P)
|
||||
local S=P.modeData.point
|
||||
if S==500 then
|
||||
local L=P.stat.clears[4]
|
||||
local T=P.stat.time
|
||||
return
|
||||
L>=30 and 5 or
|
||||
L>=25 and 4 or
|
||||
T<=170 and 5 or
|
||||
T<=200 and 4 or
|
||||
3
|
||||
else
|
||||
return
|
||||
S>=420 and 3 or
|
||||
S>=250 and 2 or
|
||||
S>=120 and 1 or
|
||||
S>=30 and 0
|
||||
S>=460 and 3 or
|
||||
S>=350 and 2 or
|
||||
S>=200 and 1 or
|
||||
S>=50 and 0
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -11,21 +11,23 @@ local function score(P)
|
||||
MD.point=MD.point+s
|
||||
if MD.point%100==99 then SFX.play("blip_1")end
|
||||
if int(MD.point*.01)>MD.event then
|
||||
local s=MD.event+1;MD.event=s--level up!
|
||||
--Level up!
|
||||
local s=MD.event+1;MD.event=s
|
||||
local E=P.gameEnv
|
||||
if s<4 then--first 300
|
||||
if s<4 then
|
||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
||||
--First 300
|
||||
if s~=1 then E.lock=E.lock-1 end
|
||||
if s~=2 then E.wait=E.wait-1 end
|
||||
if s~=3 then E.fall=E.fall-1 end
|
||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
||||
elseif s<10 then
|
||||
P:showTextF(text.stage(s),0,-120,60,"fly",1.26)
|
||||
if s==4 or s==7 then E.das=E.das-1 end
|
||||
s=s%3
|
||||
if s==0 then E.lock=E.lock-1
|
||||
elseif s==1 then E.wait=E.wait-1
|
||||
elseif s==2 then E.fall=E.fall-1
|
||||
end
|
||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
||||
else
|
||||
MD.point,MD.event=1000,9
|
||||
P:win("finish")
|
||||
@@ -44,7 +46,7 @@ return{
|
||||
dropPiece=score,
|
||||
freshLimit=15,
|
||||
easyFresh=false,bone=true,
|
||||
bg="none",bgm="distortion",
|
||||
bg="lightning",bgm="distortion",
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
|
||||
@@ -7,7 +7,7 @@ return{
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
ospin=false,
|
||||
bg="rgb",bgm="infinite",
|
||||
bg="rgb",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -7,7 +7,7 @@ return{
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
ospin=false,
|
||||
bg="rgb",bgm="infinite",
|
||||
bg="rgb",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd=math.floor,math.random
|
||||
local int=math.floor
|
||||
local ins=table.insert
|
||||
local pc_drop={50,45,40,35,30,26,22,18,15,12}
|
||||
local pc_lock={55,50,45,40,36,32,30}
|
||||
@@ -11,7 +11,7 @@ local function task_PC(P)
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter==26 then
|
||||
local base=PCbase[P.modeData.type]
|
||||
P:pushLine(base[rnd(#base)],P.modeData.symmetry)
|
||||
P:pushLine(base[P:RND(#base)],P.modeData.symmetry)
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -24,9 +24,9 @@ local function newPC(P)
|
||||
if c<5 then P:lose()end
|
||||
end
|
||||
if #P.field==0 then
|
||||
local type=PCtype[P.stat.pc]or rnd(2,3)
|
||||
local L=PClist[type][rnd(#PClist[1])]
|
||||
local symmetry=rnd()>.5
|
||||
local type=PCtype[P.stat.pc]or P:RND(2,3)
|
||||
local L=PClist[type][P:RND(#PClist[1])]
|
||||
local symmetry=P:RND()>.5
|
||||
P.modeData.type=type
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNext(L,symmetry)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local rnd=math.random
|
||||
local PCbase=require("parts/PCbase")
|
||||
local PClist=require("parts/PClist")
|
||||
local PCtype={
|
||||
@@ -17,7 +16,7 @@ local function task_PC(P)
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter==26 then
|
||||
local base=PCbase[P.modeData.type]
|
||||
P:pushLine(base[rnd(#base)],P.modeData.symmetry)
|
||||
P:pushLine(base[P:RND(#base)],P.modeData.symmetry)
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -30,9 +29,9 @@ local function newPC(P)
|
||||
if c<5 then P:lose()end
|
||||
end
|
||||
if #P.field==0 then
|
||||
local type=PCtype[P.stat.pc]or rnd(2,3)
|
||||
local L=PClist[type][rnd(#PClist[1])]
|
||||
local symmetry=rnd()>.5
|
||||
local type=PCtype[P.stat.pc]or P:RND(2,3)
|
||||
local L=PClist[type][P:RND(#PClist[1])]
|
||||
local symmetry=P:RND()>.5
|
||||
P.modeData.type=type
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNext(L,symmetry)
|
||||
|
||||
@@ -16,7 +16,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=update_round,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -16,7 +16,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=update_round,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -16,7 +16,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=update_round,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -16,7 +16,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=update_round,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -16,7 +16,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
oncehold=false,
|
||||
dropPiece=update_round,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -3,7 +3,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -3,7 +3,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -3,7 +3,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -3,7 +3,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -3,7 +3,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -25,20 +25,16 @@ return{
|
||||
end,
|
||||
score=function(P)return{P.stat.time,P.stat.piece}end,
|
||||
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
|
||||
comp=function(a,b)return a[2]>b[2]or a[2]==b[2]and a[1]<b[1]end,
|
||||
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
|
||||
getRank=function(P)
|
||||
local T=P.stat.row
|
||||
if T<5 then
|
||||
return
|
||||
elseif T<40 then
|
||||
return 0
|
||||
end
|
||||
T=P.stat.time
|
||||
if P.stat.row<40 then return end
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=76 and 5 or
|
||||
T<=90 and 4 or
|
||||
T<=150 and 3 or
|
||||
T<=260 and 2 or
|
||||
1
|
||||
T<=500 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=10,dropPiece=PLY.reach_winCheck,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
@@ -29,11 +29,11 @@ return{
|
||||
if P.stat.row<100 then return end
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=62 and 5 or
|
||||
T<=70 and 5 or
|
||||
T<=90 and 4 or
|
||||
T<=130 and 3 or
|
||||
T<=136 and 3 or
|
||||
T<=196 and 2 or
|
||||
T<=260 and 1 or
|
||||
T<=240 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=1000,dropPiece=PLY.reach_winCheck,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
@@ -30,10 +30,10 @@ return{
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=626 and 5 or
|
||||
T<=888 and 4 or
|
||||
T<=1140 and 3 or
|
||||
T<=1406 and 2 or
|
||||
T<=1626 and 1 or
|
||||
T<=800 and 4 or
|
||||
T<=900 and 3 or
|
||||
T<=1050 and 2 or
|
||||
T<=1200 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=20,dropPiece=PLY.reach_winCheck,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=40,dropPiece=PLY.reach_winCheck,
|
||||
bg="game2",bgm="race",
|
||||
bg="bg2",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=400,dropPiece=PLY.reach_winCheck,
|
||||
bg="game3",bgm="push",
|
||||
bg="rainbow",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
@@ -29,11 +29,11 @@ return{
|
||||
if P.stat.row<400 then return end
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=255 and 5 or
|
||||
T<=326 and 4 or
|
||||
T<=462 and 3 or
|
||||
T<=555 and 2 or
|
||||
T<=626 and 1 or
|
||||
T<=300 and 5 or
|
||||
T<=330 and 4 or
|
||||
T<=360 and 3 or
|
||||
T<=390 and 2 or
|
||||
T<=420 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.cyan,
|
||||
env={
|
||||
@@ -8,7 +8,7 @@ return{
|
||||
if not(P.control and SCN.cur=="play")then return end
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter>=max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then
|
||||
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=P:RND(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1}
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+1
|
||||
P.stat.recv=P.stat.recv+1
|
||||
if P.modeData.event==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.magenta,
|
||||
env={
|
||||
@@ -11,9 +11,9 @@ return{
|
||||
if P.modeData.counter>=max(60,180-2*P.modeData.event)and B.sum<15 then
|
||||
B[#B+1]=
|
||||
P.modeData.event%3<2 and
|
||||
{pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1}
|
||||
{pos=P:RND(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1}
|
||||
or
|
||||
{pos=rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2}
|
||||
{pos=P:RND(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2}
|
||||
local R=(P.modeData.event%3<2 and 1 or 3)
|
||||
B.sum=B.sum+R
|
||||
P.stat.recv=P.stat.recv+R
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.red,
|
||||
env={
|
||||
@@ -9,7 +9,7 @@ return{
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter>=max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then
|
||||
local t=max(60,90-P.modeData.event)
|
||||
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=P:RND(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+4
|
||||
P.stat.recv=P.stat.recv+4
|
||||
if P.modeData.event==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end
|
||||
@@ -17,7 +17,7 @@ return{
|
||||
P.modeData.event=P.modeData.event+1
|
||||
end
|
||||
end,
|
||||
bg="glow",bgm="newera",
|
||||
bg="glow",bgm="secret8th",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.green,
|
||||
env={
|
||||
@@ -10,10 +10,10 @@ return{
|
||||
if P.modeData.counter>=max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then
|
||||
local d=P.modeData.event+1
|
||||
P.atkBuffer[#P.atkBuffer+1]=
|
||||
d%4==0 and{pos=rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or
|
||||
d%4==1 and{pos=rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or
|
||||
d%4==2 and{pos=rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2}or
|
||||
d%4==3 and{pos=rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3}
|
||||
d%4==0 and{pos=P:RND(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or
|
||||
d%4==1 and{pos=P:RND(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or
|
||||
d%4==2 and{pos=P:RND(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2}or
|
||||
d%4==3 and{pos=P:RND(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3}
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+d%4+1
|
||||
P.stat.recv=P.stat.recv+d%4+1
|
||||
if P.modeData.event==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local max,rnd=math.max,math.random
|
||||
local max=math.max
|
||||
return{
|
||||
color=color.lYellow,
|
||||
env={
|
||||
@@ -12,10 +12,10 @@ return{
|
||||
if P.modeData.counter>=max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then
|
||||
local t=max(300,480-12*P.modeData.event)
|
||||
local p=#P.atkBuffer+1
|
||||
P.atkBuffer[p] ={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2}
|
||||
P.atkBuffer[p+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
P.atkBuffer[p+2]={pos=rnd(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4}
|
||||
P.atkBuffer[p+3]={pos=rnd(10),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5}
|
||||
P.atkBuffer[p] ={pos=P:RND(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2}
|
||||
P.atkBuffer[p+1]={pos=P:RND(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}
|
||||
P.atkBuffer[p+2]={pos=P:RND(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4}
|
||||
P.atkBuffer[p+3]={pos=P:RND(10),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5}
|
||||
P.atkBuffer.sum=P.atkBuffer.sum+20
|
||||
P.stat.recv=P.stat.recv+20
|
||||
if P.modeData.event==31 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
dropPiece=tech_check_hard,
|
||||
bg="matrix",bgm="secret8th",
|
||||
bg="matrix",bgm="newera",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
dropPiece=tech_check_easy,
|
||||
bg="matrix",bgm="secret8th",
|
||||
bg="matrix",bgm="newera",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
dropPiece=tech_check_hard,
|
||||
bg="matrix",bgm="secret7th",
|
||||
bg="matrix",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
dropPiece=tech_check_easy,
|
||||
bg="matrix",bgm="secret7th",
|
||||
bg="matrix",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
target=200,
|
||||
dropPiece=tech_check_hard,
|
||||
bg="matrix",bgm="newera",
|
||||
bg="matrix",bgm="way",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -15,7 +15,7 @@ return{
|
||||
drop=1e99,lock=1e99,
|
||||
target=200,
|
||||
dropPiece=tech_check_easy,
|
||||
bg="matrix",bgm="newera",
|
||||
bg="matrix",bgm="way",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -24,7 +24,7 @@ return{
|
||||
Fkey=selectTarget,
|
||||
pushSpeed=2,
|
||||
freshLimit=15,
|
||||
bg="game3",bgm="rockblock",
|
||||
bg="rainbow",bgm="rockblock",
|
||||
},
|
||||
load=function()
|
||||
royaleData={
|
||||
|
||||
@@ -20,7 +20,7 @@ return{
|
||||
end
|
||||
end
|
||||
end,
|
||||
bg="matrix",bgm="infinite",
|
||||
bg="fan",bgm="infinite",
|
||||
},
|
||||
slowMark=true,
|
||||
pauseLimit=true,
|
||||
@@ -29,10 +29,10 @@ return{
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
gc.setLineWidth(2)
|
||||
gc.rectangle("line",-95,112,32,402)
|
||||
gc.rectangle("line",-95,120,32,402)
|
||||
local T=P.stat.time/120
|
||||
gc.setColor(2*T,2-2*T,.2)
|
||||
gc.rectangle("fill",-94,513,30,(T-1)*400)
|
||||
gc.rectangle("fill",-94,521,30,(T-1)*400)
|
||||
end,
|
||||
score=function(P)return{P.stat.score}end,
|
||||
scoreDisp=function(D)return tostring(D[1])end,
|
||||
|
||||
@@ -4,7 +4,7 @@ return{
|
||||
drop=120,lock=120,
|
||||
oncehold=false,target=200,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
bg="game2",bgm="infinite",
|
||||
bg="bg2",bgm="infinite",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
|
||||
38
parts/ai.lua
38
parts/ai.lua
@@ -16,7 +16,7 @@ local Timer=love.timer.getTime
|
||||
-- 6~10:hD,sD,H,A,R,
|
||||
-- 11~13:LL,RR,DD
|
||||
local blockPos={4,4,4,4,4,5,4}
|
||||
local scs={{1,2},{1,2},{1,2},{1,2},{1,2},{1.5,1.5},{0.5,2.5}}
|
||||
local scs={{0,1},{0,1},{0,1},{0,1},{0,1},{.5,.5},{-.5,1.5}}
|
||||
-------------------------------------------------Cold clear
|
||||
local CCblockID={6,5,4,3,2,1,0}
|
||||
if system=="Windows"then
|
||||
@@ -198,7 +198,8 @@ end
|
||||
return{
|
||||
["9S"]={
|
||||
function(P,ctrl)
|
||||
local Tfield={}--test field
|
||||
local Tfield={}--Test field
|
||||
local best={x=1,dir=0,hold=false,score=-1e99}--Best method
|
||||
local field_org=P.field
|
||||
for i=1,#field_org do
|
||||
Tfield[i]=freeRow.get(0)
|
||||
@@ -206,7 +207,7 @@ return{
|
||||
Tfield[i][j]=field_org[i][j]
|
||||
end
|
||||
end
|
||||
local best={x=1,dir=0,hold=false,score=-1e99}
|
||||
|
||||
for ifhold=0,P.gameEnv.hold and 1 or 0 do
|
||||
--Get block id
|
||||
local bn
|
||||
@@ -217,13 +218,17 @@ return{
|
||||
end
|
||||
if not bn then goto CTN end
|
||||
|
||||
for dir=0,dirCount[bn] do--each dir
|
||||
for dir=0,dirCount[bn] do--Each dir
|
||||
local cb=blocks[bn][dir]
|
||||
for cx=1,11-#cb[1]do--each pos
|
||||
for cx=1,11-#cb[1]do--Each pos
|
||||
local cy=#Tfield+1
|
||||
|
||||
--Move to bottom
|
||||
while not ifoverlapAI(Tfield,cb,cx,cy-1)do
|
||||
cy=cy-1
|
||||
end--move to bottom
|
||||
end
|
||||
|
||||
--Simulate lock
|
||||
for i=1,#cb do
|
||||
local y=cy+i-1
|
||||
if not Tfield[y]then Tfield[y]=freeRow.get(0)end
|
||||
@@ -232,7 +237,7 @@ return{
|
||||
Tfield[y][cx+j-1]=1
|
||||
end
|
||||
end
|
||||
end--simulate lock
|
||||
end
|
||||
local score=getScore(Tfield,cb,cy)
|
||||
if score>best.score then
|
||||
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
|
||||
@@ -243,9 +248,11 @@ return{
|
||||
::CTN::
|
||||
end
|
||||
if not best.bn then return 1 end
|
||||
|
||||
--Release cache
|
||||
while #Tfield>0 do
|
||||
freeRow.discard(rem(Tfield,1))
|
||||
end--Release cache
|
||||
end
|
||||
local p=#ctrl+1
|
||||
if best.hold then
|
||||
ctrl[p]=8
|
||||
@@ -270,11 +277,11 @@ return{
|
||||
end,
|
||||
},
|
||||
["CC"]={
|
||||
function(P)
|
||||
function(P)--Start thinking
|
||||
BOT.think(P.AI_bot)
|
||||
return 2
|
||||
end,--start thinking
|
||||
function(P,ctrl)
|
||||
end,
|
||||
function(P,ctrl)--Poll keys
|
||||
local success,dest,hold,move=BOT.getMove(P.AI_bot)
|
||||
if success == 2 then
|
||||
ins(ctrl,6)
|
||||
@@ -298,10 +305,11 @@ return{
|
||||
ins(ctrl,6)
|
||||
return 3
|
||||
else
|
||||
return 2--stay this stage
|
||||
--Stay this stage
|
||||
return 2
|
||||
end
|
||||
end,--poll keys
|
||||
function(P)
|
||||
end,
|
||||
function(P)--Check if time to change target
|
||||
P.AI_delay=P.AI_delay0
|
||||
if Timer()-P.modeData.point>P.modeData.event then
|
||||
P.modeData.point=Timer()
|
||||
@@ -309,6 +317,6 @@ return{
|
||||
P:changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
|
||||
end
|
||||
return 1
|
||||
end,--check if time to change target
|
||||
end,
|
||||
},
|
||||
}--AI think stage
|
||||
@@ -1,25 +1,28 @@
|
||||
setting={
|
||||
--game
|
||||
--Game
|
||||
das=10,arr=2,
|
||||
sddas=0,sdarr=2,
|
||||
ihs=true,irs=true,ims=true,
|
||||
reTime=4,
|
||||
maxNext=6,
|
||||
autoPause=true,
|
||||
quickR=true,
|
||||
swap=true,
|
||||
|
||||
--System
|
||||
reTime=4,
|
||||
autoPause=true,
|
||||
fine=false,
|
||||
appLock=false,
|
||||
lang=1,
|
||||
skinSet=1,
|
||||
skin={1,5,8,2,10,3,7,1,5,1,5,8,2,10,3,7,10,7,8,2,8,2,1,5,3},
|
||||
face={},
|
||||
|
||||
--graphic
|
||||
--Graphic
|
||||
ghost=true,center=true,
|
||||
smooth=true,grid=false,
|
||||
bagLine=false,
|
||||
lockFX=2,
|
||||
dropFX=3,
|
||||
dropFX=2,
|
||||
moveFX=2,
|
||||
clearFX=2,
|
||||
shakeFX=2,
|
||||
atkFX=3,
|
||||
@@ -31,7 +34,7 @@ setting={
|
||||
bg=true,
|
||||
powerInfo=false,
|
||||
|
||||
--sound
|
||||
--Sound
|
||||
sfx=10,
|
||||
spawn=0,
|
||||
bgm=7,
|
||||
@@ -39,15 +42,15 @@ setting={
|
||||
vib=0,
|
||||
voc=0,
|
||||
|
||||
--virtualkey
|
||||
--Virtualkey
|
||||
VKSFX=3,--SFX volume
|
||||
VKVIB=0,--VIB
|
||||
VKSwitch=false,--if disp
|
||||
VKTrack=false,--if tracked
|
||||
VKDodge=false,--if dodge
|
||||
VKSwitch=false,--If disp
|
||||
VKTrack=false,--If tracked
|
||||
VKDodge=false,--If dodge
|
||||
VKTchW=3,--Touch-Pos Weight
|
||||
VKCurW=4,--Cur-Pos Weight
|
||||
VKIcon=true,--if disp icon
|
||||
VKIcon=true,--If disp icon
|
||||
VKAlpha=3,
|
||||
}
|
||||
for i=1,25 do
|
||||
@@ -64,7 +67,7 @@ stat={
|
||||
send=0,recv=0,pend=0,off=0,
|
||||
clear={},spin={},
|
||||
pc=0,hpc=0,b2b=0,b3b=0,score=0,
|
||||
lastPlay="sprint_10",--last played mode ID
|
||||
lastPlay="sprint_10",--Last played mode ID
|
||||
}
|
||||
for i=1,25 do
|
||||
stat.clear[i]={0,0,0,0,0}
|
||||
@@ -73,9 +76,9 @@ end
|
||||
|
||||
keyMap={
|
||||
{"left","right","x","z","c","up","down","space","tab","r"},{},
|
||||
--keyboard
|
||||
--Keyboard
|
||||
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder"},{},
|
||||
--joystick
|
||||
--Joystick
|
||||
}
|
||||
for i=1,#keyMap do for j=1,20 do
|
||||
if not keyMap[i][j]then keyMap[i][j]=""end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local freeRow={}
|
||||
local L={}--storage
|
||||
local _=0--lenth
|
||||
local L={}--Storage
|
||||
local _=0--Lenth
|
||||
function freeRow.reset(num)
|
||||
if num<_ then
|
||||
for i=_,num+1,-1 do
|
||||
|
||||
@@ -6,6 +6,25 @@ local sub,find=string.sub,string.find
|
||||
local char,byte=string.char,string.byte
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
local default_setting={
|
||||
"das","arr",
|
||||
"sddas","sdarr",
|
||||
"ihs","irs","ims",
|
||||
"maxNext",
|
||||
"swap",
|
||||
-- "face",
|
||||
}
|
||||
local function copyGameSetting()
|
||||
local S={face={}}
|
||||
for _,v in next,default_setting do
|
||||
S[v]=setting[v]
|
||||
end
|
||||
for i=1,25 do
|
||||
S.face[i]=setting.face[i]
|
||||
end
|
||||
return S
|
||||
end
|
||||
|
||||
function destroyPlayers()
|
||||
for i=#players,1,-1 do
|
||||
local P=players[i]
|
||||
@@ -25,7 +44,6 @@ function destroyPlayers()
|
||||
for i=#players.alive,1,-1 do
|
||||
players.alive[i]=nil
|
||||
end
|
||||
players.human=0
|
||||
collectgarbage()
|
||||
end
|
||||
|
||||
@@ -43,18 +61,22 @@ function restoreVirtualKey()
|
||||
virtualkey[9].ava=false
|
||||
end
|
||||
end
|
||||
|
||||
function copyBoard()
|
||||
local str=""
|
||||
local H=0
|
||||
|
||||
for y=20,1,-1 do
|
||||
for x=1,10 do
|
||||
if preField[y][x]~=0 then
|
||||
H=y
|
||||
goto L
|
||||
goto topFound
|
||||
end
|
||||
end
|
||||
end
|
||||
::L::
|
||||
::topFound::
|
||||
|
||||
--Encode field
|
||||
for y=1,H do
|
||||
local S=""
|
||||
local L=preField[y]
|
||||
@@ -63,38 +85,36 @@ function copyBoard()
|
||||
end
|
||||
str=str..S
|
||||
end
|
||||
love.system.setClipboardText("Techmino sketchpad:"..data.encode("string","base64",data.compress("string","deflate",str)))
|
||||
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
|
||||
return data.encode("string","base64",data.compress("string","deflate",str))
|
||||
end
|
||||
function pasteBoard()
|
||||
function pasteBoard(str)
|
||||
local _
|
||||
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
||||
|
||||
--Read data
|
||||
local str=love.system.getClipboardText()
|
||||
local p=find(str,":")--ptr*
|
||||
if p then str=sub(str,p+1)end
|
||||
--Decode
|
||||
_,str=pcall(data.decode,"string","base64",str)
|
||||
if not _ then goto ERROR end
|
||||
if not _ then return end
|
||||
_,str=pcall(data.decompress,"string","deflate",str)
|
||||
if not _ then goto ERROR end
|
||||
|
||||
p=1
|
||||
if not _ then return end
|
||||
|
||||
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
||||
local p=1
|
||||
while true do
|
||||
_=byte(str,p)--1byte
|
||||
|
||||
--Str end
|
||||
if not _ then
|
||||
if fX~=1 then
|
||||
goto ERROR
|
||||
return
|
||||
else
|
||||
fY=fY+1
|
||||
break
|
||||
end
|
||||
end--str end
|
||||
end
|
||||
|
||||
__=_%32-1--Block id
|
||||
if __>17 then return end--Illegal blockid
|
||||
_=int(_/32)--Mode id
|
||||
|
||||
__=_%32-1--block id
|
||||
if __>17 then goto ERROR end--illegal blockid
|
||||
_=int(_/32)--mode id
|
||||
preField[fY][fX]=__
|
||||
if fX<10 then
|
||||
fX=fX+1
|
||||
@@ -111,8 +131,41 @@ function pasteBoard()
|
||||
preField[y][x]=0
|
||||
end
|
||||
end
|
||||
do return end
|
||||
::ERROR::TEXT.show(text.dataCorrupted,350,360,35,"flicker",.5)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function copySequence()
|
||||
local str=""
|
||||
|
||||
for i=1,#preBag do
|
||||
str=str..char(preBag[i]-1)
|
||||
end
|
||||
|
||||
return data.encode("string","base64",data.compress("string","deflate",str))
|
||||
end
|
||||
function pasteSequence(str)
|
||||
local _
|
||||
|
||||
--Decode
|
||||
_,str=pcall(data.decode,"string","base64",str)
|
||||
if not _ then return end
|
||||
_,str=pcall(data.decompress,"string","deflate",str)
|
||||
if not _ then return end
|
||||
|
||||
local bag={}
|
||||
for i=1,#str do
|
||||
_=byte(str,i)
|
||||
if _<25 then
|
||||
bag[i]=_+1
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
preBag=bag
|
||||
sceneTemp.cur=#preBag
|
||||
return true
|
||||
end
|
||||
|
||||
function mergeStat(stat,delta)
|
||||
@@ -128,7 +181,8 @@ function mergeStat(stat,delta)
|
||||
end
|
||||
end
|
||||
end
|
||||
function randomTarget(P)
|
||||
|
||||
function randomTarget(P)--Return a random opponent for P
|
||||
if #players.alive>1 then
|
||||
local R
|
||||
repeat
|
||||
@@ -136,7 +190,7 @@ function randomTarget(P)
|
||||
until R~=P
|
||||
return R
|
||||
end
|
||||
end--return a random opponent for P
|
||||
end
|
||||
function freshMostDangerous()
|
||||
game.mostDangerous,game.secDangerous=nil
|
||||
local m,m2=0,0
|
||||
@@ -196,24 +250,27 @@ function royaleLevelup()
|
||||
local P=players.alive[i]
|
||||
P.gameEnv.drop=int(P.gameEnv.drop*.3)
|
||||
if P.gameEnv.drop==0 then
|
||||
P.curY=P.y_img
|
||||
P.curY=P.imgY
|
||||
P.gameEnv._20G=true
|
||||
if P.AI_mode=="CC"then CC_switch20G(P)end--little cheating,never mind
|
||||
if P.AI_mode=="CC"then CC_switch20G(P)end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function pauseGame()
|
||||
if not SCN.swapping then
|
||||
restartCount=0--Avoid strange darkness
|
||||
if not game.result then
|
||||
game.pauseCount=game.pauseCount+1
|
||||
end
|
||||
for i=1,#players do
|
||||
local l=players[i].keyPressing
|
||||
for j=1,#l do
|
||||
if l[j]then
|
||||
players[i]:releaseKey(j)
|
||||
if not game.replaying then
|
||||
for i=1,#players do
|
||||
local l=players[i].keyPressing
|
||||
for j=1,#l do
|
||||
if l[j]then
|
||||
players[i]:releaseKey(j)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -223,65 +280,38 @@ end
|
||||
function resumeGame()
|
||||
SCN.swapTo("play","none")
|
||||
end
|
||||
function loadGame(M)
|
||||
--rec={}
|
||||
function loadGame(M,ifQuickPlay)
|
||||
stat.lastPlay=M
|
||||
curMode=Modes[M]
|
||||
local lang=setting.lang
|
||||
drawableText.modeName:set(text.modes[M][1])
|
||||
drawableText.levelName:set(text.modes[M][2])
|
||||
needResetGameData=true
|
||||
SCN.swapTo("play","fade_togame")
|
||||
SCN.swapTo("play",ifQuickPlay and"swipe"or"fade_togame")
|
||||
SFX.play("enter")
|
||||
end
|
||||
function resetPartGameData()
|
||||
game={
|
||||
frame=150-setting.reTime*15,
|
||||
result=false,
|
||||
pauseTime=0,
|
||||
pauseCount=0,
|
||||
garbageSpeed=1,
|
||||
warnLVL0=0,
|
||||
warnLVL=0,
|
||||
}
|
||||
destroyPlayers()
|
||||
curMode.load()
|
||||
TEXT.clear()
|
||||
if modeEnv.task then
|
||||
for i=1,#players do
|
||||
players[i]:newTask(modeEnv.task)
|
||||
end
|
||||
end
|
||||
if modeEnv.royaleMode then
|
||||
for i=1,#players do
|
||||
players[i]:changeAtk(randomTarget(players[i]))
|
||||
end
|
||||
end
|
||||
BG.set(modeEnv.bg)
|
||||
BGM.play(modeEnv.bgm)
|
||||
if modeEnv.royaleMode then
|
||||
for i=1,#players do
|
||||
players[i]:changeAtk(randomTarget(players[i]))
|
||||
end
|
||||
game.stage=1
|
||||
game.garbageSpeed=.3
|
||||
end
|
||||
restoreVirtualKey()
|
||||
collectgarbage()
|
||||
end
|
||||
function resetGameData()
|
||||
game={
|
||||
frame=150-setting.reTime*15,
|
||||
result=false,
|
||||
pauseTime=0,--Time paused
|
||||
pauseCount=0,--Pausing count
|
||||
garbageSpeed=1,--garbage timing speed
|
||||
warnLVL0=0,
|
||||
warnLVL=0,
|
||||
}
|
||||
if players[1]and not game.replaying then
|
||||
mergeStat(stat,players[1].stat)
|
||||
end
|
||||
|
||||
game.frame=150-setting.reTime*15
|
||||
game.result=false
|
||||
game.pauseTime=0
|
||||
game.pauseCount=0
|
||||
game.garbageSpeed=1
|
||||
game.warnLVL0=0
|
||||
game.warnLVL=0
|
||||
game.recording=true
|
||||
game.replaying=false
|
||||
game.setting=copyGameSetting()
|
||||
game.rec={}
|
||||
math.randomseed(tm.getTime())
|
||||
game.seed=rnd(261046101471026)
|
||||
|
||||
destroyPlayers()
|
||||
modeEnv=curMode.env
|
||||
curMode.load()--bg/bgm need redefine in custom,so up here
|
||||
curMode.load()--BG/BGM need redefine in custom,so up here
|
||||
if modeEnv.task then
|
||||
for i=1,#players do
|
||||
players[i]:newTask(modeEnv.task)
|
||||
@@ -306,12 +336,59 @@ function resetGameData()
|
||||
SFX.play("ready")
|
||||
collectgarbage()
|
||||
end
|
||||
function resetPartGameData(replaying)
|
||||
if players[1]and not game.replaying then
|
||||
mergeStat(stat,players[1].stat)
|
||||
end
|
||||
|
||||
game.result=false
|
||||
game.garbageSpeed=1
|
||||
game.warnLVL0=0
|
||||
game.warnLVL=0
|
||||
if replaying then
|
||||
game.frame=0
|
||||
game.recording=false
|
||||
game.replaying=1
|
||||
else
|
||||
game.frame=150-setting.reTime*15
|
||||
game.pauseTime=0
|
||||
game.pauseCount=0
|
||||
game.recording=true
|
||||
game.replaying=false
|
||||
game.setting=copyGameSetting()
|
||||
game.rec={}
|
||||
math.randomseed(tm.getTime())
|
||||
game.seed=rnd(1046101471,2662622626)
|
||||
end
|
||||
|
||||
destroyPlayers()
|
||||
modeEnv=curMode.env
|
||||
curMode.load()
|
||||
if modeEnv.task then
|
||||
for i=1,#players do
|
||||
players[i]:newTask(modeEnv.task)
|
||||
end
|
||||
end
|
||||
BG.set(modeEnv.bg)
|
||||
BGM.play(modeEnv.bgm)
|
||||
|
||||
TEXT.clear()
|
||||
if modeEnv.royaleMode then
|
||||
for i=1,#players do
|
||||
players[i]:changeAtk(randomTarget(players[i]))
|
||||
end
|
||||
game.stage=1
|
||||
game.garbageSpeed=.3
|
||||
end
|
||||
restoreVirtualKey()
|
||||
collectgarbage()
|
||||
end
|
||||
function gameStart()
|
||||
SFX.play("start")
|
||||
for P=1,#players do
|
||||
P=players[P]
|
||||
P:popNext()
|
||||
P.timing=true
|
||||
P.control=true
|
||||
P.timing=true
|
||||
P:popNext()
|
||||
end
|
||||
end
|
||||
111
parts/getTip.lua
111
parts/getTip.lua
@@ -4,6 +4,7 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"ZS JL T O I",
|
||||
"VVVVVV好玩!",
|
||||
"uid:225238922",
|
||||
"tetralegends也很好玩!",
|
||||
"tetr.js也很好玩!",
|
||||
"tetr.io也很好玩!",
|
||||
"Techminohaowan",
|
||||
@@ -13,9 +14,9 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"osu好玩!",
|
||||
"O spin Triple!",
|
||||
"nullpomino也很好玩!",
|
||||
"Naki 可爱",
|
||||
"Miya:喵!",
|
||||
"Naki 可爱!",
|
||||
"Miya 可爱!",
|
||||
"Lua天下第一",
|
||||
"LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF",
|
||||
"Let-The-Bass-Kick!",
|
||||
"l-=-1",
|
||||
@@ -27,7 +28,6 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"DT炮=TSD+TST炮",
|
||||
"Cultris II也很好玩!",
|
||||
"COOL!!",
|
||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||
"BT炮=beta炮",
|
||||
"B2B2B2B存在吗?",
|
||||
"B2B2B???",
|
||||
@@ -36,9 +36,9 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"注意到\"旋转\"到底对方块做了些什么吗?",
|
||||
"有疑问? 先看设置有没有你想要的",
|
||||
"有建议的话可以把信息反馈给作者~",
|
||||
"音乐都是瞎写的,觉得不好听就把BGM关了罢",
|
||||
"学会使用两个旋转键, 三个更好",
|
||||
"享受特色旋转系统!",
|
||||
"新人请千万记住,打好基础,不要太早学那些花里胡哨的",
|
||||
"享受Tech的特色旋转系统!",
|
||||
"无聊翻翻设置是好习惯",
|
||||
"我的世界好玩!",
|
||||
"提前旋转等设置可以用来救命",
|
||||
@@ -48,16 +48,21 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"少女祈祷中",
|
||||
"扫雷好玩!",
|
||||
"哦,我的上帝",
|
||||
"你可以长按R键重新开始游戏(也不是很长)",
|
||||
"你可以从统计页面打开游戏存档目录",
|
||||
"你好 世界!",
|
||||
"魔方好玩!",
|
||||
"喵!",
|
||||
"免费吃鸡方块",
|
||||
"秘密数字:626",
|
||||
"每个虚拟按键都可以隐藏/显示",
|
||||
"每个块的出现方向可以自定义",
|
||||
"没专业美术,程序员审美警告",
|
||||
"没学过编曲,音乐都是自己凭感觉写的,觉得不好听就设置里关了吧",
|
||||
"联网还没做呢, 别急",
|
||||
"键位是可以自定义的",
|
||||
"健康小贴士:上厕所太用力容易脑出血(尤其是老年人!)",
|
||||
"健康小贴士:不要熬夜,真的容易猝死",
|
||||
"合群了就会消失, 但是消失不代表没有意义",
|
||||
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
|
||||
"俄罗斯方块环游记也不错!",
|
||||
@@ -65,8 +70,8 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"低帧率会降低游戏体验",
|
||||
"戴上耳机以获得最佳体验",
|
||||
"大满贯10连击消四全清!",
|
||||
"车车人在此",
|
||||
"茶娘可爱",
|
||||
"打好块没有捷径,多练",
|
||||
"茶娘 可爱!",
|
||||
"草(日本语)",
|
||||
"不要在上课时玩游戏!",
|
||||
"不要盯着bug不放",
|
||||
@@ -75,6 +80,7 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"别问游戏名怎么取的,问就是随便想的",
|
||||
"本游戏难度上限很高, 做好心理准备",
|
||||
"本游戏可不是休闲游戏",
|
||||
"报时机器人:新的一天开始了",
|
||||
"626r/s",
|
||||
"40行世界纪录:15.654s",
|
||||
"4+4+4+4+2+2+1=17",
|
||||
@@ -86,10 +92,12 @@ if setting.lang==1 or setting.lang==2 then
|
||||
"2.7182818284590452353",
|
||||
"15puzzle好玩!",
|
||||
"11renPC!",
|
||||
"100行内23PC来一个?",
|
||||
"1, 2, 9!!!!!",
|
||||
"<方块研究所>有一个Nspire-CX版本!",
|
||||
"↑↑↓↓←→←→BABA",
|
||||
"(RUR'U')R'FR2U'R'U'(RUR'F')",
|
||||
-- "Z酱 可爱!",
|
||||
}
|
||||
elseif setting.lang==3 then
|
||||
L={
|
||||
@@ -106,6 +114,7 @@ elseif setting.lang==3 then
|
||||
"This in not a casual game",
|
||||
"This game can be very hard,be mentally perpared",
|
||||
"Tetris journey has network battle!",
|
||||
"Tetralegends is fun!",
|
||||
"Terraria is fun!",
|
||||
"Techmino=Technique+Tetromino",
|
||||
"Techmino is so fun!",
|
||||
@@ -117,7 +126,7 @@ elseif setting.lang==3 then
|
||||
"REGRET!!",
|
||||
"Powered by love2d",
|
||||
"Playing too much = taking drugs",
|
||||
"osu is fun!",
|
||||
"OSU is fun!",
|
||||
"Only offline game now",
|
||||
"OHHHHHHHHHHHHHH",
|
||||
"O spin triple!",
|
||||
@@ -127,13 +136,14 @@ elseif setting.lang==3 then
|
||||
"Miya so cute!",
|
||||
"Minesweeper is fun!",
|
||||
"Minecraft is fun!",
|
||||
"Lua No.1",
|
||||
"LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF",
|
||||
"lower fps causes lower game experience",
|
||||
"Lower fps causes lower game experience",
|
||||
"Let-The-Bass-Kick!",
|
||||
"l-=-1",
|
||||
"Is B2B2B2B possible?",
|
||||
"Initial Rotation etc. can save your life",
|
||||
"iced so bully",
|
||||
"Hold R key to restart game",
|
||||
"Hello world!",
|
||||
"Headphones for better experience",
|
||||
"Have you noticed what does \"rotating\" do to block?",
|
||||
@@ -146,10 +156,9 @@ elseif setting.lang==3 then
|
||||
"DO NOT PRESS F10",
|
||||
"Do not play game in class!",
|
||||
"Disappearing doesn't mean useless",
|
||||
"diao so bully",
|
||||
"Diao so bully",
|
||||
"COOL!!",
|
||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||
"BT cannon=beta",
|
||||
"BT cannon=beta cannon",
|
||||
"Back to Back 10 combo Techrash PC!",
|
||||
"B2B2B???",
|
||||
"Any suggestions to author!",
|
||||
@@ -157,9 +166,9 @@ elseif setting.lang==3 then
|
||||
"Also try VVVVVV!",
|
||||
"Also try Tetr.js!",
|
||||
"Also try Tetr.io!",
|
||||
"Also try Nullpomino!",
|
||||
"Also try Jstris!",
|
||||
"Also try Cultris II!",
|
||||
"Also try Bullpomino!",
|
||||
"ALLSPIN!",
|
||||
"少女祈禱中",
|
||||
"40L WR: 15.654s",
|
||||
@@ -186,5 +195,79 @@ elseif setting.lang==4 then
|
||||
s=s..L[math.random(#L)]
|
||||
end
|
||||
return s
|
||||
elseif setting.lang==5 then
|
||||
local R=math.random()
|
||||
if R<.05 then
|
||||
local time={
|
||||
--[[00]]"大半夜的在这干啥呢?不睡觉是会猝死的",
|
||||
--[[01]]"大半夜的在这干啥呢?不睡觉是会猝死的",
|
||||
--[[02]]"现在打块你是认真的?",
|
||||
--[[03]]"现在打块你是认真的?",
|
||||
--[[04]]"早起是好的,但是你不应该打块",
|
||||
--[[05]]"早起是好的,但是你不应该打块",
|
||||
--[[06]]"早饭吃好了?",
|
||||
--[[07]]"早饭吃好了?",
|
||||
--[[08]]"九点多了,没自己的事情要做?",
|
||||
--[[09]]"十点多了,没自己的事情要做?",
|
||||
--[[10]]"十一点多了,午饭有的吃么",
|
||||
--[[11]]"十二点多了,午饭有的吃么",
|
||||
--[[12]]"累了累了,现在不想说你",
|
||||
--[[13]]"累了累了,现在不想说你",
|
||||
--[[14]]"累了累了,现在不想说你",
|
||||
--[[15]]"累了累了,现在不想说你",
|
||||
--[[16]]"累了累了,现在不想说你",
|
||||
--[[17]]"晚饭吃好了?",
|
||||
--[[18]]"晚饭吃好了?",
|
||||
--[[19]]"累了累了,现在不想说你",
|
||||
--[[20]]"累了累了,现在不想说你",
|
||||
--[[21]]"好睡了,作息健康活得久",
|
||||
--[[22]]"好睡了,作息健康活得久",
|
||||
--[[23]]"大半夜的在这干啥呢?不睡觉是会猝死的",
|
||||
}
|
||||
return time[tonumber(os.date("%H"))+1]
|
||||
elseif R<.1 then
|
||||
local int=math.floor
|
||||
L={
|
||||
"平均"..int(stat.row/stat.time*60).."LPM,那可真强呢",
|
||||
"平均"..int(stat.atk/stat.time*60).."APM,好厉害哦",
|
||||
"平均"..(int(stat.atk/stat.row*10)*.1).."效,你看这数据能看么",
|
||||
"平均"..(int(stat.atk/stat.row*10)*.1).."效,我就不说你多菜了",
|
||||
"才玩"..stat.game.."把,跟几十万局的没法比",
|
||||
"才玩"..stat.game.."把,玩了不下几万局的人可不在少数",
|
||||
"才玩了"..int(stat.time/3600).."小时,人家总时长是你不知道多少倍",
|
||||
"才玩了"..int(stat.time/3600).."小时,别人总时长跟你都不在一个数量级",
|
||||
}
|
||||
else
|
||||
L={
|
||||
"Diao?上次被我c4w秒了的那人?",
|
||||
"隐形难吗?那个节目上的谁,水平那么菜也打得还行,就是你菜",
|
||||
"一口一个wtcl还不赶紧去练,你是不思进取还是不想好好说话?",
|
||||
"我一个滑铲就挖了个11renPC",
|
||||
"我曾经在极度愤怒的时候15秒消了40行",
|
||||
"天天F3F3,怕别人不知道你菜?",
|
||||
"天天卖弱,你一定把把150apm吧?",
|
||||
"天天催更催更,你咋不来帮忙开发啊,真以为作者很强催催啥都有?",
|
||||
"设置都看过一遍了吗?明明都能调还嫌这嫌那,可牛逼了您",
|
||||
"少玩点,多眨眼,到时候瞎了别怪我没提醒你",
|
||||
"人只用一只手都能玩,你呢?",
|
||||
"没那水平别天天整什么花里胡哨的,人玩几年你想几天赶上?",
|
||||
"满口PCDT信天翁,还会点别的么?",
|
||||
"叫你多练消四不听,现在要速度没速度,spin打完地形一塌糊涂,开心了?",
|
||||
"叫你多练就多练,想着几天变神仙,当自己是谁?",
|
||||
"还搁这玩手机呢,作业做完了?",
|
||||
"除了雨宫太阳你还认识谁?Jonas知道吗?Ajanba听过吗?",
|
||||
"不会吧不会吧,真的还有人不能随手Tspin?",
|
||||
"别会个c4w就以为自己多强,这是基本功罢了",
|
||||
"60lpm?拍硬降刷的吧",
|
||||
"4pps不是人均水平?",
|
||||
"40行还要40多秒,就这?",
|
||||
"20G很难?是个人都能玩吧",
|
||||
"20连pc不是随手?",
|
||||
"100apm?定式刷的吧",
|
||||
"0202年了,还在玩这种小孩子玩的游戏?",
|
||||
"极限20G?那不是随手通",
|
||||
"全隐40行全消四很难吗??",
|
||||
}
|
||||
end
|
||||
end
|
||||
return L[math.random(#L)]
|
||||
@@ -4,7 +4,7 @@ local ZERO={[01]=Zero,[10]=Zero,[03]=Zero,[30]=Zero,[12]=Zero,[21]=Zero,[32]=Zer
|
||||
|
||||
local map={}
|
||||
for x=-3,3 do map[x]={}for y=-3,3 do map[x][y]={x,y}end end
|
||||
local function collect(T)--make all vec point to the same vec
|
||||
local function collect(T)--Make all vec point to the same vec
|
||||
if type(T)=="table"then
|
||||
for _,T in next,T do
|
||||
for k,vec in next,T do
|
||||
@@ -14,11 +14,11 @@ local function collect(T)--make all vec point to the same vec
|
||||
end
|
||||
end
|
||||
|
||||
local function C_sym(L)--use this if the block is centrosymmetry, *PTR!!!
|
||||
local function C_sym(L)--Use this if the block is centrosymmetry, *PTR!!!
|
||||
L[23]=L[01]L[32]=L[10]
|
||||
L[21]=L[03]L[12]=L[30]
|
||||
end
|
||||
local function flipList(O)--use this to copy a symmetry list
|
||||
local function flipList(O)--Use this to copy a symmetry list
|
||||
if not O then return end
|
||||
local L={}
|
||||
for i=1,#O do
|
||||
@@ -84,14 +84,14 @@ local TRS={
|
||||
},--Z
|
||||
{},--S
|
||||
{
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-2},{ 1, 1}},
|
||||
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2}},
|
||||
[01]={{-1, 0},{-1, 1},{ 1, 0},{ 0,-2},{ 1, 1}},
|
||||
[10]={{ 1, 0},{ 1,-1},{-1, 0},{ 0, 2},{ 1, 2}},
|
||||
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 1,-1},{ 0, 1}},
|
||||
[30]={{-1, 0},{-1,-1},{ 0, 2},{-1, 2},{ 0,-1},{-1, 1}},
|
||||
[12]={{ 1, 0},{ 1,-1},{ 1, 1},{-1, 0},{ 0,-1},{ 0, 2},{ 1, 2}},
|
||||
[21]={{-1, 0},{-1, 1},{ 1, 0},{ 0,-2},{-1,-2}},
|
||||
[32]={{-1, 0},{-1,-1},{ 0, 2},{-1, 2},{-1, 1}},
|
||||
[23]={{ 1, 0},{ 1,-1},{ 1, 1},{ 0,-2},{ 1,-2}},
|
||||
[21]={{-1, 0},{-1, 1},{-1,-1},{ 1, 0},{ 0, 1},{ 0,-2},{-1,-2}},
|
||||
[32]={{-1, 0},{-1,-1},{ 1, 0},{ 0, 2},{-1, 2},{-1, 1}},
|
||||
[23]={{ 1, 0},{ 1,-1},{-1, 0},{ 1, 1},{ 0,-2},{ 1,-2}},
|
||||
[02]={{-1, 0},{ 1, 0},{ 0,-1},{ 0, 1}},
|
||||
[20]={{ 1, 0},{-1, 0},{ 0, 1},{ 0,-1}},
|
||||
[13]={{ 0,-1},{ 0, 1},{ 1, 0}},
|
||||
@@ -99,14 +99,14 @@ local TRS={
|
||||
},--J
|
||||
{},--L
|
||||
{
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{-1,-1}},
|
||||
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 0,-1},{ 1, 1}},
|
||||
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2}},
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{ 0, 1}},
|
||||
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 0,-1}},
|
||||
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 0, 1}},
|
||||
[30]={{-1, 0},{-1,-1},{ 0, 2},{-1, 2},{ 0,-1}},
|
||||
[12]={{ 1, 0},{ 1,-1},{ 0,-1},{-1,-1},{ 0, 2},{ 1, 2}},
|
||||
[21]={{-1, 0},{ 0,-2},{-1,-2},{ 1, 1}},
|
||||
[21]={{-1, 0},{ 0,-2},{-1,-2},{ 1, 1},{ 1, 0}},
|
||||
[32]={{-1, 0},{-1,-1},{ 0,-1},{ 1,-1},{ 0, 2},{-1, 2}},
|
||||
[23]={{ 1, 0},{ 0,-2},{ 1,-2},{-1, 1}},
|
||||
[23]={{ 1, 0},{ 0,-2},{ 1,-2},{-1, 1},{-1, 0}},
|
||||
[02]={{-1, 0},{ 1, 0},{ 0, 1}},
|
||||
[20]={{ 1, 0},{-1, 0},{ 0,-1}},
|
||||
[13]={{ 0,-1},{ 0, 1},{ 1, 0},{ 0,-2},{ 0, 2}},
|
||||
@@ -114,10 +114,9 @@ local TRS={
|
||||
},--T
|
||||
function(P,d)
|
||||
if P.human then SFX.fieldPlay("rotate",nil,P)end
|
||||
if P.gameEnv.easyFresh then P:freshLockDelay()end
|
||||
if not P.gameEnv.ospin then return end
|
||||
local x,y=P.curX,P.curY
|
||||
if y==P.y_img and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
|
||||
if y==P.imgY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
|
||||
local D=P.spinSeq%100*10+d
|
||||
P.spinSeq=D
|
||||
if D<100 then return end
|
||||
@@ -136,7 +135,7 @@ local TRS={
|
||||
P.dir,P.sc=dir,scs[id][dir]
|
||||
P.spinLast=2
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
P:freshgho()
|
||||
P:freshBlock(false,true)
|
||||
P.spinSeq=0
|
||||
SFX.fieldPlay("rotatekick",nil,P)
|
||||
return
|
||||
@@ -146,16 +145,17 @@ local TRS={
|
||||
else
|
||||
P.spinSeq=0
|
||||
end
|
||||
P:freshBlock(true,true)
|
||||
end,--O
|
||||
{
|
||||
[01]={{ 0, 1},{ 1, 0},{-2, 0},{-2,-1},{ 1, 2}},
|
||||
[10]={{ 2, 0},{-1, 0},{-1,-2},{ 2, 1},{ 0, 2}},
|
||||
[10]={{ 2, 0},{-1, 0},{-1,-2},{ 2, 1},{ 0, 1}},
|
||||
[03]={{ 0, 1},{-1, 0},{ 2, 0},{ 2,-1},{-1, 2}},
|
||||
[30]={{-2, 0},{ 1, 0},{ 1,-2},{-2, 1},{ 0, 2}},
|
||||
[12]={{-1, 0},{ 2, 0},{ 0,-1},{-1, 2},{ 2,-1}},
|
||||
[21]={{-2, 0},{ 1, 0},{ 0, 1},{ 1,-2},{-2, 1}},
|
||||
[32]={{ 1, 0},{-2, 0},{ 0,-1},{ 1, 2},{-2,-1}},
|
||||
[23]={{ 2, 0},{-1, 0},{ 0, 1},{-1,-2},{ 2, 1}},
|
||||
[30]={{-2, 0},{ 1, 0},{ 1,-2},{-2, 1},{ 0, 1}},
|
||||
[12]={{-1, 0},{ 2, 0},{ 2,-1},{ 0,-1},{-1, 2}},
|
||||
[21]={{-2, 0},{ 1, 0},{ 1,-2},{-2, 1},{ 0, 1}},
|
||||
[32]={{ 1, 0},{-2, 0},{-2,-1},{ 0,-1},{ 1, 2}},
|
||||
[23]={{ 2, 0},{-1, 0},{-1,-2},{ 2, 1},{ 0, 1}},
|
||||
[02]={{-1, 0},{ 1, 0},{ 0,-1},{ 0, 1}},
|
||||
[20]={{ 1, 0},{-1, 0},{ 0, 1},{ 0,-1}},
|
||||
[13]={{ 0,-1},{-1, 0},{ 1, 0},{ 0, 1}},
|
||||
@@ -186,23 +186,23 @@ local TRS={
|
||||
{
|
||||
[01]={{-1, 0},{ 1, 0},{-1, 1},{ 0,-2},{ 0,-3}},
|
||||
[10]={{ 1, 0},{ 1,-1},{-1, 0},{ 0, 2},{ 0, 3}},
|
||||
[03]={{ 1, 0},{ 1,-1}, { 0, 1},{ 0,-2},{ 0,-3}},
|
||||
[30]={{-1, 0},{-1, 1},{ 1, 0},{ 0,-1},{ 0, 2},{ 0, 3}},
|
||||
[03]={{ 1, 0},{ 1,-1},{ 0, 1},{ 0,-2},{ 0,-3}},
|
||||
[30]={{-1, 1},{ 1, 0},{ 0,-1},{ 0, 2},{ 0, 3}},
|
||||
[12]={{ 1, 0},{ 0,-1},{-1, 0},{ 0, 2}},
|
||||
[21]={{-1, 0},{ 0, 1},{ 1, 0},{ 0,-2}},
|
||||
[32]={{-1, 0},{-1, 1},{ 0, 1},{ 0,-1},{ 1, 0},{ 0, 2},{-2, 0}},
|
||||
[23]={{ 1, 0},{ 1,-1},{ 0,-1},{ 0, 1},{-1, 0},{ 0,-2},{ 2, 0}},
|
||||
[02]={{ 1, 0},{-1, 0},{ 0, 1}},
|
||||
[20]={{-1, 0},{ 1, 0},{ 0,-1}},
|
||||
[13]={{ 0,-1},{ 1, 0},{ 0, 1}},
|
||||
[31]={{ 0,-1},{-1, 0},{ 0, 1}},
|
||||
[32]={{-1, 0},{ 0, 1},{-1, 1},{ 1, 0},{ 0, 2},{-2, 0}},
|
||||
[23]={{ 1, 0},{ 1,-1},{ 0,-1},{-1, 0},{ 0,-2},{ 2, 0}},
|
||||
[02]={{ 1, 0},{-1, 0},{-1,-1}},
|
||||
[20]={{-1, 0},{ 1, 0},{ 1, 1}},
|
||||
[13]={{ 0,-1},{-1, 1},{ 0, 1}},
|
||||
[31]={{ 0,-1},{ 1,-1},{ 0, 1}},
|
||||
},--F
|
||||
{},--E
|
||||
{
|
||||
[01]={{ 0,-1},{-1,-1},{ 1,-1},{ 1, 0},{ 1,-3},{-1, 0},{ 0, 2},{-1, 2}},
|
||||
[10]={{ 1, 0},{ 0,-1},{-1,-1},{ 0,-2},{ 0,-3},{ 1,-2},{ 0, 1}},
|
||||
[01]={{ 0,-1},{-1,-1},{ 1, 1},{ 1, 0},{ 1,-3},{-1, 0},{ 0, 2},{-1, 2}},
|
||||
[10]={{ 1, 0},{ 0,-1},{-1,-1},{ 0,-2},{-1, 1},{ 0,-3},{ 1,-2},{ 0, 1}},
|
||||
[03]={{ 0,-1},{ 1,-1},{-1,-1},{-1, 0},{-1,-3},{ 1, 0},{ 0, 2},{ 1, 2}},
|
||||
[30]={{-1, 0},{ 0,-1},{ 1,-1},{ 0,-2},{ 0,-3},{-1,-2},{ 0, 1}},
|
||||
[30]={{-1, 0},{ 0,-1},{ 1,-1},{ 0,-2},{ 1, 1},{ 0,-3},{-1,-2},{ 0, 1}},
|
||||
[12]={{ 1, 0},{-1, 0},{ 0,-2},{ 0,-3},{ 0, 1},{-1, 1}},
|
||||
[21]={{ 1,-1},{-1, 0},{ 1, 0},{ 0,-1},{ 0, 2},{ 0, 3}},
|
||||
[32]={{-1, 0},{ 1, 0},{ 0,-2},{ 0,-3},{ 0, 1},{ 1, 1}},
|
||||
@@ -213,10 +213,10 @@ local TRS={
|
||||
[31]={{-1, 0},{ 1, 1},{ 2, 0}},
|
||||
},--T5
|
||||
{
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-1},{-1,-2}},
|
||||
[10]={{ 1, 0},{ 1,-1}},
|
||||
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-1},{ 1,-2}},
|
||||
[30]={{-1, 0},{-1,-1}},
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{-1,-3}},
|
||||
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 1, 3}},
|
||||
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 1,-3}},
|
||||
[30]={{-1, 0},{-1,-1},{ 0,-2},{-1, 2},{-1, 3}},
|
||||
[12]={{ 1, 0},{ 1,-1},{ 1, 1}},
|
||||
[21]={{-1,-1},{-1, 1},{-1,-1}},
|
||||
[32]={{-1, 0},{-1,-1},{-1, 1}},
|
||||
@@ -256,18 +256,18 @@ local TRS={
|
||||
},--W
|
||||
function(P,d)
|
||||
if P.human then SFX.fieldPlay("rotate",nil,P)end
|
||||
if P.gameEnv.easyFresh then P:freshLockDelay()end
|
||||
local iki=XspinList[d]
|
||||
for test=1,#iki do
|
||||
local x,y=P.curX+iki[test][1],P.curY+iki[test][2]
|
||||
if not P:ifoverlap(P.cur.bk,x,y)then
|
||||
P.curX,P.curY=x,y
|
||||
P.spinLast=1
|
||||
P:freshgho()
|
||||
P:freshBlock(false,true)
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
return
|
||||
end
|
||||
end
|
||||
P:freshBlock(true,true)
|
||||
end,--X
|
||||
{
|
||||
[01]={{-1, 0},{-1, 1},{ 0,-3},{-1, 1},{-1, 2},{ 0, 1}},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local sin,cos=math.sin,math.cos
|
||||
snapLevelValue={1,10,20,40,60,80}
|
||||
title={
|
||||
{
|
||||
@@ -114,6 +115,12 @@ title={
|
||||
5878, 463,
|
||||
},
|
||||
}
|
||||
for _,C in next,title do
|
||||
for i=1,#C do
|
||||
C[i]=C[i]*.1626
|
||||
end
|
||||
end
|
||||
--[[
|
||||
title2={}
|
||||
for i=1,#title do title2[i]=title[i]end
|
||||
title2[5]={
|
||||
@@ -140,12 +147,22 @@ title2[5]={
|
||||
3001, 1280,
|
||||
2779, 1280,
|
||||
}
|
||||
|
||||
for _,C in next,title do
|
||||
for i=1,#C do
|
||||
C[i]=C[i]*.1626
|
||||
]]
|
||||
title_fan={}
|
||||
for i=1,8 do
|
||||
local L={}
|
||||
title_fan[i]=L
|
||||
for j=1,#title[i]do
|
||||
L[j]=title[i][j]
|
||||
end
|
||||
for j=1,#L,2 do
|
||||
local x,y=L[j],L[j+1]--0<x<3041, 290<y<1280
|
||||
x,y=-(x+240+y*.3)*.002,(y-580)*.9
|
||||
x,y=y*cos(x),-y*sin(x)--Rec-Pol-Rec
|
||||
L[j],L[j+1]=x,y+300
|
||||
end
|
||||
end
|
||||
|
||||
customID={
|
||||
"drop","lock",
|
||||
"wait","fall",
|
||||
@@ -168,7 +185,7 @@ customRange={
|
||||
target={10,20,40,100,200,500,1000,1e99},
|
||||
freshLimit={0,8,15,1e99},
|
||||
opponent={0,1,2,3,4,5,11,12,13,14,15,16},
|
||||
bg={"none","game1","game2","game3","aura","rgb","glow","matrix"},
|
||||
bg={"none","bg1","bg2","rainbow","aura","rgb","glow","matrix"},
|
||||
bgm={"blank","way","race","newera","push","reason","infinite","secret7th","secret8th","rockblock"},
|
||||
}
|
||||
local function T(s,t)return love.graphics.newText(setFont(s),t)end
|
||||
@@ -189,20 +206,17 @@ drawableText={
|
||||
mxcmb=T(20,"Max Combo"),
|
||||
pc=T(20,"Perfect Clear"),
|
||||
ko=T(25,"KO"),
|
||||
D=T(100,"D"),
|
||||
C=T(100,"C"),
|
||||
B=T(100,"B"),
|
||||
A=T(100,"A"),
|
||||
S=T(100,"S"),
|
||||
D=T(100,"D"),C=T(100,"C"),B=T(100,"B"),A=T(100,"A"),S=T(100,"S"),
|
||||
|
||||
|
||||
modeName=T(30),levelName=T(30),
|
||||
|
||||
|
||||
anykey=T(40),
|
||||
replaying=T(20),
|
||||
next=T(40),hold=T(40),
|
||||
win=T(120),finish=T(120),
|
||||
lose=T(120),pause=T(120),
|
||||
gameover=T(100),pause=T(120),
|
||||
|
||||
custom=T(80),sequence=T(80),
|
||||
setting_game=T(80),setting_video=T(80),setting_sound=T(80),
|
||||
@@ -210,9 +224,7 @@ drawableText={
|
||||
preview=T(40),
|
||||
keyboard=T(25),joystick=T(25),
|
||||
ctrlSetHelp=T(30),
|
||||
musicRoom=T(80),
|
||||
nowPlaying=T(50),
|
||||
musicRoom=T(80),nowPlaying=T(50),
|
||||
VKTchW=T(30),VKOrgW=T(30),VKCurW=T(30),
|
||||
noScore=T(45),
|
||||
highScore=T(30),
|
||||
noScore=T(45),highScore=T(30),
|
||||
}
|
||||
@@ -27,8 +27,8 @@ return{
|
||||
{name="round_4", x=-900, y=-800, size=35,shape=1,icon="round", unlock={"round_5"}},
|
||||
{name="round_5", x=-1100, y=-800, size=35,shape=1,icon="round", unlock={}},
|
||||
|
||||
{name="master_beginner", x=0, y=-1000, size=35,shape=1,icon="master", unlock={"master_adavnce"}},
|
||||
{name="master_adavnce", x=0, y=-1200, size=35,shape=1,icon="master", unlock={"master_final","GM"}},
|
||||
{name="master_beginner", x=0, y=-1000, size=35,shape=1,icon="master", unlock={"master_advance"}},
|
||||
{name="master_advance", x=0, y=-1200, size=35,shape=1,icon="master", unlock={"master_final","GM"}},
|
||||
{name="master_final", x=0, y=-1400, size=40,shape=2,icon="master", unlock={}},
|
||||
{name="GM", x=150, y=-1500, size=35,shape=1,icon="master", unlock={}},
|
||||
|
||||
@@ -82,5 +82,5 @@ return{
|
||||
{name="infinite_dig", x=-1000, y=-600, size=35,shape=1,icon="infinite_dig",unlock={}},
|
||||
{name="custom_clear", x=200, y=-350, size=45,shape=3,icon="custom", unlock={}},
|
||||
{name="custom_puzzle", x=200, y=-200, size=45,shape=3,icon="puzzle", unlock={}},
|
||||
{name="sprintPenta", x=-200, y=-200, size=45,shape=3,icon="sprint", unlock={}},
|
||||
{name="sprintPenta", x=-200, y=-200, size=50,shape=2,icon="sprint", unlock={}},
|
||||
}
|
||||
1001
parts/player.lua
1001
parts/player.lua
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,8 @@ local list={
|
||||
"paper(mrz)",
|
||||
"classic(_)",
|
||||
"brick(notypey)",
|
||||
"retro(notypey)",
|
||||
"retro_grey(notypey)",
|
||||
"text_bone(mrz)",
|
||||
"colored_bone(mrz)",
|
||||
"white_bone(mrz)",
|
||||
@@ -97,33 +99,33 @@ function SKIN.load()
|
||||
gc.pop()
|
||||
end
|
||||
local L=#list
|
||||
function SKIN.prevSet()--prev skin_set
|
||||
function SKIN.prevSet()--Prev skin_set
|
||||
local _=(setting.skinSet-2)%L+1
|
||||
setting.skinSet=_
|
||||
SKIN.change(_)
|
||||
_=list[_]
|
||||
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
||||
end
|
||||
function SKIN.nextSet()--next skin_set
|
||||
function SKIN.nextSet()--Next skin_set
|
||||
local _=setting.skinSet%L+1
|
||||
setting.skinSet=_
|
||||
SKIN.change(_)
|
||||
_=list[_]
|
||||
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
||||
end
|
||||
function SKIN.prev(i)--prev skin for [i]
|
||||
function SKIN.prev(i)--Prev skin for [i]
|
||||
local _=setting.skin
|
||||
_[i]=(_[i]-2)%11+1
|
||||
end
|
||||
function SKIN.next(i)--next skin for [i]
|
||||
function SKIN.next(i)--Next skin for [i]
|
||||
local _=setting.skin
|
||||
_[i]=_[i]%11+1
|
||||
end
|
||||
function SKIN.rotate(i)--change direction of [i]
|
||||
function SKIN.rotate(i)--Change direction of [i]
|
||||
setting.face[i]=(setting.face[i]+1)%4
|
||||
SFX.play("rotate")
|
||||
end
|
||||
function SKIN.change(i)--change to skin_set[i]
|
||||
function SKIN.change(i)--Change to skin_set[i]
|
||||
blockSkin=SKIN.lib[i]
|
||||
blockSkinMini=SKIN.libMini[i]
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user