Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d74d980e9 | ||
|
|
25fe724bf8 | ||
|
|
8b1e406c42 | ||
|
|
6ced348734 | ||
|
|
858e320434 | ||
|
|
7773fca23a | ||
|
|
5a5c843ed9 | ||
|
|
798f691b4c | ||
|
|
1cbd9e717a | ||
|
|
4b010e29b8 | ||
|
|
19ea11ffc2 | ||
|
|
c547095169 | ||
|
|
edfe626988 | ||
|
|
4fb7d3482a | ||
|
|
330396b736 | ||
|
|
cef926707a | ||
|
|
ecc88ec360 | ||
|
|
6b547eed22 | ||
|
|
1545d30edd | ||
|
|
61277c60dd | ||
|
|
3260afcac2 | ||
|
|
e5ed78bac8 | ||
|
|
bd619fc4f4 | ||
|
|
71960756d1 | ||
|
|
3bef016019 |
Binary file not shown.
@@ -28,7 +28,7 @@ back.glow={
|
|||||||
local t=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08
|
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)
|
gc.clear(t,t,t)
|
||||||
end,
|
end,
|
||||||
}--light-dark
|
}--Light-dark
|
||||||
back.rgb={
|
back.rgb={
|
||||||
init=function()
|
init=function()
|
||||||
t=0
|
t=0
|
||||||
@@ -57,7 +57,7 @@ back.flink={
|
|||||||
else gc.clear(0,0,0)
|
else gc.clear(0,0,0)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}--flash after random time
|
}--Flash after random time
|
||||||
back.aura={
|
back.aura={
|
||||||
init=function()
|
init=function()
|
||||||
t=rnd()*3600
|
t=rnd()*3600
|
||||||
@@ -76,7 +76,7 @@ back.aura={
|
|||||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||||
gc.setShader()
|
gc.setShader()
|
||||||
end,
|
end,
|
||||||
}--cool liquid background
|
}--Cool liquid background
|
||||||
back.game1={
|
back.game1={
|
||||||
init=function()
|
init=function()
|
||||||
t=0
|
t=0
|
||||||
@@ -222,19 +222,20 @@ back.space={
|
|||||||
local S=stars
|
local S=stars
|
||||||
for i=1,1260,5 do
|
for i=1,1260,5 do
|
||||||
local s=rnd(26,40)*.1
|
local s=rnd(26,40)*.1
|
||||||
S[i]=s*scr.k --size
|
S[i]=s*scr.k --Size
|
||||||
S[i+1]=rnd(W)-10 --x
|
S[i+1]=rnd(W)-10 --X
|
||||||
S[i+2]=rnd(H)-10 --y
|
S[i+2]=rnd(H)-10 --Y
|
||||||
S[i+3]=(rnd()-.5)*.01*s --vx
|
S[i+3]=(rnd()-.5)*.01*s --Vx
|
||||||
S[i+4]=(rnd()-.5)*.01*s --vy
|
S[i+4]=(rnd()-.5)*.01*s --Vy
|
||||||
end--800 var
|
end
|
||||||
end,
|
end,
|
||||||
update=function(dt)
|
update=function(dt)
|
||||||
local S=stars
|
local S=stars
|
||||||
|
--Star moving
|
||||||
for i=1,1260,5 do
|
for i=1,1260,5 do
|
||||||
S[i+1]=(S[i+1]+S[i+3])%W
|
S[i+1]=(S[i+1]+S[i+3])%W
|
||||||
S[i+2]=(S[i+2]+S[i+4])%H
|
S[i+2]=(S[i+2]+S[i+4])%H
|
||||||
end--star moving
|
end
|
||||||
end,
|
end,
|
||||||
draw=function()
|
draw=function()
|
||||||
gc.clear(.2,.2,.2)
|
gc.clear(.2,.2,.2)
|
||||||
@@ -254,13 +255,14 @@ back.space={
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--Make BG vars invisible
|
||||||
for _,bg in next,back do
|
for _,bg in next,back do
|
||||||
if not bg.init then bg.init= NULL end setfenv(bg.init ,BGvars)
|
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.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.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.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars)
|
||||||
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars)
|
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars)
|
||||||
end--make BG vars invisible
|
end
|
||||||
|
|
||||||
BG={
|
BG={
|
||||||
cur="none",
|
cur="none",
|
||||||
|
|||||||
@@ -7,25 +7,25 @@ local color={
|
|||||||
cyan={0,1,1},
|
cyan={0,1,1},
|
||||||
grey={.6,.6,.6},
|
grey={.6,.6,.6},
|
||||||
|
|
||||||
lightRed={1,.5,.5},
|
lRed={1,.5,.5},
|
||||||
lightGreen={.5,1,.5},
|
lGreen={.5,1,.5},
|
||||||
lightBlue={.6,.6,1},
|
lBlue={.6,.6,1},
|
||||||
lightCyan={.5,1,1},
|
lCyan={.5,1,1},
|
||||||
lightMagenta={1,.5,1},
|
lMagenta={1,.5,1},
|
||||||
lightYellow={1,1,.5},
|
lYellow={1,1,.5},
|
||||||
lightPurple={.8,.4,1},
|
lPurple={.8,.4,1},
|
||||||
lightOrange={1,.7,.3},
|
lOrange={1,.7,.3},
|
||||||
lightGrey={.8,.8,.8},
|
lGrey={.8,.8,.8},
|
||||||
|
|
||||||
darkRed={.6,0,0},
|
dRed={.6,0,0},
|
||||||
darkGreen={0,.6,0},
|
dGreen={0,.6,0},
|
||||||
darkBlue={0,0,.6},
|
dBlue={0,0,.6},
|
||||||
darkCyan={0,.6,.6},
|
dCyan={0,.6,.6},
|
||||||
darkMagenta={.6,0,.6},
|
dMagenta={.6,0,.6},
|
||||||
darkYellow={.6,.6,0},
|
dYellow={.6,.6,0},
|
||||||
darkPurple={.3,0,.6},
|
dPurple={.3,0,.6},
|
||||||
darkOrange={.6,.4,0},
|
dOrange={.6,.4,0},
|
||||||
darkGrey={.3,.3,.3},
|
dGrey={.3,.3,.3},
|
||||||
|
|
||||||
black={0,0,0},
|
black={0,0,0},
|
||||||
orange={1,.6,0},
|
orange={1,.6,0},
|
||||||
@@ -36,24 +36,4 @@ local color={
|
|||||||
white={1,1,1},
|
white={1,1,1},
|
||||||
purple={.5,0,1},
|
purple={.5,0,1},
|
||||||
}
|
}
|
||||||
|
|
||||||
color.lRed= color.lightRed
|
|
||||||
color.lGreen= color.lightGreen
|
|
||||||
color.lBlue= color.lightBlue
|
|
||||||
color.lCyan= color.lightCyan
|
|
||||||
color.lMagenta= color.lightMagenta
|
|
||||||
color.lYellow= color.lightYellow
|
|
||||||
color.lPurple= color.lightPurple
|
|
||||||
color.lOrange= color.lightOrange
|
|
||||||
color.lGrey= color.lightGrey
|
|
||||||
|
|
||||||
color.dRed= color.darkRed
|
|
||||||
color.dGreen= color.darkGreen
|
|
||||||
color.dBlue= color.darkBlue
|
|
||||||
color.dCyan= color.darkCyan
|
|
||||||
color.dMagenta= color.darkMagenta
|
|
||||||
color.dYellow= color.darkYellow
|
|
||||||
color.dPurple= color.darkPurple
|
|
||||||
color.dOrange= color.darkOrange
|
|
||||||
color.dGrey= color.darkGrey
|
|
||||||
return color
|
return color
|
||||||
@@ -59,7 +59,7 @@ local function dumpTable(L,t)
|
|||||||
end
|
end
|
||||||
return s..tabs[t-1].."}"
|
return s..tabs[t-1].."}"
|
||||||
end
|
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
|
for k,v in next,G do
|
||||||
if type(v)==type(base[k])then
|
if type(v)==type(base[k])then
|
||||||
if type(v)=="table"then
|
if type(v)=="table"then
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ local IMG={
|
|||||||
miyaF4="miya/f4.png",
|
miyaF4="miya/f4.png",
|
||||||
|
|
||||||
electric="mess/electric.png",
|
electric="mess/electric.png",
|
||||||
|
hbm="mess/hbm.png",
|
||||||
}
|
}
|
||||||
local list={}
|
local list={}
|
||||||
local count=0
|
local count=0
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ local ins,rem=table.insert,table.remove
|
|||||||
local scr=scr
|
local scr=scr
|
||||||
local xOy=love.math.newTransform()
|
local xOy=love.math.newTransform()
|
||||||
local mx,my,mouseShow=-20,-20,false
|
local mx,my,mouseShow=-20,-20,false
|
||||||
local touching=nil--first touching ID(userdata)
|
local touching=nil--First touching ID(userdata)
|
||||||
local touchDist=nil
|
local touchDist=nil
|
||||||
joysticks={}
|
joysticks={}
|
||||||
|
|
||||||
@@ -150,14 +150,13 @@ function mouseDown.intro(x,y,k)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function touchDown.intro(id,x,y)
|
function touchDown.intro(id,x,y)
|
||||||
SCN.goto("main")
|
mouseDown.intro()
|
||||||
end
|
end
|
||||||
function keyDown.intro(key)
|
function keyDown.intro(key)
|
||||||
if key=="escape"then
|
if key=="escape"then
|
||||||
VOC.play("bye")
|
mouseDown.intro(nil,nil,2)
|
||||||
SCN.back()
|
|
||||||
else
|
else
|
||||||
SCN.goto("main")
|
mouseDown.intro()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -229,7 +228,7 @@ function touchMove.mode(id,x,y,dx,dy)
|
|||||||
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
|
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
|
||||||
elseif not L[3]then
|
elseif not L[3]then
|
||||||
x,y=xOy:inverseTransformPoint(tc.getPosition(L[1]))
|
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
|
local d=(x-dx)^2+(y-dy)^2
|
||||||
if d>100 then
|
if d>100 then
|
||||||
d=d^.5
|
d=d^.5
|
||||||
@@ -388,6 +387,18 @@ function keyDown.sequence(key)
|
|||||||
else
|
else
|
||||||
sceneTemp.sure=50
|
sceneTemp.sure=50
|
||||||
end
|
end
|
||||||
|
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
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -460,10 +471,16 @@ function keyDown.draw(key)
|
|||||||
SCN.swapTo("custom")
|
SCN.swapTo("custom")
|
||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
elseif key=="c"and kb.isDown("lctrl","rctrl")then
|
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
|
||||||
copyBoard()
|
love.system.setClipboardText("Techmino Field:"..copyBoard())
|
||||||
elseif key=="v"and kb.isDown("lctrl","rctrl")then
|
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
|
||||||
pasteBoard()
|
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
|
else
|
||||||
pen=penKey[key]or pen
|
pen=penKey[key]or pen
|
||||||
end
|
end
|
||||||
@@ -602,64 +619,68 @@ function keyDown.pause(key)
|
|||||||
mergeStat(stat,players[1].stat)
|
mergeStat(stat,players[1].stat)
|
||||||
resetGameData()
|
resetGameData()
|
||||||
SCN.swapTo("play","none")
|
SCN.swapTo("play","none")
|
||||||
|
elseif key=="p"and game.result then
|
||||||
|
TASK.removeTask_code(TICK.autoPause)
|
||||||
|
resetPartGameData(true)
|
||||||
|
SCN.swapTo("play","none")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function touchDown.play(id,x,y)
|
function touchDown.play(id,x,y)
|
||||||
if setting.VKSwitch then
|
if not setting.VKSwitch or game.replaying then return end
|
||||||
local t=onVirtualkey(x,y)
|
|
||||||
if t then
|
local t=onVirtualkey(x,y)
|
||||||
players[1]:pressKey(t)
|
if t then
|
||||||
if setting.VKSFX>0 then
|
players[1]:pressKey(t)
|
||||||
SFX.play("virtualKey",setting.VKSFX*.25)
|
if setting.VKSFX>0 then
|
||||||
end
|
SFX.play("virtualKey",setting.VKSFX*.25)
|
||||||
virtualkey[t].isDown=true
|
end
|
||||||
virtualkey[t].pressTime=10
|
virtualkey[t].isDown=true
|
||||||
if setting.VKTrack then
|
virtualkey[t].pressTime=10
|
||||||
local B=virtualkey[t]
|
if setting.VKTrack then
|
||||||
if setting.VKDodge then--button collision (not accurate)
|
local B=virtualkey[t]
|
||||||
for i=1,#virtualkey do
|
if setting.VKDodge then--Button collision (not accurate)
|
||||||
local b=virtualkey[i]
|
for i=1,#virtualkey do
|
||||||
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--hit depth(Neg means distance)
|
local b=virtualkey[i]
|
||||||
if d>0 then
|
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--Hit depth(Neg means distance)
|
||||||
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
|
if d>0 then
|
||||||
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
|
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
|
||||||
end
|
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
|
||||||
end
|
end
|
||||||
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
|
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
|
end
|
||||||
|
VIB(setting.VKVIB)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function touchUp.play(id,x,y)
|
function touchUp.play(id,x,y)
|
||||||
if setting.VKSwitch then
|
if not setting.VKSwitch or game.replaying then return end
|
||||||
local t=onVirtualkey(x,y)
|
|
||||||
if t then
|
local t=onVirtualkey(x,y)
|
||||||
players[1]:releaseKey(t)
|
if t then
|
||||||
end
|
players[1]:releaseKey(t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function touchMove.play(id,x,y,dx,dy)
|
function touchMove.play(id,x,y,dx,dy)
|
||||||
if setting.VKSwitch then
|
if not setting.VKSwitch or game.replaying then return end
|
||||||
local l=tc.getTouches()
|
|
||||||
for n=1,#virtualkey do
|
local l=tc.getTouches()
|
||||||
local B=virtualkey[n]
|
for n=1,#virtualkey do
|
||||||
for i=1,#l do
|
local B=virtualkey[n]
|
||||||
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
|
for i=1,#l do
|
||||||
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
|
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
|
||||||
goto next
|
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
|
||||||
end
|
goto next
|
||||||
end
|
end
|
||||||
players[1]:releaseKey(n)
|
|
||||||
::next::
|
|
||||||
end
|
end
|
||||||
|
players[1]:releaseKey(n)
|
||||||
|
::next::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function keyDown.play(key)
|
function keyDown.play(key)
|
||||||
@@ -667,6 +688,7 @@ function keyDown.play(key)
|
|||||||
pauseGame()
|
pauseGame()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if game.replaying then return end
|
||||||
local m=keyMap
|
local m=keyMap
|
||||||
for k=1,20 do
|
for k=1,20 do
|
||||||
if key==m[1][k]or key==m[2][k]then
|
if key==m[1][k]or key==m[2][k]then
|
||||||
@@ -678,6 +700,7 @@ function keyDown.play(key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function keyUp.play(key)
|
function keyUp.play(key)
|
||||||
|
if game.replaying then return end
|
||||||
local m=keyMap
|
local m=keyMap
|
||||||
for k=1,20 do
|
for k=1,20 do
|
||||||
if key==m[1][k]or key==m[2][k]then
|
if key==m[1][k]or key==m[2][k]then
|
||||||
@@ -689,6 +712,8 @@ function keyUp.play(key)
|
|||||||
end
|
end
|
||||||
function gamepadDown.play(key)
|
function gamepadDown.play(key)
|
||||||
if key=="back"then SCN.back()return end
|
if key=="back"then SCN.back()return end
|
||||||
|
if game.replaying then return end
|
||||||
|
|
||||||
local m=keyMap
|
local m=keyMap
|
||||||
for k=1,20 do
|
for k=1,20 do
|
||||||
if key==m[3][k]or key==m[4][k]then
|
if key==m[3][k]or key==m[4][k]then
|
||||||
@@ -700,14 +725,14 @@ function gamepadDown.play(key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function gamepadUp.play(key)
|
function gamepadUp.play(key)
|
||||||
|
if game.replaying then return end
|
||||||
|
|
||||||
local m=keyMap
|
local m=keyMap
|
||||||
for p=1,players.human do
|
for k=1,20 do
|
||||||
for k=1,20 do
|
if key==m[3][k]or key==m[4][k]then
|
||||||
if key==m[3][k]or key==m[4][k]then
|
players[1]:releaseKey(k)
|
||||||
players[1]:releaseKey(k)
|
virtualkey[k].isDown=false
|
||||||
virtualkey[k].isDown=false
|
return
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -745,15 +770,15 @@ function wheelMoved.history(x,y)
|
|||||||
end
|
end
|
||||||
function keyDown.history(key)
|
function keyDown.history(key)
|
||||||
if key=="up"then
|
if key=="up"then
|
||||||
sceneTemp[2]=max(sceneTemp[2]-1,1)
|
sceneTemp.pos=max(sceneTemp.pos-1,1)
|
||||||
elseif key=="down"then
|
elseif key=="down"then
|
||||||
sceneTemp[2]=min(sceneTemp[2]+1,#sceneTemp[1])
|
sceneTemp.pos=min(sceneTemp.pos+1,#sceneTemp.text)
|
||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
local lastX,lastY=0,0--last clickDown pos
|
local lastX,lastY=0,0--Last clickDown pos
|
||||||
function love.mousepressed(x,y,k,t,num)
|
function love.mousepressed(x,y,k,t,num)
|
||||||
if t then return end
|
if t then return end
|
||||||
mouseShow=true
|
mouseShow=true
|
||||||
@@ -808,7 +833,7 @@ function love.touchpressed(id,x,y)
|
|||||||
touching=id
|
touching=id
|
||||||
love.touchmoved(id,x,y,0,0)
|
love.touchmoved(id,x,y,0,0)
|
||||||
end
|
end
|
||||||
touchDist=nil--reset distance
|
touchDist=nil--Reset distance
|
||||||
x,y=xOy:inverseTransformPoint(x,y)
|
x,y=xOy:inverseTransformPoint(x,y)
|
||||||
lastX,lastY=x,y
|
lastX,lastY=x,y
|
||||||
if touchDown[SCN.cur]then
|
if touchDown[SCN.cur]then
|
||||||
@@ -849,8 +874,19 @@ function love.touchreleased(id,x,y)
|
|||||||
end
|
end
|
||||||
function love.keypressed(i)
|
function love.keypressed(i)
|
||||||
mouseShow=false
|
mouseShow=false
|
||||||
if SCN.swapping then return end
|
if not devMode then
|
||||||
if 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 i=="f5"then
|
if i=="f5"then
|
||||||
print("DEBUG:")
|
print("DEBUG:")
|
||||||
elseif i=="f8"then devMode=nil TEXT.show("DEBUG OFF",640,360,80,"fly",.8)
|
elseif i=="f8"then devMode=nil TEXT.show("DEBUG OFF",640,360,80,"fly",.8)
|
||||||
@@ -891,14 +927,6 @@ function love.keypressed(i)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif i=="f8"then
|
|
||||||
devMode=1
|
|
||||||
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
|
|
||||||
else
|
|
||||||
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
|
|
||||||
elseif i=="escape"then SCN.back()
|
|
||||||
else WIDGET.keyPressed(i)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function love.keyreleased(i)
|
function love.keyreleased(i)
|
||||||
@@ -987,6 +1015,7 @@ end
|
|||||||
function love.focus(f)
|
function love.focus(f)
|
||||||
if f then
|
if f then
|
||||||
TASK.new(TICK.autoResize,{0})
|
TASK.new(TICK.autoResize,{0})
|
||||||
|
love.timer.step()
|
||||||
elseif SCN.cur=="play"and setting.autoPause then
|
elseif SCN.cur=="play"and setting.autoPause then
|
||||||
pauseGame()
|
pauseGame()
|
||||||
end
|
end
|
||||||
@@ -994,25 +1023,34 @@ end
|
|||||||
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
||||||
local devColor={
|
local devColor={
|
||||||
color.white,
|
color.white,
|
||||||
color.lightMagenta,
|
color.lMagenta,
|
||||||
color.lightGreen,
|
color.lGreen,
|
||||||
color.lightBlue,
|
color.lBlue,
|
||||||
}
|
}
|
||||||
local FPS=love.timer.getFPS
|
local FPS=love.timer.getFPS
|
||||||
love.draw,love.update=nil
|
love.draw,love.update=nil
|
||||||
function love.run()
|
function love.run()
|
||||||
local T=love.timer
|
local T=love.timer
|
||||||
local STEP,GETDelta,WAIT=T.step,T.getDelta,T.sleep
|
local STEP,GETDelta,WAIT=T.step,T.getDelta,T.sleep
|
||||||
local lastFrame=T.getTime()
|
|
||||||
local lastFreshPow=lastFrame
|
|
||||||
local FCT=0--framedraw counter
|
|
||||||
local mini=love.window.isMinimized
|
local mini=love.window.isMinimized
|
||||||
local PUMP,POLL=love.event.pump,love.event.poll
|
local PUMP,POLL=love.event.pump,love.event.poll
|
||||||
|
|
||||||
|
local waitTime=1/60
|
||||||
|
local LIST={}
|
||||||
|
|
||||||
|
local lastFrame=Timer()
|
||||||
|
local lastFreshPow=lastFrame
|
||||||
|
local FCT=0--Framedraw counter
|
||||||
|
|
||||||
love.resize(gc.getWidth(),gc.getHeight())
|
love.resize(gc.getWidth(),gc.getHeight())
|
||||||
SCN.init("load")--Scene Launch
|
SCN.init("load")--Scene Launch
|
||||||
marking=true
|
marking=true
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
local _
|
local _
|
||||||
|
|
||||||
|
lastFrame=Timer()
|
||||||
|
|
||||||
--EVENT
|
--EVENT
|
||||||
PUMP()
|
PUMP()
|
||||||
for N,a,b,c,d,e in POLL()do
|
for N,a,b,c,d,e in POLL()do
|
||||||
@@ -1025,7 +1063,8 @@ function love.run()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--UPDATE
|
--UPDATE
|
||||||
STEP()local dt=GETDelta()
|
STEP()
|
||||||
|
local dt=GETDelta()
|
||||||
TASK.update()
|
TASK.update()
|
||||||
VOC.update()
|
VOC.update()
|
||||||
BG.update(dt)
|
BG.update(dt)
|
||||||
@@ -1045,8 +1084,14 @@ function love.run()
|
|||||||
BG.draw()
|
BG.draw()
|
||||||
gc.push("transform")
|
gc.push("transform")
|
||||||
gc.replaceTransform(xOy)
|
gc.replaceTransform(xOy)
|
||||||
|
|
||||||
|
--Draw scene contents
|
||||||
if Pnt[SCN.cur]then Pnt[SCN.cur]()end
|
if Pnt[SCN.cur]then Pnt[SCN.cur]()end
|
||||||
WIDGET.draw()--Draw widgets
|
|
||||||
|
--Draw widgets
|
||||||
|
WIDGET.draw()
|
||||||
|
|
||||||
|
--Draw cursor
|
||||||
if mouseShow then
|
if mouseShow then
|
||||||
local r=Timer()*.5
|
local r=Timer()*.5
|
||||||
local R=int(r)%7+1
|
local R=int(r)%7+1
|
||||||
@@ -1055,51 +1100,59 @@ function love.run()
|
|||||||
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]-.5,#blocks[R][0]-scs[2*R-1]+.5)
|
||||||
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
|
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
|
||||||
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
|
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
|
||||||
end--Awesome mouse!
|
end
|
||||||
sysFX.draw()
|
sysFX.draw()
|
||||||
TEXT.draw()
|
TEXT.draw()
|
||||||
gc.pop()
|
gc.pop()
|
||||||
|
|
||||||
|
--Draw power info.
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
if setting.powerInfo then
|
if setting.powerInfo then
|
||||||
gc.draw(infoCanvas,0,0,0,scr.k)
|
gc.draw(infoCanvas,0,0,0,scr.k)
|
||||||
end
|
end
|
||||||
--Power Info
|
|
||||||
|
|
||||||
|
--Draw scene swapping animation
|
||||||
if SCN.swapping then
|
if SCN.swapping then
|
||||||
_=SCN.swap
|
_=SCN.swap
|
||||||
_.draw(_.time)
|
_.draw(_.time)
|
||||||
end--Scene swapping animation
|
end
|
||||||
|
|
||||||
setFont(15)
|
--Draw FPS
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
|
setFont(15)
|
||||||
_=scr.h-20
|
_=scr.h-20
|
||||||
gc.print(FPS(),5,_)
|
gc.print(FPS(),5,_)
|
||||||
|
|
||||||
|
--Debug info.
|
||||||
if devMode then
|
if devMode then
|
||||||
gc.setColor(devColor[devMode])
|
gc.setColor(devColor[devMode])
|
||||||
gc.print("Cache used:"..gcinfo(),5,_-20)
|
gc.print("Memory:"..gcinfo(),5,_-20)
|
||||||
gc.print("Free Row:"..freeRow.getCount(),5,_-40)
|
gc.print("Lines:"..freeRow.getCount(),5,_-40)
|
||||||
gc.print("Mouse:"..mx.." "..my,5,_-60)
|
gc.print("Cursor:"..mx.." "..my,5,_-60)
|
||||||
gc.print("Voices:"..VOC.getCount(),5,_-80)
|
gc.print("Voices:"..VOC.getCount(),5,_-80)
|
||||||
gc.print("Tasks:"..TASK.getCount(),5,_-100)
|
gc.print("Tasks:"..TASK.getCount(),5,_-100)
|
||||||
if devMode==3 then love.timer.sleep(.26)
|
ins(LIST,1,dt)rem(LIST,126)
|
||||||
elseif devMode==4 then love.timer.sleep(.626)
|
for i=1,#LIST do
|
||||||
|
gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000)
|
||||||
end
|
end
|
||||||
end--DEV info
|
if devMode==3 then WAIT(.26)
|
||||||
|
elseif devMode==4 then WAIT(.626)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
gc.present()
|
gc.present()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--FRAME TIME CTRL
|
--Fresh power info.
|
||||||
if Timer()-lastFrame<.058 then WAIT(.01)end
|
|
||||||
while Timer()-lastFrame<.0159 do WAIT(.001)end
|
|
||||||
|
|
||||||
--FRESH POWERINFO
|
|
||||||
lastFrame=Timer()
|
|
||||||
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
|
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
|
||||||
updatePowerInfo()
|
updatePowerInfo()
|
||||||
lastFreshPow=Timer()
|
lastFreshPow=Timer()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Keep 60fps
|
||||||
|
_=Timer()-lastFrame
|
||||||
|
if _<.016 then WAIT(.016-_)end
|
||||||
|
while Timer()-lastFrame<1/60-0.000005 do WAIT(0)end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2,6 +2,7 @@ local langList={
|
|||||||
{
|
{
|
||||||
anykey="按任意键继续",
|
anykey="按任意键继续",
|
||||||
newVersion="检测到更新!",
|
newVersion="检测到更新!",
|
||||||
|
newBigVersion="检测到大更新!大量存档信息被改动",
|
||||||
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
|
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
|
||||||
lang="中文",
|
lang="中文",
|
||||||
atkModeName={"随机","徽章","击杀","反击"},
|
atkModeName={"随机","徽章","击杀","反击"},
|
||||||
@@ -12,6 +13,7 @@ local langList={
|
|||||||
mini="Mini",b2b="B2B ",b3b="B2B2B ",
|
mini="Mini",b2b="B2B ",b3b="B2B2B ",
|
||||||
PC="Perfect Clear",HPC="Half Clear",
|
PC="Perfect Clear",HPC="Half Clear",
|
||||||
hold="暂存",next="下一个",
|
hold="暂存",next="下一个",
|
||||||
|
replaying="[回放]",
|
||||||
|
|
||||||
stage=function(n)return"关卡 "..n end,
|
stage=function(n)return"关卡 "..n end,
|
||||||
great="Great!",
|
great="Great!",
|
||||||
@@ -164,9 +166,9 @@ local langList={
|
|||||||
"程序:MrZ, FinnTenzor",
|
"程序:MrZ, FinnTenzor",
|
||||||
"美术:MrZ, (Gnyar)",
|
"美术:MrZ, (Gnyar)",
|
||||||
"音乐:MrZ, (T0722)",
|
"音乐:MrZ, (T0722)",
|
||||||
"音效:MrZ",
|
"音效/语音: MrZ, Miya",
|
||||||
"语音:Miya, MrZ",
|
"演出: 模电, 吉备宏纯",
|
||||||
"官网:渣渣120",
|
"官网: 渣渣120",
|
||||||
"",
|
"",
|
||||||
"特别感谢:",
|
"特别感谢:",
|
||||||
"Flyz, Farter, 蕴空之灵,",
|
"Flyz, Farter, 蕴空之灵,",
|
||||||
@@ -228,6 +230,8 @@ local langList={
|
|||||||
right="→",
|
right="→",
|
||||||
backsp="<X",
|
backsp="<X",
|
||||||
reset="R",
|
reset="R",
|
||||||
|
copy="复制",
|
||||||
|
paste="粘贴",
|
||||||
back="返回",
|
back="返回",
|
||||||
},
|
},
|
||||||
draw={
|
draw={
|
||||||
@@ -244,9 +248,10 @@ local langList={
|
|||||||
pause="暂停",
|
pause="暂停",
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
|
setting="设置(S)",
|
||||||
|
replay= "回放(P)",
|
||||||
resume= "继续(esc)",
|
resume= "继续(esc)",
|
||||||
restart="重新开始(R)",
|
restart="重新开始(R)",
|
||||||
setting="设置(S)",
|
|
||||||
quit= "退出(Q)",
|
quit= "退出(Q)",
|
||||||
},
|
},
|
||||||
setting_game={
|
setting_game={
|
||||||
@@ -351,7 +356,7 @@ local langList={
|
|||||||
},
|
},
|
||||||
setting_lang={
|
setting_lang={
|
||||||
back="返回",
|
back="返回",
|
||||||
},--langName added later
|
},--LangName added later
|
||||||
help={
|
help={
|
||||||
staff="制作人员",
|
staff="制作人员",
|
||||||
his="更新历史",
|
his="更新历史",
|
||||||
@@ -373,7 +378,10 @@ local langList={
|
|||||||
debug={
|
debug={
|
||||||
killWTM="关闭水印",
|
killWTM="关闭水印",
|
||||||
unlock="解锁全模式",
|
unlock="解锁全模式",
|
||||||
reset="清空所有数据",
|
reset="重置?",
|
||||||
|
reset1="重置解锁/等级",
|
||||||
|
reset2="重置统计",
|
||||||
|
reset3="清空所有数据",
|
||||||
back="返回",
|
back="返回",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -404,8 +412,8 @@ local langList={
|
|||||||
["round_3"]= {"回合制", "困难", "下棋模式"},
|
["round_3"]= {"回合制", "困难", "下棋模式"},
|
||||||
["round_4"]= {"回合制", "疯狂", "下棋模式"},
|
["round_4"]= {"回合制", "疯狂", "下棋模式"},
|
||||||
["round_5"]= {"回合制", "极限", "下棋模式"},
|
["round_5"]= {"回合制", "极限", "下棋模式"},
|
||||||
["master_beginner"]= {"大师", "疯狂", "20G:初心者适用"},
|
["master_beginner"]= {"大师", "疯狂", "20G初心者练习"},
|
||||||
["master_adavnce"]= {"大师", "极限", "20G:上级者的挑战"},
|
["master_advance"]= {"大师", "极限", "上级者20G挑战"},
|
||||||
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
|
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
|
||||||
["GM"]= {"宗师", "GM", "成为方块大师"},
|
["GM"]= {"宗师", "GM", "成为方块大师"},
|
||||||
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
|
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
|
||||||
@@ -457,6 +465,7 @@ local langList={
|
|||||||
{
|
{
|
||||||
anykey="按任意键继续",
|
anykey="按任意键继续",
|
||||||
newVersion="检测到更新!",
|
newVersion="检测到更新!",
|
||||||
|
newBigVersion="检测到大更新!大量存档信息被改动",
|
||||||
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
|
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
|
||||||
lang="全中文",
|
lang="全中文",
|
||||||
atkModeName={"随机","徽章","击杀","反击"},
|
atkModeName={"随机","徽章","击杀","反击"},
|
||||||
@@ -467,6 +476,7 @@ local langList={
|
|||||||
mini="迷你",b2b="满贯",b3b="大满贯",
|
mini="迷你",b2b="满贯",b3b="大满贯",
|
||||||
PC="场地全清",HPC="场地半清",
|
PC="场地全清",HPC="场地半清",
|
||||||
hold="暂存",next="下一个",
|
hold="暂存",next="下一个",
|
||||||
|
replaying="[回放]",
|
||||||
|
|
||||||
stage=function(n)return"关卡 "..n end,
|
stage=function(n)return"关卡 "..n end,
|
||||||
great="不错!",
|
great="不错!",
|
||||||
@@ -616,9 +626,9 @@ local langList={
|
|||||||
"程序:MrZ, FinnTenzor",
|
"程序:MrZ, FinnTenzor",
|
||||||
"美术:MrZ, (T0722, Gnyar)",
|
"美术:MrZ, (T0722, Gnyar)",
|
||||||
"音乐:MrZ, (T0722)",
|
"音乐:MrZ, (T0722)",
|
||||||
"音效:MrZ",
|
"音效/语音: MrZ, Miya",
|
||||||
"语音:Miya, MrZ",
|
"演出: 模电, 吉备宏纯",
|
||||||
"官网:渣渣120",
|
"官网: 渣渣120",
|
||||||
"",
|
"",
|
||||||
"特别感谢:",
|
"特别感谢:",
|
||||||
"Flyz, Farter, 蕴空之灵,",
|
"Flyz, Farter, 蕴空之灵,",
|
||||||
@@ -680,6 +690,8 @@ local langList={
|
|||||||
right="→",
|
right="→",
|
||||||
backsp="<X",
|
backsp="<X",
|
||||||
reset="R",
|
reset="R",
|
||||||
|
copy="复制",
|
||||||
|
paste="粘贴",
|
||||||
back="返回",
|
back="返回",
|
||||||
},
|
},
|
||||||
draw={
|
draw={
|
||||||
@@ -696,9 +708,10 @@ local langList={
|
|||||||
pause="暂停",
|
pause="暂停",
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
|
setting="设置(S)",
|
||||||
|
replay= "回放(P)",
|
||||||
resume= "继续(esc)",
|
resume= "继续(esc)",
|
||||||
restart="重新开始(R)",
|
restart="重新开始(R)",
|
||||||
setting="设置(S)",
|
|
||||||
quit= "退出(Q)",
|
quit= "退出(Q)",
|
||||||
},
|
},
|
||||||
setting_game={
|
setting_game={
|
||||||
@@ -803,7 +816,7 @@ local langList={
|
|||||||
},
|
},
|
||||||
setting_lang={
|
setting_lang={
|
||||||
back="返回",
|
back="返回",
|
||||||
},--langName added later
|
},--LangName added later
|
||||||
help={
|
help={
|
||||||
staff="制作人员",
|
staff="制作人员",
|
||||||
his="更新历史",
|
his="更新历史",
|
||||||
@@ -825,7 +838,10 @@ local langList={
|
|||||||
debug={
|
debug={
|
||||||
killWTM="关闭水印",
|
killWTM="关闭水印",
|
||||||
unlock="解锁全模式",
|
unlock="解锁全模式",
|
||||||
reset="清空所有数据",
|
reset="重置?",
|
||||||
|
reset1="重置解锁/等级",
|
||||||
|
reset2="重置统计",
|
||||||
|
reset3="清空所有数据",
|
||||||
back="返回",
|
back="返回",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -856,8 +872,8 @@ local langList={
|
|||||||
["round_3"]= {"回合制", "困难", "下棋模式"},
|
["round_3"]= {"回合制", "困难", "下棋模式"},
|
||||||
["round_4"]= {"回合制", "疯狂", "下棋模式"},
|
["round_4"]= {"回合制", "疯狂", "下棋模式"},
|
||||||
["round_5"]= {"回合制", "极限", "下棋模式"},
|
["round_5"]= {"回合制", "极限", "下棋模式"},
|
||||||
["master_beginner"]= {"大师", "疯狂", "20G:初心者适用"},
|
["master_beginner"]= {"大师", "疯狂", "20G初心者练习"},
|
||||||
["master_adavnce"]= {"大师", "极限", "20G:上级者的挑战"},
|
["master_advance"]= {"大师", "极限", "上级者20G挑战"},
|
||||||
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
|
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
|
||||||
["GM"]= {"宗师", "GM", "成为方块大师"},
|
["GM"]= {"宗师", "GM", "成为方块大师"},
|
||||||
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
|
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
|
||||||
@@ -909,16 +925,18 @@ local langList={
|
|||||||
{
|
{
|
||||||
anykey="Press any button",
|
anykey="Press any button",
|
||||||
newVersion="Updating detected!",
|
newVersion="Updating detected!",
|
||||||
|
newBigVersion="Big updating detected! Save data altered",
|
||||||
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
|
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
|
||||||
lang="English",
|
lang="English",
|
||||||
atkModeName={"Random","Badges","K.O.s","Attackers"},
|
atkModeName={"Random","Badges","K.O.s","Attackers"},
|
||||||
royale_remain=function(n)return n.." Players Remaining"end,
|
royale_remain=function(n)return n.." Players Remaining"end,
|
||||||
cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
|
cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
|
||||||
block=nil,spin="-spin ",
|
block=nil,spin="-spin ",
|
||||||
clear={"single","double"," triple","Techrash","Techrash+"},
|
clear={"single","double","triple","Techrash","Techrash+"},
|
||||||
mini="Mini",b2b="B2B ",b3b="B2B2B ",
|
mini="Mini",b2b="B2B ",b3b="B2B2B ",
|
||||||
PC="Perfect Clear",HPC="Clear",
|
PC="Perfect Clear",HPC="Clear",
|
||||||
hold="Hold",next="Next",
|
hold="Hold",next="Next",
|
||||||
|
replaying="[Replaying]",
|
||||||
|
|
||||||
stage=function(n)return"Stage "..n end,
|
stage=function(n)return"Stage "..n end,
|
||||||
great="Great!",
|
great="Great!",
|
||||||
@@ -1065,8 +1083,8 @@ local langList={
|
|||||||
"Program: MrZ, FinnTenzor",
|
"Program: MrZ, FinnTenzor",
|
||||||
"Art: MrZ, (Gnyar)",
|
"Art: MrZ, (Gnyar)",
|
||||||
"Music: MrZ, (T0722)",
|
"Music: MrZ, (T0722)",
|
||||||
"Sound: MrZ",
|
"Voice/ Sound: MrZ, Miya",
|
||||||
"Voice: Miya, MrZ",
|
"Performance: 模电 吉备宏纯",
|
||||||
"Web: 渣渣120",
|
"Web: 渣渣120",
|
||||||
"",
|
"",
|
||||||
"Special Thanks:",
|
"Special Thanks:",
|
||||||
@@ -1121,6 +1139,8 @@ local langList={
|
|||||||
right="→",
|
right="→",
|
||||||
backsp="<X",
|
backsp="<X",
|
||||||
reset="R",
|
reset="R",
|
||||||
|
copy="Copy",
|
||||||
|
paste="Paste",
|
||||||
back="Back",
|
back="Back",
|
||||||
},
|
},
|
||||||
draw={
|
draw={
|
||||||
@@ -1137,9 +1157,10 @@ local langList={
|
|||||||
pause="Pause",
|
pause="Pause",
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
|
setting="Settings (S)",
|
||||||
|
replay="Replay (P)",
|
||||||
resume="Resume (esc)",
|
resume="Resume (esc)",
|
||||||
restart="Retry (R)",
|
restart="Retry (R)",
|
||||||
setting="Settings (S)",
|
|
||||||
quit="Quit (Q)",
|
quit="Quit (Q)",
|
||||||
},
|
},
|
||||||
setting_game={
|
setting_game={
|
||||||
@@ -1244,7 +1265,7 @@ local langList={
|
|||||||
},
|
},
|
||||||
setting_lang={
|
setting_lang={
|
||||||
back="Back",
|
back="Back",
|
||||||
},--langName added later
|
},--LangName added later
|
||||||
help={
|
help={
|
||||||
staff="Staff",
|
staff="Staff",
|
||||||
his="History",
|
his="History",
|
||||||
@@ -1264,9 +1285,12 @@ local langList={
|
|||||||
back="Back",
|
back="Back",
|
||||||
},
|
},
|
||||||
debug={
|
debug={
|
||||||
killWTM="kill watermark",
|
killWTM="Kill watermark",
|
||||||
unlock="unlock all",
|
unlock="Unlock all",
|
||||||
reset="reset all",
|
reset="Reset?",
|
||||||
|
reset1="Reset rank",
|
||||||
|
reset2="Reset data",
|
||||||
|
reset3="Reset ALL",
|
||||||
back="Back",
|
back="Back",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1297,8 +1321,8 @@ local langList={
|
|||||||
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
|
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
|
||||||
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
|
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
|
||||||
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
|
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
|
||||||
["master_beginner"]= {"Master", "LUNATIC", "20G: For beginners."},
|
["master_beginner"]= {"Master", "LUNATIC", "For 20G beginners."},
|
||||||
["master_adavnce"]= {"Master", "ULTIMATE", "20G: Professional challenge!"},
|
["master_advance"]= {"Master", "ULTIMATE", "Professional 20G challenge!"},
|
||||||
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
|
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
|
||||||
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
|
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
|
||||||
["blind_easy"]= {"Blind", "HALF", "For novice players."},
|
["blind_easy"]= {"Blind", "HALF", "For novice players."},
|
||||||
@@ -1350,6 +1374,7 @@ local langList={
|
|||||||
{
|
{
|
||||||
anykey="↓□↓",
|
anykey="↓□↓",
|
||||||
newVersion="&!!!",
|
newVersion="&!!!",
|
||||||
|
newBigVersion="&!!!~~~",
|
||||||
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
|
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
|
||||||
lang="?????",
|
lang="?????",
|
||||||
atkModeName={"?","( )","!","←→"},
|
atkModeName={"?","( )","!","←→"},
|
||||||
@@ -1360,6 +1385,7 @@ local langList={
|
|||||||
mini="v",b2b="^ ",b3b="^^ ",
|
mini="v",b2b="^ ",b3b="^^ ",
|
||||||
PC="#<>#",HPC="<>",
|
PC="#<>#",HPC="<>",
|
||||||
hold="[ ]",next="→",
|
hold="[ ]",next="→",
|
||||||
|
replaying="[Replaying]",
|
||||||
|
|
||||||
stage=function(n)return"::"..n.."::"end,
|
stage=function(n)return"::"..n.."::"end,
|
||||||
great="!~",
|
great="!~",
|
||||||
@@ -1502,8 +1528,8 @@ local langList={
|
|||||||
"Program: MrZ, FinnTenzor",
|
"Program: MrZ, FinnTenzor",
|
||||||
"Art: MrZ, (Gnyar)",
|
"Art: MrZ, (Gnyar)",
|
||||||
"Music: MrZ, (T0722)",
|
"Music: MrZ, (T0722)",
|
||||||
"Sound: MrZ",
|
"Voice/ Sound: MrZ, Miya",
|
||||||
"Voice: Miya, MrZ",
|
"Performance: 模电 吉备宏纯",
|
||||||
"Web: 渣渣120",
|
"Web: 渣渣120",
|
||||||
"",
|
"",
|
||||||
"Special Thanks:",
|
"Special Thanks:",
|
||||||
@@ -1558,6 +1584,8 @@ local langList={
|
|||||||
right="→",
|
right="→",
|
||||||
backsp="<X",
|
backsp="<X",
|
||||||
reset="R",
|
reset="R",
|
||||||
|
copy="→__",
|
||||||
|
paste="__→",
|
||||||
back="X",
|
back="X",
|
||||||
},
|
},
|
||||||
draw={
|
draw={
|
||||||
@@ -1574,9 +1602,10 @@ local langList={
|
|||||||
pause="||",
|
pause="||",
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
|
setting="_?_ (S)",
|
||||||
|
replay="## (P)",
|
||||||
resume="!! (esc)",
|
resume="!! (esc)",
|
||||||
restart="_→_ (R)",
|
restart="_→_ (R)",
|
||||||
setting="_?_ (S)",
|
|
||||||
quit="X (Q)",
|
quit="X (Q)",
|
||||||
},
|
},
|
||||||
setting_game={
|
setting_game={
|
||||||
@@ -1681,7 +1710,7 @@ local langList={
|
|||||||
},
|
},
|
||||||
setting_lang={
|
setting_lang={
|
||||||
back="X",
|
back="X",
|
||||||
},--langName added later
|
},--LangName added later
|
||||||
help={
|
help={
|
||||||
staff="Orz",
|
staff="Orz",
|
||||||
his="_&_",
|
his="_&_",
|
||||||
@@ -1701,9 +1730,12 @@ local langList={
|
|||||||
back="X",
|
back="X",
|
||||||
},
|
},
|
||||||
debug={
|
debug={
|
||||||
killWTM="kill watermark",
|
killWTM="Kill watermark",
|
||||||
unlock="unlock all",
|
unlock="Unlock all",
|
||||||
reset="reset all",
|
reset="Reset?",
|
||||||
|
reset1="Reset rank",
|
||||||
|
reset2="Reset data",
|
||||||
|
reset3="Reset ALL",
|
||||||
back="X",
|
back="X",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1734,8 +1766,8 @@ local langList={
|
|||||||
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
|
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
|
||||||
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
|
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
|
||||||
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
|
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
|
||||||
["master_beginner"]= {"Master", "LUNATIC", "20G: For beginners."},
|
["master_beginner"]= {"Master", "LUNATIC", "For 20G beginners."},
|
||||||
["master_adavnce"]= {"Master", "ULTIMATE", "20G: Professional challenge!"},
|
["master_advance"]= {"Master", "ULTIMATE", "Professional 20G challenge!"},
|
||||||
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
|
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
|
||||||
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
|
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
|
||||||
["blind_easy"]= {"Blind", "HALF", "For novice players."},
|
["blind_easy"]= {"Blind", "HALF", "For novice players."},
|
||||||
@@ -1831,6 +1863,7 @@ local gc=love.graphics
|
|||||||
local LANG={}
|
local LANG={}
|
||||||
local drawableTextLoad={
|
local drawableTextLoad={
|
||||||
"anykey",
|
"anykey",
|
||||||
|
"replaying",
|
||||||
"next","hold",
|
"next","hold",
|
||||||
"win","finish","lose","pause",
|
"win","finish","lose","pause",
|
||||||
"custom","sequence",
|
"custom","sequence",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ local function draw(L)
|
|||||||
lightRenderShader:send("xresolution",L.size);
|
lightRenderShader:send("xresolution",L.size);
|
||||||
shadowMapShader:send("yresolution",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 X=L.x-L.size*.5
|
||||||
local Y=L.y-L.size*.5
|
local Y=L.y-L.size*.5
|
||||||
|
|
||||||
@@ -74,10 +74,10 @@ function LIGHT.add(x,y,R,F)
|
|||||||
--Methods
|
--Methods
|
||||||
id=id,
|
id=id,
|
||||||
x=x,y=y,size=R,
|
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
|
shadowCanvas=gc.newCanvas(R,1),--1D vis-depth canvas
|
||||||
renderCanvas=gc.newCanvas(R,R),--light canvas
|
renderCanvas=gc.newCanvas(R,R),--Light canvas
|
||||||
blackFn=F,--solid draw funcion
|
blackFn=F,--Solid draw funcion
|
||||||
|
|
||||||
|
|
||||||
move=move,
|
move=move,
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ local mStr=mStr
|
|||||||
local scr=scr
|
local scr=scr
|
||||||
local scs=require("parts/spinCenters")
|
local scs=require("parts/spinCenters")
|
||||||
local modeRankColor={
|
local modeRankColor={
|
||||||
color.bronze, --Rank1
|
color.bronze, --Rank1
|
||||||
color.lightGrey, --Rank2
|
color.lGrey, --Rank2
|
||||||
color.lightYellow, --Rank3
|
color.lYellow, --Rank3
|
||||||
color.lightPurple, --Rank4
|
color.lPurple, --Rank4
|
||||||
color.lightCyan, --Rank5
|
color.lCyan, --Rank5
|
||||||
color.purple, --Special
|
color.lGreen, --Special
|
||||||
}
|
}
|
||||||
local rankString={
|
local rankString={
|
||||||
"D","C","B","A","S",
|
"D","C","B","A","S",
|
||||||
@@ -66,7 +66,7 @@ local function drawVirtualkey()
|
|||||||
gc.setLineWidth(B.r*.07)
|
gc.setLineWidth(B.r*.07)
|
||||||
gc.circle("line",B.x,B.y,B.r,10)--Button outline
|
gc.circle("line",B.x,B.y,B.r,10)--Button outline
|
||||||
_=V[i].pressTime
|
_=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
|
if _>0 then
|
||||||
gc.setColor(1,1,1,a*_*.08)
|
gc.setColor(1,1,1,a*_*.08)
|
||||||
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
|
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
|
||||||
@@ -186,6 +186,7 @@ function Pnt.mode()
|
|||||||
local sel=cam.sel
|
local sel=cam.sel
|
||||||
setFont(30)
|
setFont(30)
|
||||||
|
|
||||||
|
--Draw lines connecting modes
|
||||||
gc.setLineWidth(8)
|
gc.setLineWidth(8)
|
||||||
gc.setColor(1,1,1,.2)
|
gc.setColor(1,1,1,.2)
|
||||||
for name,M in next,Modes do
|
for name,M in next,Modes do
|
||||||
@@ -195,7 +196,7 @@ function Pnt.mode()
|
|||||||
gc.line(M.x,M.y,m.x,m.y)
|
gc.line(M.x,M.y,m.x,m.y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end--lines connecting modes
|
end
|
||||||
|
|
||||||
for name,M in next,Modes do
|
for name,M in next,Modes do
|
||||||
if R[name]then
|
if R[name]then
|
||||||
@@ -217,7 +218,7 @@ function Pnt.mode()
|
|||||||
gc.setLineWidth(10)
|
gc.setLineWidth(10)
|
||||||
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
|
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
|
||||||
end
|
end
|
||||||
elseif M.shape==2 then--diamond
|
elseif M.shape==2 then--Diamond
|
||||||
gc.circle("fill",M.x,M.y,S+5,4)
|
gc.circle("fill",M.x,M.y,S+5,4)
|
||||||
if sel==name then
|
if sel==name then
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
@@ -353,10 +354,14 @@ function Pnt.sequence()
|
|||||||
gc.print(len,120,300)
|
gc.print(len,120,300)
|
||||||
|
|
||||||
local L=TEXTURE.miniBlock
|
local L=TEXTURE.miniBlock
|
||||||
|
local lib=SKIN.libColor
|
||||||
|
local set=setting.skin
|
||||||
|
|
||||||
local x,y=120,126
|
local x,y=120,126
|
||||||
local cx,cy=120,126
|
local cx,cy=120,126
|
||||||
for i=1,len do
|
for i=1,len do
|
||||||
local B=L[bag[i]]
|
local B=L[bag[i]]
|
||||||
|
gc.setColor(lib[set[bag[i]]])
|
||||||
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
|
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
|
||||||
x=x+B:getWidth()*15+10
|
x=x+B:getWidth()*15+10
|
||||||
if x>1126 then
|
if x>1126 then
|
||||||
@@ -441,6 +446,7 @@ function Pnt.play()
|
|||||||
for p=1,#players do
|
for p=1,#players do
|
||||||
players[p]:draw()
|
players[p]:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
gc.setLineWidth(5)
|
gc.setLineWidth(5)
|
||||||
for i=1,#FX_attack do
|
for i=1,#FX_attack do
|
||||||
local A=FX_attack[i]
|
local A=FX_attack[i]
|
||||||
@@ -463,9 +469,11 @@ function Pnt.play()
|
|||||||
gc.rotate(A.t*.1)
|
gc.rotate(A.t*.1)
|
||||||
gc.circle("fill",0,0,A.rad,A.corner)
|
gc.circle("fill",0,0,A.rad,A.corner)
|
||||||
gc.pop()
|
gc.pop()
|
||||||
end--FX animation
|
end
|
||||||
|
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
if setting.VKSwitch then drawVirtualkey()end
|
if setting.VKSwitch then drawVirtualkey()end
|
||||||
|
|
||||||
if modeEnv.royaleMode then
|
if modeEnv.royaleMode then
|
||||||
for i=1,#FX_badge do
|
for i=1,#FX_badge do
|
||||||
local b=FX_badge[i]
|
local b=FX_badge[i]
|
||||||
@@ -501,7 +509,13 @@ function Pnt.play()
|
|||||||
gc.draw(drawableText.modeName,485,10)
|
gc.draw(drawableText.modeName,485,10)
|
||||||
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),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.push("transform")
|
||||||
gc.origin()
|
gc.origin()
|
||||||
if restartCount>0 then
|
if restartCount>0 then
|
||||||
@@ -545,8 +559,8 @@ function Pnt.pause()
|
|||||||
|
|
||||||
--Mode Info
|
--Mode Info
|
||||||
_=drawableText.modeName
|
_=drawableText.modeName
|
||||||
gc.draw(_,40,180)
|
gc.draw(_,40,170)
|
||||||
gc.draw(drawableText.levelName,60+_:getWidth(),180)
|
gc.draw(drawableText.levelName,60+_:getWidth(),170)
|
||||||
|
|
||||||
--Result Text
|
--Result Text
|
||||||
setFont(35)
|
setFont(35)
|
||||||
@@ -843,6 +857,6 @@ function Pnt.history()
|
|||||||
gc.rectangle("line",30,45,1000,632)
|
gc.rectangle("line",30,45,1000,632)
|
||||||
setFont(20)
|
setFont(20)
|
||||||
local _=sceneTemp
|
local _=sceneTemp
|
||||||
gc.print(_[1][_[2]],40,50)
|
gc.print(_.text[_.pos],40,50)
|
||||||
end
|
end
|
||||||
return Pnt
|
return Pnt
|
||||||
@@ -1,20 +1,9 @@
|
|||||||
local gc=love.graphics
|
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 rnd,sin,cos=math.random,math.sin,math.cos
|
||||||
local format=string.format
|
local format=string.format
|
||||||
local scr=scr
|
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={}
|
local sceneInit={}
|
||||||
sceneInit.quit=love.event.quit
|
sceneInit.quit=love.event.quit
|
||||||
@@ -50,11 +39,18 @@ end
|
|||||||
function sceneInit.main()
|
function sceneInit.main()
|
||||||
BG.set("space")
|
BG.set("space")
|
||||||
BGM.play("blank")
|
BGM.play("blank")
|
||||||
destroyPlayers()
|
|
||||||
|
game.frame=0
|
||||||
|
game.recording=false
|
||||||
|
game.replaying=false
|
||||||
|
game.seed=1046101471
|
||||||
|
game.rec={}
|
||||||
|
|
||||||
modeEnv={}
|
modeEnv={}
|
||||||
if not players[1]then
|
destroyPlayers()
|
||||||
PLY.newDemoPlayer(1,900,35,1.1)
|
|
||||||
end--Create demo player
|
--Create demo player
|
||||||
|
PLY.newDemoPlayer(1,900,35,1.1)
|
||||||
end
|
end
|
||||||
function sceneInit.music()
|
function sceneInit.music()
|
||||||
if BGM.nowPlay then
|
if BGM.nowPlay then
|
||||||
@@ -120,18 +116,18 @@ function sceneInit.pause(org)
|
|||||||
timer=org=="play"and 0 or 50,
|
timer=org=="play"and 0 or 50,
|
||||||
list={
|
list={
|
||||||
toTime(S.time),
|
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 %.2fPPS",S.piece,S.piece/S.time),
|
||||||
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
|
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
|
||||||
format("%d(%d)",S.atk,S.digatk),
|
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)",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.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.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/%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[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
|
||||||
},
|
},
|
||||||
|
|
||||||
--from right-down, 60 degree each
|
--From right-down, 60 degree each
|
||||||
radar={
|
radar={
|
||||||
(S.off+S.dig)/S.time*60,--DefPM
|
(S.off+S.dig)/S.time*60,--DefPM
|
||||||
(S.off)/S.time*60, --OffPM
|
(S.off)/S.time*60, --OffPM
|
||||||
@@ -186,7 +182,10 @@ function sceneInit.setting_video()
|
|||||||
BG.set("space")
|
BG.set("space")
|
||||||
end
|
end
|
||||||
function sceneInit.setting_sound()
|
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")
|
BG.set("space")
|
||||||
end
|
end
|
||||||
function sceneInit.setting_control()
|
function sceneInit.setting_control()
|
||||||
@@ -207,7 +206,7 @@ function sceneInit.setting_key()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
function sceneInit.setting_touch()
|
function sceneInit.setting_touch()
|
||||||
BG.set("game2")
|
BG.set("game3")
|
||||||
sceneTemp={
|
sceneTemp={
|
||||||
default=1,
|
default=1,
|
||||||
snap=1,
|
snap=1,
|
||||||
@@ -265,12 +264,19 @@ function sceneInit.stat()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function sceneInit.history()
|
function sceneInit.history()
|
||||||
BG.set("game1")
|
BG.set("game3")
|
||||||
sceneTemp={require("parts/updateLog"),1}--scroll pos
|
sceneTemp={
|
||||||
|
text=require("parts/updateLog"),--Text list
|
||||||
|
pos=1,--Scroll pos
|
||||||
|
}
|
||||||
|
if newVersionLaunch then
|
||||||
|
newVersionLaunch=nil
|
||||||
|
sceneTemp.pos=4
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function sceneInit.debug()
|
function sceneInit.debug()
|
||||||
sceneTemp={
|
sceneTemp={
|
||||||
ct=0,
|
reset=false,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
function sceneInit.quit()
|
function sceneInit.quit()
|
||||||
@@ -282,40 +288,47 @@ function sceneInit.quit()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local sceneBack={}
|
||||||
|
function sceneBack.load()
|
||||||
|
love.event.quit()
|
||||||
|
end
|
||||||
|
function sceneBack.pause()
|
||||||
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
mergeStat(stat,players[1].stat)
|
||||||
|
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
|
||||||
|
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 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)
|
|
||||||
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,
|
|
||||||
}
|
|
||||||
function SCN.swapUpdate()
|
function SCN.swapUpdate()
|
||||||
local S=SCN.swap
|
local S=SCN.swap
|
||||||
S.time=S.time-1
|
S.time=S.time-1
|
||||||
@@ -342,9 +355,38 @@ function SCN.push(tar,style)
|
|||||||
end
|
end
|
||||||
function SCN.pop()
|
function SCN.pop()
|
||||||
local _=SCN.seq
|
local _=SCN.seq
|
||||||
_[#_-1]=nil
|
_[#_],_[#_-1]=nil
|
||||||
end
|
end
|
||||||
function SCN.swapTo(tar,style)
|
|
||||||
|
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.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},
|
||||||
|
swipe={30,15,function(t)
|
||||||
|
gc.setColor(0,0,0,1-abs(t-15)/15)
|
||||||
|
if t>15 then
|
||||||
|
t=t/15-1
|
||||||
|
gc.rectangle("fill",scr.w*scr.dpi,0,-scr.w*scr.dpi*(1-t),scr.h*scr.dpi)
|
||||||
|
else
|
||||||
|
gc.rectangle("fill",0,0,scr.w*scr.dpi*t/15,scr.h*scr.dpi)
|
||||||
|
end
|
||||||
|
end},
|
||||||
|
}--Scene swapping animations
|
||||||
|
function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
|
||||||
local S=SCN.swap
|
local S=SCN.swap
|
||||||
if not SCN.swapping and tar~=SCN.cur then
|
if not SCN.swapping and tar~=SCN.cur then
|
||||||
SCN.swapping=true
|
SCN.swapping=true
|
||||||
@@ -357,17 +399,18 @@ function SCN.swapTo(tar,style)
|
|||||||
S.draw=swap[3]
|
S.draw=swap[3]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function SCN.goto(tar,style)
|
function SCN.goto(tar,style)--Normal scene swapping, can back
|
||||||
SCN.push()SCN.swapTo(tar,style)
|
SCN.push()SCN.swapTo(tar,style)
|
||||||
end
|
end
|
||||||
function SCN.back()
|
function SCN.back()
|
||||||
if backFunc[SCN.cur] then backFunc[SCN.cur]()end
|
--Leave scene
|
||||||
--func when scene end
|
if sceneBack[SCN.cur] then sceneBack[SCN.cur]()end
|
||||||
|
|
||||||
|
--Poll&Back to previous Scene
|
||||||
local m=#SCN.seq
|
local m=#SCN.seq
|
||||||
if m>0 then
|
if m>0 then
|
||||||
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
|
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
|
||||||
SCN.seq[m],SCN.seq[m-1]=nil
|
SCN.seq[m],SCN.seq[m-1]=nil
|
||||||
--Poll&Back to preScene
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return SCN
|
return SCN
|
||||||
@@ -38,7 +38,7 @@ function SFX.fieldPlay(s,v,P)
|
|||||||
end
|
end
|
||||||
function SFX.play(s,vol,pos,force)
|
function SFX.play(s,vol,pos,force)
|
||||||
if setting.sfx==0 and not force then return end
|
if setting.sfx==0 and not force then return end
|
||||||
local S=SFX.list[s]--source list
|
local S=SFX.list[s]--Source list
|
||||||
if not S then return end
|
if not S then return end
|
||||||
local n=1
|
local n=1
|
||||||
while S[n]:isPlaying()do
|
while S[n]:isPlaying()do
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ return{
|
|||||||
aura=N("aura"),
|
aura=N("aura"),
|
||||||
gradient1=N("grad1"),--Horizonal red-blue gradient
|
gradient1=N("grad1"),--Horizonal red-blue gradient
|
||||||
gradient2=N("grad2"),--Vertical red-green gradient
|
gradient2=N("grad2"),--Vertical red-green gradient
|
||||||
rgb1=N("rgb1"),--colorful RGB
|
rgb1=N("rgb1"),--Colorful RGB
|
||||||
rgb2=N("rgb2"),--blue RGB
|
rgb2=N("rgb2"),--Blue RGB
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,9 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
|||||||
float x=scr_pos.x/w;
|
float x=scr_pos.x/w;
|
||||||
float y=scr_pos.y/h;
|
float y=scr_pos.y/h;
|
||||||
return vec4(
|
return vec4(
|
||||||
.8-y*.6-.2*sin(t/6.26),
|
.8-y*.7+.2*sin(t/6.26),
|
||||||
.3+.1*sin(t),
|
.2+y*.5+.15*sin(t/4.),
|
||||||
.2+x*.6,
|
.2+x*.6-.1*sin(t/2.83),
|
||||||
1.
|
1.
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ local TEXT={}
|
|||||||
function TEXT.clear()
|
function TEXT.clear()
|
||||||
texts={}
|
texts={}
|
||||||
end
|
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{
|
return{
|
||||||
c=0,
|
c=0,
|
||||||
text=text,
|
text=text,
|
||||||
@@ -85,17 +85,17 @@ function TEXT.getText(text,x,y,font,style,spd,stop)
|
|||||||
stop=stop,
|
stop=stop,
|
||||||
draw=textFX[style]or assert(false,"unavailable type:"..style),
|
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)
|
function TEXT.show(text,x,y,font,style,spd,stop)
|
||||||
texts[#texts+1]={
|
texts[#texts+1]={
|
||||||
c=0, --timer
|
c=0, --Timer
|
||||||
text=text, --string
|
text=text, --String
|
||||||
x=x or 0, --x
|
x=x or 0, --X
|
||||||
y=y or 0, --y
|
y=y or 0, --Y
|
||||||
font=font or 40, --font
|
font=font or 40, --Font
|
||||||
spd=(spd or 1)/60, --timing speed(1=last 1 sec)
|
spd=(spd or 1)/60, --Timing speed(1=last 1 sec)
|
||||||
stop=stop, --stop time(sustained text)
|
stop=stop, --Stop time(sustained text)
|
||||||
draw=textFX[style]or assert(false,"unavailable type:"..style), --draw method
|
draw=textFX[style]or assert(false,"unavailable type:"..style), --Draw method
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
function TEXT.update(list)
|
function TEXT.update(list)
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ function Tmr.load()
|
|||||||
elseif S.phase==4 then
|
elseif S.phase==4 then
|
||||||
IMG.loadOne(S.cur)
|
IMG.loadOne(S.cur)
|
||||||
elseif S.phase==5 then
|
elseif S.phase==5 then
|
||||||
local m=Modes[S.cur]--mode template
|
local m=Modes[S.cur]--Mode template
|
||||||
local M=require("modes/"..m.name)--mode file
|
local M=require("modes/"..m.name)--Mode file
|
||||||
Modes[m.name],Modes[S.cur]=M
|
Modes[m.name],Modes[S.cur]=M
|
||||||
for k,v in next,m do
|
for k,v in next,m do
|
||||||
M[k]=v
|
M[k]=v
|
||||||
@@ -38,7 +38,12 @@ function Tmr.load()
|
|||||||
S.cur=S.cur+1
|
S.cur=S.cur+1
|
||||||
S.tar=S.cur
|
S.tar=S.cur
|
||||||
if S.cur>62.6 then
|
if S.cur>62.6 then
|
||||||
SCN.swapTo("intro","none")
|
if newVersionLaunch then
|
||||||
|
SCN.push("intro","fade")
|
||||||
|
SCN.swapTo("history","fade")
|
||||||
|
else
|
||||||
|
SCN.swapTo("intro","none")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -62,25 +67,6 @@ end
|
|||||||
function Tmr.main(dt)
|
function Tmr.main(dt)
|
||||||
players[1]:update(dt)
|
players[1]:update(dt)
|
||||||
end
|
end
|
||||||
local function dumpTable(L)
|
|
||||||
local s="{\n"
|
|
||||||
for k,v in next,L do
|
|
||||||
local T
|
|
||||||
T=type(k)
|
|
||||||
if T=="number"then k="["..k.."]="
|
|
||||||
elseif T=="string"then k=k.."="
|
|
||||||
else assert(false,"Error data type!")
|
|
||||||
end
|
|
||||||
T=type(v)
|
|
||||||
if T=="number"then v=tostring(v)
|
|
||||||
elseif T=="string"then v="\""..v.."\""
|
|
||||||
elseif T=="table"then v=dumpTable(v)
|
|
||||||
else assert(false,"Error data type!")
|
|
||||||
end
|
|
||||||
s=s..k..v..",\n"
|
|
||||||
end
|
|
||||||
return s.."}"
|
|
||||||
end
|
|
||||||
function Tmr.mode(dt)
|
function Tmr.mode(dt)
|
||||||
local cam=mapCam
|
local cam=mapCam
|
||||||
local x,y,k=cam.x,cam.y,cam.k
|
local x,y,k=cam.x,cam.y,cam.k
|
||||||
@@ -132,7 +118,7 @@ function Tmr.mode(dt)
|
|||||||
elseif y<-1900*k then y=-1900*k
|
elseif y<-1900*k then y=-1900*k
|
||||||
end
|
end
|
||||||
cam.x,cam.y=x,y
|
cam.x,cam.y=x,y
|
||||||
--keyboard controlling
|
--Keyboard controlling
|
||||||
|
|
||||||
cam.x1=cam.x1*.85+x*.15
|
cam.x1=cam.x1*.85+x*.15
|
||||||
cam.y1=cam.y1*.85+y*.15
|
cam.y1=cam.y1*.85+y*.15
|
||||||
@@ -160,9 +146,11 @@ function Tmr.draw()
|
|||||||
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
||||||
end
|
end
|
||||||
function Tmr.play(dt)
|
function Tmr.play(dt)
|
||||||
|
local _
|
||||||
game.frame=game.frame+1
|
game.frame=game.frame+1
|
||||||
stat.time=stat.time+dt
|
stat.time=stat.time+dt
|
||||||
local P1=players[1]
|
|
||||||
|
--Update attack FX
|
||||||
for i=#FX_attack,1,-1 do
|
for i=#FX_attack,1,-1 do
|
||||||
local b=FX_attack[i]
|
local b=FX_attack[i]
|
||||||
b.t=b.t+1
|
b.t=b.t+1
|
||||||
@@ -170,15 +158,16 @@ function Tmr.play(dt)
|
|||||||
b.rad=b.rad*1.05+.1
|
b.rad=b.rad*1.05+.1
|
||||||
b.x,b.y=b.x2,b.y2
|
b.x,b.y=b.x2,b.y2
|
||||||
elseif b.t>10 then
|
elseif b.t>10 then
|
||||||
local t=((b.t-10)*.025)t=(3-2*t)*t*t
|
_=(b.t-10)*.025
|
||||||
b.x,b.y=b.x1*(1-t)+b.x2*t,b.y1*(1-t)+b.y2*t
|
_=(3-2*_)*_*_
|
||||||
|
b.x,b.y=b.x1*(1-_)+b.x2*_,b.y1*(1-_)+b.y2*_
|
||||||
end
|
end
|
||||||
if b.t<60 then
|
if b.t<60 then
|
||||||
local L=FX_attack[i].drag
|
_=FX_attack[i].drag
|
||||||
if #L==4*setting.atkFX then
|
if #_==4*setting.atkFX then
|
||||||
rem(L,1)rem(L,1)
|
rem(_,1)rem(_,1)
|
||||||
end
|
end
|
||||||
ins(L,b.x)ins(L,b.y)
|
ins(_,b.x)ins(_,b.y)
|
||||||
else
|
else
|
||||||
for i=i,#FX_attack do
|
for i=i,#FX_attack do
|
||||||
FX_attack[i]=FX_attack[i+1]
|
FX_attack[i]=FX_attack[i+1]
|
||||||
@@ -186,6 +175,7 @@ function Tmr.play(dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Update badge FX
|
||||||
for i=#FX_badge,1,-1 do
|
for i=#FX_badge,1,-1 do
|
||||||
local b=FX_badge[i]
|
local b=FX_badge[i]
|
||||||
b.t=b.t+1
|
b.t=b.t+1
|
||||||
@@ -193,14 +183,38 @@ function Tmr.play(dt)
|
|||||||
rem(FX_badge,i)
|
rem(FX_badge,i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local _
|
|
||||||
for i=1,#virtualkey do
|
--Update virtualkey animation
|
||||||
_=virtualkey[i]
|
if setting.VKSwitch then
|
||||||
if _.pressTime>0 then
|
for i=1,#virtualkey do
|
||||||
_.pressTime=_.pressTime-1
|
_=virtualkey[i]
|
||||||
|
if _.pressTime>0 then
|
||||||
|
_.pressTime=_.pressTime-1
|
||||||
|
end
|
||||||
end
|
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<180 then
|
||||||
if game.frame==179 then
|
if game.frame==179 then
|
||||||
gameStart()
|
gameStart()
|
||||||
@@ -224,26 +238,31 @@ function Tmr.play(dt)
|
|||||||
if restartCount>20 then
|
if restartCount>20 then
|
||||||
TASK.clear("play")
|
TASK.clear("play")
|
||||||
mergeStat(stat,P1.stat)
|
mergeStat(stat,P1.stat)
|
||||||
resetGameData()
|
resetPartGameData()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
elseif restartCount>0 then
|
elseif restartCount>0 then
|
||||||
restartCount=restartCount>2 and restartCount-2 or 0
|
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
|
for p=1,#players do
|
||||||
local P=players[p]
|
local P=players[p]
|
||||||
P:update(dt)
|
P:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Fresh royale target
|
||||||
if game.frame%120==0 then
|
if game.frame%120==0 then
|
||||||
if modeEnv.royaleMode then freshMostDangerous()end
|
if modeEnv.royaleMode then freshMostDangerous()end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Warning check
|
||||||
if P1.alive then
|
if P1.alive then
|
||||||
if game.frame%26==0 and setting.warn then
|
if game.frame%26==0 and setting.warn then
|
||||||
local F=P1.field
|
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 x=4,7 do
|
||||||
for y=M,1,-1 do
|
for y=#F,1,-1 do
|
||||||
if F[y][x]>0 then
|
if F[y][x]>0 then
|
||||||
if y>height then
|
if y>height then
|
||||||
height=y
|
height=y
|
||||||
@@ -254,13 +273,13 @@ function Tmr.play(dt)
|
|||||||
end
|
end
|
||||||
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
|
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
|
||||||
end
|
end
|
||||||
local M=game.warnLVL
|
_=game.warnLVL
|
||||||
if M<game.warnLVL0 then
|
if _<game.warnLVL0 then
|
||||||
M=M*.95+game.warnLVL0*.05
|
_=_*.95+game.warnLVL0*.05
|
||||||
elseif M>0 then
|
elseif _>0 then
|
||||||
M=max(M-.026,0)
|
_=max(_-.026,0)
|
||||||
end
|
end
|
||||||
game.warnLVL=M
|
game.warnLVL=_
|
||||||
elseif game.warnLVL>0 then
|
elseif game.warnLVL>0 then
|
||||||
game.warnLVL=max(game.warnLVL-.026,0)
|
game.warnLVL=max(game.warnLVL-.026,0)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ local function getVoice(str)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
return L[n]
|
return L[n]
|
||||||
--load voice with string
|
--Load voice with string
|
||||||
end
|
end
|
||||||
function VOC.loadOne(_)
|
function VOC.loadOne(_)
|
||||||
local N=VOC.name[_]
|
local N=VOC.name[_]
|
||||||
@@ -94,21 +94,21 @@ function VOC.update()
|
|||||||
Q[1]:setVolume(setting.voc*.1)
|
Q[1]:setVolume(setting.voc*.1)
|
||||||
Q[1]:play()
|
Q[1]:play()
|
||||||
Q.s=Q[2]and 2 or 4
|
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
|
if Q[1]:getDuration()-Q[1]:tell()<.08 then
|
||||||
Q[2]=getVoice(Q[2])
|
Q[2]=getVoice(Q[2])
|
||||||
Q[2]:setVolume(setting.voc*.1)
|
Q[2]:setVolume(setting.voc*.1)
|
||||||
Q[2]:play()
|
Q[2]:play()
|
||||||
Q.s=3
|
Q.s=3
|
||||||
end
|
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
|
if not Q[1]:isPlaying()then
|
||||||
for i=1,#Q do
|
for i=1,#Q do
|
||||||
Q[i]=Q[i+1]
|
Q[i]=Q[i+1]
|
||||||
end
|
end
|
||||||
Q.s=Q[2]and 2 or 4
|
Q.s=Q[2]and 2 or 4
|
||||||
end
|
end
|
||||||
elseif Q.s==4 then--playing last
|
elseif Q.s==4 then--Playing last
|
||||||
if not Q[1].isPlaying(Q[1])then
|
if not Q[1].isPlaying(Q[1])then
|
||||||
Q[1]=nil
|
Q[1]=nil
|
||||||
Q.s=0
|
Q.s=0
|
||||||
@@ -124,10 +124,10 @@ function VOC.play(s,chn)
|
|||||||
if not _ then print("no VOC called:"..s)return end
|
if not _ then print("no VOC called:"..s)return end
|
||||||
L[#L+1]=_[rnd(#_)]
|
L[#L+1]=_[rnd(#_)]
|
||||||
L.s=1
|
L.s=1
|
||||||
--add to queue[chn]
|
--Add to queue[chn]
|
||||||
else
|
else
|
||||||
voiceQueue[VOC.getFreeChannel()]={s=1,VOC.list[s][rnd(#VOC.list[s])]}
|
voiceQueue[VOC.getFreeChannel()]={s=1,VOC.list[s][rnd(#VOC.list[s])]}
|
||||||
--create new channel & play
|
--Create new channel & play
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,48 +3,62 @@ local kb=love.keyboard
|
|||||||
local int,abs=math.floor,math.abs
|
local int,abs=math.floor,math.abs
|
||||||
local format=string.format
|
local format=string.format
|
||||||
local color=color
|
local color=color
|
||||||
|
local setFont=setFont
|
||||||
local EMPTY={}
|
|
||||||
|
|
||||||
local button={
|
local button={
|
||||||
type="button",
|
type="button",
|
||||||
ATV=0,--activating time(0~8)
|
ATV=0,--Activating time(0~8)
|
||||||
}
|
}
|
||||||
function button:reset()
|
function button:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
end
|
end
|
||||||
function button:isAbove(x,y)
|
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
|
end
|
||||||
function button:getCenter()
|
function button:getCenter()
|
||||||
return self.x+self.w*.5,self.y+self.h*.5
|
return self.x+self.w*.5,self.y+self.h*.5
|
||||||
end
|
end
|
||||||
function button:FX()
|
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.new(
|
||||||
|
"ripple",
|
||||||
|
.16,
|
||||||
|
self.x-ATV,
|
||||||
|
self.y-ATV,
|
||||||
|
self.w+2*ATV,
|
||||||
|
self.h+2*ATV
|
||||||
|
)
|
||||||
end
|
end
|
||||||
function button:update()
|
function button:update()
|
||||||
|
local ATV=self.ATV
|
||||||
if WIDGET.sel==self then
|
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
|
else
|
||||||
if self.ATV>0 then self.ATV=self.ATV-1 end
|
if ATV>0 then self.ATV=ATV-.5 end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function button:draw()
|
function button:draw()
|
||||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||||
|
local ATV=self.ATV
|
||||||
local r,g,b=unpack(self.color)
|
local r,g,b=unpack(self.color)
|
||||||
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
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)
|
gc.rectangle("fill",x-ATV,y-ATV,w+2*ATV,h+2*ATV)
|
||||||
if self.ATV>0 then
|
if ATV>0 then
|
||||||
gc.setLineWidth(4)
|
gc.setLineWidth(4)
|
||||||
gc.setColor(1,1,1,self.ATV*.125)
|
gc.setColor(1,1,1,ATV*.125)
|
||||||
gc.rectangle("line",x-self.ATV+2,y-self.ATV+2,w+2*self.ATV-4,h+2*self.ATV-4)
|
gc.rectangle("line",x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4)
|
||||||
end
|
end
|
||||||
local t=self.text
|
local t=self.text
|
||||||
if t then
|
if t then
|
||||||
if type(t)=="function"then t=t()end
|
if type(t)=="function"then t=t()end
|
||||||
setFont(self.font)
|
setFont(self.font)
|
||||||
local y0=y+h*.5-self.font*.7
|
local y0=y+h*.5-self.font*.7-ATV*.5
|
||||||
gc.setColor(1,1,1,.3)
|
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")
|
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")
|
||||||
@@ -57,10 +71,60 @@ 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))
|
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))
|
||||||
end
|
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()
|
||||||
|
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))
|
||||||
|
end
|
||||||
|
|
||||||
local switch={
|
local switch={
|
||||||
type="switch",
|
type="switch",
|
||||||
ATV=0,--activating time(0~8)
|
ATV=0,--Activating time(0~8)
|
||||||
CHK=0,--check alpha(0~6)
|
CHK=0,--Check alpha(0~6)
|
||||||
}
|
}
|
||||||
function switch:reset()
|
function switch:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
@@ -75,7 +139,7 @@ end
|
|||||||
function switch:update()
|
function switch:update()
|
||||||
local _=self.ATV
|
local _=self.ATV
|
||||||
if WIDGET.sel==self then if _<8 then self.ATV=_+1 end
|
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
|
end
|
||||||
_=self.CHK
|
_=self.CHK
|
||||||
if self:disp()then if _<6 then self.CHK=_+1 end
|
if self:disp()then if _<6 then self.CHK=_+1 end
|
||||||
@@ -84,10 +148,11 @@ function switch:update()
|
|||||||
end
|
end
|
||||||
function switch:draw()
|
function switch:draw()
|
||||||
local x,y=self.x,self.y-25
|
local x,y=self.x,self.y-25
|
||||||
|
local ATV=self.ATV
|
||||||
|
|
||||||
--Checked
|
--Checked
|
||||||
if self.ATV>0 then
|
if ATV>0 then
|
||||||
gc.setColor(1,1,1,self.ATV*.08)
|
gc.setColor(1,1,1,ATV*.08)
|
||||||
gc.rectangle("fill",x,y,50,50)
|
gc.rectangle("fill",x,y,50,50)
|
||||||
end
|
end
|
||||||
if self.CHK>0 then
|
if self.CHK>0 then
|
||||||
@@ -98,7 +163,7 @@ function switch:draw()
|
|||||||
|
|
||||||
--Frame
|
--Frame
|
||||||
gc.setLineWidth(4)
|
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)
|
gc.rectangle("line",x,y,50,50)
|
||||||
|
|
||||||
--Text
|
--Text
|
||||||
@@ -106,7 +171,7 @@ function switch:draw()
|
|||||||
if t then
|
if t then
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
setFont(self.font)
|
setFont(self.font)
|
||||||
gc.printf(t,x-412,y+20-self.font*.7,400,"right")
|
gc.printf(t,x-412-ATV,y+20-self.font*.7-ATV*.5,400,"right")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function switch:getInfo()
|
function switch:getInfo()
|
||||||
@@ -115,8 +180,8 @@ end
|
|||||||
|
|
||||||
local slider={
|
local slider={
|
||||||
type="slider",
|
type="slider",
|
||||||
ATV=0,--activating time(0~8)
|
ATV=0,--Activating time(0~8)
|
||||||
pos=0,--position shown
|
pos=0,--Position shown
|
||||||
}
|
}
|
||||||
function slider:reset()
|
function slider:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
@@ -133,7 +198,7 @@ function slider:update()
|
|||||||
if WIDGET.sel==self then
|
if WIDGET.sel==self then
|
||||||
if _<6 then self.ATV=_+1 end
|
if _<6 then self.ATV=_+1 end
|
||||||
else
|
else
|
||||||
if _>0 then self.ATV=_-1 end
|
if _>0 then self.ATV=_-.5 end
|
||||||
end
|
end
|
||||||
if not(self.hide and self.hide())then
|
if not(self.hide and self.hide())then
|
||||||
self.pos=self.pos*.7+self.disp()*.3
|
self.pos=self.pos*.7+self.disp()*.3
|
||||||
@@ -141,9 +206,10 @@ function slider:update()
|
|||||||
end
|
end
|
||||||
function slider:draw()
|
function slider:draw()
|
||||||
local x,y=self.x,self.y
|
local x,y=self.x,self.y
|
||||||
|
local ATV=self.ATV
|
||||||
|
|
||||||
--Units
|
--Units
|
||||||
gc.setColor(1,1,1,.5+self.ATV*.06)
|
gc.setColor(1,1,1,.5+ATV*.06)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
local x1,x2=x,x+self.w
|
local x1,x2=x,x+self.w
|
||||||
for p=0,self.unit do
|
for p=0,self.unit do
|
||||||
@@ -155,22 +221,22 @@ function slider:draw()
|
|||||||
gc.setLineWidth(4)
|
gc.setLineWidth(4)
|
||||||
gc.line(x1,y,x2,y)
|
gc.line(x1,y,x2,y)
|
||||||
|
|
||||||
|
--Block
|
||||||
|
local bx,by,bw,bh=x1+(x2-x1)*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
|
--Text
|
||||||
local t=self.text
|
local t=self.text
|
||||||
if t then
|
if t then
|
||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
setFont(self.font)
|
setFont(self.font)
|
||||||
gc.printf(t,x-312,y-self.font*.7,300,"right")
|
gc.printf(t,x-312-ATV,y-self.font*.7-ATV*.5,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)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function slider:getInfo()
|
function slider:getInfo()
|
||||||
@@ -178,15 +244,17 @@ function slider:getInfo()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local WIDGET={}
|
local WIDGET={}
|
||||||
WIDGET.active=EMPTY--table, contains all active widgets
|
WIDGET.active={}--Table, contains all active widgets
|
||||||
WIDGET.sel=nil--selected widget
|
WIDGET.sel=nil--Selected widget
|
||||||
function WIDGET.set(L)
|
function WIDGET.set(L)
|
||||||
WIDGET.sel=nil
|
WIDGET.sel=nil
|
||||||
WIDGET.active=L or EMPTY
|
WIDGET.active=L or{}
|
||||||
|
|
||||||
|
--Reset all widgets
|
||||||
if L then
|
if L then
|
||||||
for _,W in next,L do
|
for _,W in next,L do
|
||||||
W:reset()
|
W:reset()
|
||||||
end--Reset all widgets
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -238,6 +306,29 @@ function WIDGET.newButton(D)
|
|||||||
hide= D.hide,
|
hide= D.hide,
|
||||||
}for k,v in next,button do _[k]=v end return _
|
}for k,v in next,button do _[k]=v end return _
|
||||||
end
|
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)
|
function WIDGET.newSwitch(D)
|
||||||
local _={
|
local _={
|
||||||
name= D.name,
|
name= D.name,
|
||||||
@@ -301,6 +392,9 @@ function WIDGET.press(x,y)
|
|||||||
W:FX()
|
W:FX()
|
||||||
SFX.play("button")
|
SFX.play("button")
|
||||||
VOC.play("nya")
|
VOC.play("nya")
|
||||||
|
elseif W.type=="key"then
|
||||||
|
W.code()
|
||||||
|
SFX.play("lock")
|
||||||
elseif W.type=="switch"then
|
elseif W.type=="switch"then
|
||||||
W.code()
|
W.code()
|
||||||
SFX.play("move",.6)
|
SFX.play("move",.6)
|
||||||
@@ -331,7 +425,7 @@ function WIDGET.keyPressed(i)
|
|||||||
WIDGET.press()
|
WIDGET.press()
|
||||||
end
|
end
|
||||||
elseif kb.isDown("lshift","lalt","lctrl")then
|
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
|
if i=="left"or i=="right"then
|
||||||
local W=WIDGET.sel
|
local W=WIDGET.sel
|
||||||
if W then
|
if W then
|
||||||
@@ -354,7 +448,7 @@ function WIDGET.keyPressed(i)
|
|||||||
if i=="left"or i=="right"then
|
if i=="left"or i=="right"then
|
||||||
for i=1,#WIDGET.active do
|
for i=1,#WIDGET.active do
|
||||||
local W1=WIDGET.active[i]
|
local W1=WIDGET.active[i]
|
||||||
if W~=W1 then
|
if W~=W1 and W1.resCtr then
|
||||||
local L=W1.resCtr
|
local L=W1.resCtr
|
||||||
for j=1,#L,2 do
|
for j=1,#L,2 do
|
||||||
local x,y=L[j],L[j+1]
|
local x,y=L[j],L[j+1]
|
||||||
@@ -372,7 +466,7 @@ function WIDGET.keyPressed(i)
|
|||||||
else
|
else
|
||||||
for i=1,#WIDGET.active do
|
for i=1,#WIDGET.active do
|
||||||
local W1=WIDGET.active[i]
|
local W1=WIDGET.active[i]
|
||||||
if W~=W1 then
|
if W~=W1 and W1.resCtr then
|
||||||
local L=W1.resCtr
|
local L=W1.resCtr
|
||||||
for j=1,#L,2 do
|
for j=1,#L,2 do
|
||||||
local x,y=L[j],L[j+1]
|
local x,y=L[j],L[j+1]
|
||||||
@@ -396,21 +490,25 @@ function WIDGET.keyPressed(i)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local keyMirror={
|
||||||
|
dpup="up",
|
||||||
|
dpdown="down",
|
||||||
|
dpleft="left",
|
||||||
|
dpright="right",
|
||||||
|
start="return",
|
||||||
|
back="escape",
|
||||||
|
}
|
||||||
function WIDGET.gamepadPressed(i)
|
function WIDGET.gamepadPressed(i)
|
||||||
if i=="dpup"or i=="dpdown"then
|
if i=="start"then
|
||||||
if WIDGET.sel then
|
if WIDGET.sel then
|
||||||
WIDGET.sel=i=="dpup"and WIDGET.sel.prev or WIDGET.sel.next or WIDGET.sel
|
WIDGET.press()
|
||||||
else
|
|
||||||
WIDGET.sel=select(2,next(WIDGET.active))
|
|
||||||
end
|
end
|
||||||
elseif i=="start"then
|
elseif i=="a"or i=="b"then
|
||||||
if WIDGET.sel then
|
local W=WIDGET.sel
|
||||||
WIDGET.press(WIDGET.sel)
|
if W then
|
||||||
end
|
if W.type=="button"or W.type=="key"then
|
||||||
elseif i=="dpleft"or i=="dpright"then
|
WIDGET.press()
|
||||||
if WIDGET.sel then
|
elseif W.type=="slider"then
|
||||||
local W=WIDGET.sel
|
|
||||||
if W.type=="slider"then
|
|
||||||
local p=W.disp()
|
local p=W.disp()
|
||||||
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1
|
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1
|
||||||
if p==P or not P then return end
|
if p==P or not P then return end
|
||||||
@@ -418,6 +516,8 @@ function WIDGET.gamepadPressed(i)
|
|||||||
if W.change then W.change()end
|
if W.change then W.change()end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
|
||||||
|
WIDGET.keyPressed(keyMirror[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -87,10 +87,11 @@ 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 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
|
local function setLang(n) return function()LANG.set(n)setting.lang=n end end
|
||||||
|
|
||||||
--newXXX
|
--NewXXX
|
||||||
newText=WIDGET.newText
|
newText=WIDGET.newText
|
||||||
newImage=WIDGET.newImage
|
newImage=WIDGET.newImage
|
||||||
newButton=WIDGET.newButton
|
newButton=WIDGET.newButton
|
||||||
|
newKey=WIDGET.newKey
|
||||||
newSwitch=WIDGET.newSwitch
|
newSwitch=WIDGET.newSwitch
|
||||||
newSlider=WIDGET.newSlider
|
newSlider=WIDGET.newSlider
|
||||||
|
|
||||||
@@ -103,12 +104,12 @@ local Widgets={
|
|||||||
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.goto("music")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="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="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="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.goto("setting_lang")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="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")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={
|
mode={
|
||||||
newButton({name="setting",x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
|
newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
|
||||||
SCN.goto("custom")
|
SCN.goto("custom")
|
||||||
end,
|
end,
|
||||||
hide=function()
|
hide=function()
|
||||||
@@ -118,17 +119,17 @@ local Widgets={
|
|||||||
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
|
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
music={
|
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=10, 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="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="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="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}),
|
newButton({name="back", x=640, y=630, w=230,h=90, color="white", font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
custom={
|
custom={
|
||||||
newButton({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
|
newKey({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}),
|
newKey({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")}),
|
newKey({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="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="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")}),
|
newButton({name="set2", x=940, y=400, w=260,h=70, color="lYellow",font=32,code=pressKey("2")}),
|
||||||
@@ -141,87 +142,83 @@ local Widgets={
|
|||||||
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
||||||
},
|
},
|
||||||
sequence={
|
sequence={
|
||||||
newButton({name="Z", x=150, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
|
newKey({name="Z", x=100, 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)}),
|
newKey({name="S", x=200, 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)}),
|
newKey({name="J", x=300, 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)}),
|
newKey({name="L", x=400, 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)}),
|
newKey({name="T", x=500, 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)}),
|
newKey({name="O", x=600, 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="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)}),
|
newKey({name="Z5", x=100, y=540, w=90,h=90, color="grey", font=50,code=pressKey(8)}),
|
||||||
newButton({name="S5", x=250, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(9)}),
|
newKey({name="S5", x=200, y=540, w=90,h=90, color="grey", font=50,code=pressKey(9)}),
|
||||||
newButton({name="P", x=350, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(10)}),
|
newKey({name="P", x=300, y=540, w=90,h=90, color="grey", font=50,code=pressKey(10)}),
|
||||||
newButton({name="Q", x=450, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(11)}),
|
newKey({name="Q", x=400, y=540, w=90,h=90, color="grey", font=50,code=pressKey(11)}),
|
||||||
newButton({name="F", x=550, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(12)}),
|
newKey({name="F", x=500, y=540, w=90,h=90, color="grey", font=50,code=pressKey(12)}),
|
||||||
newButton({name="E", x=650, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(13)}),
|
newKey({name="E", x=600, y=540, w=90,h=90, color="grey", font=50,code=pressKey(13)}),
|
||||||
newButton({name="T5", x=750, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(14)}),
|
newKey({name="T5", x=700, y=540, w=90,h=90, color="grey", font=50,code=pressKey(14)}),
|
||||||
newButton({name="U", x=850, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(15)}),
|
newKey({name="U", x=800, y=540, w=90,h=90, color="grey", font=50,code=pressKey(15)}),
|
||||||
newButton({name="V", x=950, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(16)}),
|
newKey({name="V", x=900, y=540, w=90,h=90, color="grey", font=50,code=pressKey(16)}),
|
||||||
newButton({name="W", x=150, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(17)}),
|
newKey({name="W", x=100, y=640, w=90,h=90, color="grey", font=50,code=pressKey(17)}),
|
||||||
newButton({name="X", x=250, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(18)}),
|
newKey({name="X", x=200, y=640, w=90,h=90, color="grey", font=50,code=pressKey(18)}),
|
||||||
newButton({name="J5", x=350, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(19)}),
|
newKey({name="J5", x=300, y=640, w=90,h=90, color="grey", font=50,code=pressKey(19)}),
|
||||||
newButton({name="L5", x=450, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(20)}),
|
newKey({name="L5", x=400, y=640, w=90,h=90, color="grey", font=50,code=pressKey(20)}),
|
||||||
newButton({name="R", x=550, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(21)}),
|
newKey({name="R", x=500, y=640, w=90,h=90, color="grey", font=50,code=pressKey(21)}),
|
||||||
newButton({name="Y", x=650, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(22)}),
|
newKey({name="Y", x=600, y=640, w=90,h=90, color="grey", font=50,code=pressKey(22)}),
|
||||||
newButton({name="N", x=750, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(23)}),
|
newKey({name="N", x=700, y=640, w=90,h=90, color="grey", font=50,code=pressKey(23)}),
|
||||||
newButton({name="H", x=850, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(24)}),
|
newKey({name="H", x=800, y=640, w=90,h=90, color="grey", 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="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")}),
|
newKey({name="left", x=800, 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")}),
|
newKey({name="right", x=900, 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")}),
|
newKey({name="backsp", x=1000, y=440, w=90,h=90, color="lYellow",font=50,code=pressKey("backspace")}),
|
||||||
newButton({name="reset", x=1050, y=540, w=90,h=90, color="lRed", font=50,code=pressKey("delete")}),
|
newKey({name="reset", x=1000, y=540, w=90,h=90, color="lYellow",font=50,code=pressKey("delete")}),
|
||||||
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
|
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={
|
draw={
|
||||||
newButton({name="b1", x=500+65*1, y=150,w=58,h=58, color="red", font=30,code=setPen(1)}),--B1
|
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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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")}),
|
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}),
|
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="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=function()pasteBoard()end}),
|
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=function()SCN.goto("custom")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="back", x=1200, y=640, w=120, h=120, color="white", font=35,code=BACK}),
|
||||||
},
|
},
|
||||||
play={
|
play={
|
||||||
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
|
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
|
||||||
},
|
},
|
||||||
pause={
|
pause={
|
||||||
newButton({name="resume", x=640,y=290,w=240,h=100,color="white",font=30,code=function()resumeGame()end}),
|
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}),
|
||||||
newButton({name="restart", x=640,y=445,w=240,h=100,color="white",font=33,code=function()
|
newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not game.result end}),
|
||||||
TASK.removeTask_code(TICK.autoPause)
|
newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}),
|
||||||
mergeStat(stat,players[1].stat)
|
newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=33,code=pressKey("r")}),
|
||||||
resetGameData()
|
newButton({name="quit", x=640, y=600, w=240,h=100,color="lGrey", font=35,code=BACK}),
|
||||||
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}),
|
|
||||||
},
|
},
|
||||||
setting_game={
|
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="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")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.goto("setting_control")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="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="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.goto("setting_touch")end}),
|
||||||
@@ -231,14 +228,14 @@ local Widgets={
|
|||||||
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function()
|
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function()
|
||||||
SCN.goto("setting_skin")
|
SCN.goto("setting_skin")
|
||||||
end}),
|
end}),
|
||||||
newSwitch({name="quickR", x=1050,y=320,font=35, disp=SETval("quickR"), code=SETrev("quickR")}),
|
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="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")}),
|
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}),
|
newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
setting_video={
|
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="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")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="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="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="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}),
|
||||||
@@ -249,30 +246,36 @@ local Widgets={
|
|||||||
newSlider({name="clearFX", x=350, y=460,w=373,unit=3, font=32,disp=SETval("clearFX"), code=SETsto("clearFX")}),
|
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="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="atkFX", x=350, y=580,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()
|
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
|
return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4
|
||||||
end,
|
end,
|
||||||
code=function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end}),
|
code=function(i)
|
||||||
newSwitch({name="text", x=1050, y=180, font=35,disp=SETval("text"),code=SETrev("text")}),
|
setting.frameMul=i<5 and 5*i+20 or 10*i
|
||||||
newSwitch({name="warn", x=1050, y=260, font=35,disp=SETval("warn"),code=SETrev("warn")}),
|
end}),
|
||||||
newSwitch({name="fullscreen",x=1050,y=340, font=35,disp=SETval("fullscreen"),code=function()
|
newSwitch({name="text", x=1050, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
|
||||||
setting.fullscreen=not setting.fullscreen
|
newSwitch({name="warn", x=1050, y=260,font=35,disp=SETval("warn"),code=SETrev("warn")}),
|
||||||
love.window.setFullscreen(setting.fullscreen)
|
newSwitch({name="fullscreen",x=1050,y=340,font=35,disp=SETval("fullscreen"),
|
||||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
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"),
|
||||||
|
code=function()
|
||||||
|
BG.set("none")
|
||||||
|
setting.bg=not setting.bg
|
||||||
|
BG.set("space")
|
||||||
|
end}),
|
||||||
|
newSwitch({name="power", x=1050, y=500,font=35,disp=SETval("powerInfo"),
|
||||||
|
code=function()
|
||||||
|
setting.powerInfo=not setting.powerInfo
|
||||||
end}),
|
end}),
|
||||||
newSwitch({name="bg", x=1050, y=420, font=35,disp=SETval("bg"),code=function()
|
|
||||||
BG.set("none")
|
|
||||||
setting.bg=not setting.bg
|
|
||||||
BG.set("space")
|
|
||||||
end}),
|
|
||||||
newSwitch({name="power", x=1050, y=500,font=35,disp=SETval("powerInfo"),code=function()
|
|
||||||
setting.powerInfo=not setting.powerInfo
|
|
||||||
end}),
|
|
||||||
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
setting_sound={
|
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="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")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=10,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
|
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="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="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")}),
|
||||||
@@ -289,11 +292,12 @@ local Widgets={
|
|||||||
newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}),
|
newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}),
|
||||||
newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}),
|
newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}),
|
||||||
newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}),
|
newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}),
|
||||||
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,code=function()
|
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
|
||||||
local _=setting
|
code=function()
|
||||||
_.das,_.arr=10,2
|
local _=setting
|
||||||
_.sddas,_.sdarr=0,2
|
_.das,_.arr=10,2
|
||||||
_.ihs,_.irs,_.ims=false,false,false
|
_.sddas,_.sdarr=0,2
|
||||||
|
_.ihs,_.irs,_.ims=false,false,false
|
||||||
end}),
|
end}),
|
||||||
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
@@ -324,46 +328,54 @@ local Widgets={
|
|||||||
newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",font=30,code=nextDir(3)}),
|
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="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="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="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,code=function()
|
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
|
||||||
setting.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3}
|
code=function()
|
||||||
SFX.play("rotate")
|
setting.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3}
|
||||||
|
SFX.play("rotate")
|
||||||
end}),
|
end}),
|
||||||
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,code=function()
|
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,
|
||||||
for i=1,25 do
|
code=function()
|
||||||
setting.face[i]=0
|
for i=1,25 do
|
||||||
end
|
setting.face[i]=0
|
||||||
SFX.play("hold")
|
end
|
||||||
|
SFX.play("hold")
|
||||||
end}),
|
end}),
|
||||||
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
setting_touch={
|
setting_touch={
|
||||||
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,code=function()
|
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,
|
||||||
local D=virtualkeySet[sceneTemp.default]
|
code=function()
|
||||||
for i=1,#VK_org do
|
local D=virtualkeySet[sceneTemp.default]
|
||||||
VK_org[i].ava=false
|
for i=1,#VK_org do
|
||||||
end
|
VK_org[i].ava=false
|
||||||
for n=1,#D do
|
|
||||||
local T=D[n]
|
|
||||||
if T[1]then
|
|
||||||
local B=VK_org[n]
|
|
||||||
B.ava=true
|
|
||||||
B.x,B.y,B.r=T[2],T[3],T[4]
|
|
||||||
end
|
end
|
||||||
end--Replace keys
|
|
||||||
sceneTemp.default=sceneTemp.default%5+1
|
--Replace keys
|
||||||
sceneTemp.sel=nil
|
for n=1,#D do
|
||||||
|
local T=D[n]
|
||||||
|
if T[1]then
|
||||||
|
local B=VK_org[n]
|
||||||
|
B.ava=true
|
||||||
|
B.x,B.y,B.r=T[2],T[3],T[4]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
sceneTemp.default=sceneTemp.default%5+1
|
||||||
|
sceneTemp.sel=nil
|
||||||
end}),
|
end}),
|
||||||
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,code=function()
|
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,
|
||||||
sceneTemp.snap=sceneTemp.snap%6+1
|
code=function()
|
||||||
|
sceneTemp.snap=sceneTemp.snap%6+1
|
||||||
end}),
|
end}),
|
||||||
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,code=function()
|
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
|
||||||
SCN.goto("setting_touchSwitch")
|
code=function()
|
||||||
|
SCN.goto("setting_touchSwitch")
|
||||||
end}),
|
end}),
|
||||||
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
|
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,disp=function()
|
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,
|
||||||
|
disp=function()
|
||||||
return VK_org[sceneTemp.sel].r/10-1
|
return VK_org[sceneTemp.sel].r/10-1
|
||||||
end,
|
end,
|
||||||
code=function(v)
|
code=function(v)
|
||||||
@@ -373,7 +385,7 @@ local Widgets={
|
|||||||
end,
|
end,
|
||||||
hide=function()
|
hide=function()
|
||||||
return not sceneTemp.sel
|
return not sceneTemp.sel
|
||||||
end}),
|
end}),
|
||||||
},
|
},
|
||||||
setting_touchSwitch={
|
setting_touchSwitch={
|
||||||
newSwitch({name="b1", x=280, y=80, font=35,disp=VKAdisp(1),code=VKAcode(1)}),
|
newSwitch({name="b1", x=280, y=80, font=35,disp=VKAdisp(1),code=VKAcode(1)}),
|
||||||
@@ -403,14 +415,18 @@ local Widgets={
|
|||||||
newSlider({name="sfx", x=800, y=380, w=180,unit=4,font=40,change=function()SFX.play("virtualKey",setting.VKSFX*.25)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
|
newSlider({name="sfx", x=800, y=380, w=180,unit=4,font=40,change=function()SFX.play("virtualKey",setting.VKSFX*.25)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
|
||||||
newSlider({name="vib", x=800, y=460, w=180,unit=2,font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
|
newSlider({name="vib", x=800, y=460, w=180,unit=2,font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
|
||||||
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
|
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()
|
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
|
||||||
SCN.goto("setting_trackSetting")
|
code=function()
|
||||||
end,hide=function()return not setting.VKTrack end}),
|
SCN.goto("setting_trackSetting")
|
||||||
|
end,
|
||||||
|
hide=function()
|
||||||
|
return not setting.VKTrack
|
||||||
|
end}),
|
||||||
newSlider({name="alpha", x=840, y=540, w=400,unit=10,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
|
newSlider({name="alpha", x=840, y=540, w=400,unit=10,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
|
||||||
newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}),
|
newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}),
|
||||||
},
|
},
|
||||||
setting_trackSetting={
|
setting_trackSetting={
|
||||||
newSwitch({name="VKDodge", x=400, y=200, font=35,SETval("VKDodge"),SETrev("VKDodge")}),
|
newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}),
|
||||||
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}),
|
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}),
|
||||||
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}),
|
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}),
|
||||||
newButton({name="back", x=1080, y=600, w=240, h=80,color="white",font=45,code=BACK}),
|
newButton({name="back", x=1080, y=600, w=240, h=80,color="white",font=45,code=BACK}),
|
||||||
@@ -432,8 +448,8 @@ local Widgets={
|
|||||||
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
history={
|
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="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp.pos==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}),
|
newButton({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}),
|
newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
stat={
|
stat={
|
||||||
@@ -441,28 +457,57 @@ local Widgets={
|
|||||||
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
debug={
|
debug={
|
||||||
newButton({name="killWTM", x=340, y=200,w=260,h=100,color="white",font=35,code=function()
|
newButton({name="killWTM", x=340,y=200,w=260,h=100,color="white",font=35,
|
||||||
marking=nil
|
code=function()
|
||||||
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)
|
marking=nil
|
||||||
SFX.play("clear")
|
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")
|
||||||
|
end,
|
||||||
|
hide=function()
|
||||||
|
return not marking
|
||||||
end}),
|
end}),
|
||||||
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,code=function()
|
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,
|
||||||
for name,M in next,Modes do
|
code=function()
|
||||||
if not modeRanks[name]then
|
for name,M in next,Modes do
|
||||||
modeRanks[name]=M.score and 0 or 6
|
if not modeRanks[name]then
|
||||||
|
modeRanks[name]=M.score and 0 or 6
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
FILE.saveUnlock()
|
||||||
FILE.saveUnlock()
|
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
|
||||||
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
|
SFX.play("clear_2")
|
||||||
SFX.play("clear_2")
|
|
||||||
end}),
|
end}),
|
||||||
newButton({name="reset", x=940,y=200,w=260,h=100,color="white",font=40,code=function()
|
newButton({name="reset", x=940,y=200,w=260,h=100,color="yellow",font=40,
|
||||||
sceneTemp.ct=sceneTemp.ct+1
|
code=function()
|
||||||
if sceneTemp.ct==1 then
|
sceneTemp.reset=true
|
||||||
TEXT.show("RESET ALL DATA?",640,360,50,"appear",.5)
|
end,
|
||||||
elseif sceneTemp.ct==5 then
|
hide=function()
|
||||||
TEXT.show("SURE?????",640,360,80,"beat",.5)
|
return sceneTemp.reset
|
||||||
elseif sceneTemp.ct==10 then
|
end}),
|
||||||
|
newButton({name="reset1", x=340,y=400,w=260,h=100,color="red",font=40,
|
||||||
|
code=function()
|
||||||
|
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("")
|
local L=love.filesystem.getDirectoryItems("")
|
||||||
for i=1,#L do
|
for i=1,#L do
|
||||||
local s=L[i]
|
local s=L[i]
|
||||||
@@ -471,10 +516,12 @@ local Widgets={
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
SFX.play("clear_4")SFX.play("finesseError_long")
|
SFX.play("clear_4")SFX.play("finesseError_long")
|
||||||
TEXT.clear()
|
TEXT.show("all file deleted",640,330,60,"stretch",.4)
|
||||||
TEXT.show("ALL SAVING FILE DELETED",640,360,60,"stretch",.4)
|
TEXT.show("effected after restart game",640,390,60,"stretch",.4)
|
||||||
SCN.back()
|
SCN.back()
|
||||||
end
|
end,
|
||||||
|
hide=function()
|
||||||
|
return not sceneTemp.reset
|
||||||
end}),
|
end}),
|
||||||
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
|
||||||
},
|
},
|
||||||
|
|||||||
21
conf.lua
21
conf.lua
@@ -1,11 +1,10 @@
|
|||||||
gameVersion="Alpha V0.9.2"
|
gameVersion="Alpha V0.10.0"
|
||||||
function love.conf(t)
|
function love.conf(t)
|
||||||
t.identity="Techmino"--saving folder
|
t.identity="Techmino"--Saving folder
|
||||||
t.version="11.1"
|
t.version="11.1"
|
||||||
t.console=false
|
|
||||||
t.gammacorrect=false
|
t.gammacorrect=false
|
||||||
t.appendidentity=true--search files in source then in save directory
|
t.appendidentity=true--Search files in source then in save directory
|
||||||
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
|
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
|
||||||
if t.audio then t.audio.mixwithsystem=true end
|
if t.audio then t.audio.mixwithsystem=true end
|
||||||
|
|
||||||
local W=t.window
|
local W=t.window
|
||||||
@@ -17,12 +16,12 @@ function love.conf(t)
|
|||||||
W.resizable=true
|
W.resizable=true
|
||||||
W.fullscreentype="desktop"--"exclusive"
|
W.fullscreentype="desktop"--"exclusive"
|
||||||
W.fullscreen=false
|
W.fullscreen=false
|
||||||
W.vsync=0--unlimit
|
W.vsync=0--Do not limit FPS
|
||||||
W.msaa=false--num of samples to use with multi-sampled antialiasing
|
W.msaa=false--Num of samples to use with multi-sampled antialiasing
|
||||||
W.depth=0--bits/samp of depth buffer
|
W.depth=0--Bits/samp of depth buffer
|
||||||
W.stencil=1--bits/samp of stencil buffer
|
W.stencil=1--Bits/samp of stencil buffer
|
||||||
W.display=1--monitor ID
|
W.display=1--Monitor ID
|
||||||
W.highdpi=false--high-dpi mode for the window on a Retina display
|
W.highdpi=true--High-dpi mode for the window on a Retina display
|
||||||
W.x,W.y=nil
|
W.x,W.y=nil
|
||||||
|
|
||||||
local M=t.modules
|
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)攻击
|
B2B:加1(techrash/spin1/spin2)或2(spin3)攻击
|
||||||
B3B:在B2B效果之上消四再加1,spin再加0.5*消行数攻击,二者都+1额外抵挡
|
B3B:在B2B效果之上消四再加1,spin再加0.5*消行数攻击,二者都+1额外抵挡
|
||||||
堆楼连击:0,0,1,1,2,2,2,3,3,3,4,4,3, 之后都是2
|
连击:给予上述攻击[连击数*20%]的加成,上限200%,连消3次之后额外加1攻击
|
||||||
挖掘连击:0,0,1,1,2,2,3,3,4,4,4, 之后都是5
|
|
||||||
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
|
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
|
||||||
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
|
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
|
||||||
全消:将上述伤害之和开根号,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
|
全消:将上述伤害之和减半,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
|
||||||
根据上述规则计算后,向下取整,攻击打出
|
根据上述规则计算后,向下取整,攻击打出
|
||||||
|
|
||||||
分数系统:
|
分数系统:
|
||||||
@@ -37,7 +36,7 @@ spin判定:
|
|||||||
back to back(B2B)点数说明:
|
back to back(B2B)点数说明:
|
||||||
B2B点数的范围在0~1200,在点数>=40时进行特殊消除为B2B,>1000时特殊消除为B3B
|
B2B点数的范围在0~1200,在点数>=40时进行特殊消除为B2B,>1000时特殊消除为B3B
|
||||||
普通消除-250
|
普通消除-250
|
||||||
spin1/2/3:+50/100/180(mini变为原来40%)
|
spin1/2/3:+50/100/180(mini变为原来25%)
|
||||||
消四:+100
|
消四:+100
|
||||||
空spin:+20,此法得到的点数不能超过1000
|
空spin:+20,此法得到的点数不能超过1000
|
||||||
当点数在1000以上时空放一块-40(不减到低于1000)
|
当点数在1000以上时空放一块-40(不减到低于1000)
|
||||||
@@ -67,16 +66,15 @@ Spin detection:
|
|||||||
|
|
||||||
Attack system:
|
Attack system:
|
||||||
Regular line clears:
|
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:
|
Special line clears:
|
||||||
Spin Single/Double/Triple sends 2/4/6, half if Mini
|
Spin Single/Double/Triple sends 2/4/6, half if Mini
|
||||||
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
|
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
|
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
|
Combo: each combo gives 20% more attack (capped at 200%), extra 1 attack after 3 combo
|
||||||
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
|
|
||||||
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
|
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
|
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
|
After calculating all above, the damage value will be rounded down then sent
|
||||||
|
|
||||||
Score system:
|
Score system:
|
||||||
@@ -93,7 +91,7 @@ Countering:
|
|||||||
Back to Back (B2B) gauge:
|
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.
|
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
|
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
|
Techrash +100
|
||||||
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
|
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)
|
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
|
||||||
|
|||||||
BIN
image/mess/hbm.png
Normal file
BIN
image/mess/hbm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
70
main.lua
70
main.lua
@@ -6,7 +6,7 @@
|
|||||||
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
|
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
|
||||||
Techmino is my first "huge project"
|
Techmino is my first "huge project"
|
||||||
optimization is welcomed if you also love tetromino game
|
optimization is welcomed if you also love tetromino game
|
||||||
]]
|
]]--
|
||||||
|
|
||||||
--Global Setting & Vars
|
--Global Setting & Vars
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
@@ -18,17 +18,18 @@ function NULL()end
|
|||||||
system=love.system.getOS()
|
system=love.system.getOS()
|
||||||
game={}
|
game={}
|
||||||
mapCam={
|
mapCam={
|
||||||
sel=nil,--selected mode ID
|
sel=nil,--Selected mode ID
|
||||||
|
|
||||||
x=0,y=0,k=1,--camera pos/k
|
--Basic paragrams
|
||||||
x1=0,y1=0,k1=1,--camera pos/k shown
|
x=0,y=0,k=1,--Camera pos/k
|
||||||
--basic paras
|
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,
|
zoomMethod=nil,
|
||||||
zoomK=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,rad=0,k=1}--wid,hei,radius,scale K
|
||||||
|
|
||||||
@@ -36,10 +37,23 @@ 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
|
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
|
||||||
preBag={}
|
preBag={}
|
||||||
|
|
||||||
players={alive={},human=0}
|
game={
|
||||||
--blockSkin,blockSkinMini={},{}--redefined in SKIN.change
|
frame=0, --Frame count
|
||||||
|
result=0, --Game result
|
||||||
|
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
|
||||||
|
rec={}, --Recording list, key-time
|
||||||
|
}--Global game data
|
||||||
|
players={alive={}}--Players data
|
||||||
|
curMode=nil--Current mode object
|
||||||
|
--blockSkin,blockSkinMini={},{}--Redefined in SKIN.change
|
||||||
|
|
||||||
require("Zframework")--load Zframework
|
require("Zframework")--Load Zframework
|
||||||
|
|
||||||
--Load modules
|
--Load modules
|
||||||
blocks= require("parts/mino")
|
blocks= require("parts/mino")
|
||||||
@@ -58,7 +72,7 @@ Modes= require("parts/modes")
|
|||||||
TICK= require("parts/tick")
|
TICK= require("parts/tick")
|
||||||
|
|
||||||
|
|
||||||
--load files & settings
|
--Load files & settings
|
||||||
modeRanks={sprint_10=0}
|
modeRanks={sprint_10=0}
|
||||||
|
|
||||||
local fs=love.filesystem
|
local fs=love.filesystem
|
||||||
@@ -87,23 +101,37 @@ 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
|
||||||
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
|
--Update modeRanks
|
||||||
S=stat
|
R=modeRanks
|
||||||
while #modeRanks>73 do
|
if R[1]then
|
||||||
table.remove(modeRanks)
|
local L=R
|
||||||
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
|
for i=1,#L do
|
||||||
L[Modes[i].name],L[i]=L[i]
|
L[Modes[i].name],L[i]=L[i]
|
||||||
end
|
end
|
||||||
|
elseif R.master_adavnce then
|
||||||
|
R.master_advance,R.master_adavnce=R.master_adavnce
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Update data file
|
||||||
|
S=stat
|
||||||
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then
|
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then
|
||||||
setting.spawn=0
|
setting.spawn=0
|
||||||
end
|
end
|
||||||
if S.version~=gameVersion then
|
if S.version~=gameVersion then
|
||||||
S.version=gameVersion
|
S.version=gameVersion
|
||||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
TEXT.show(text.newBigVersion,640,200,30,"fly",.3)
|
||||||
|
newVersionLaunch=true
|
||||||
|
|
||||||
|
fs.remove("master_adavnce.dat")
|
||||||
|
fs.remove("master_beginner.dat")
|
||||||
|
for name,M in next,Modes do
|
||||||
|
if M.score then
|
||||||
|
if modeRanks[name]==6 then
|
||||||
|
modeRanks[name]=0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
modeRanks[name]=6
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
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 sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
|
||||||
local function score(P)
|
local function score(P)
|
||||||
local F=false
|
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
|
local R=#P.clearedRow
|
||||||
if R==0 then return end
|
if R==0 then return end
|
||||||
if R==4 then R=10 end
|
if R==4 then R=10 end
|
||||||
@@ -12,7 +13,7 @@ local function score(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightBlue,
|
color=color.lBlue,
|
||||||
env={
|
env={
|
||||||
noFly=true,
|
noFly=true,
|
||||||
minarr=1,
|
minarr=1,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local int,rnd,min=math.floor,math.random,math.min
|
local int,rnd,min=math.floor,math.random,math.min
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=5,lock=60,
|
drop=5,lock=60,
|
||||||
fall=8,
|
fall=8,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local function newField(P)
|
|||||||
|
|
||||||
end
|
end
|
||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
drop=1e99,lock=1e99,
|
drop=1e99,lock=1e99,
|
||||||
hold=false,
|
hold=false,
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ return{
|
|||||||
gc.clear(.26,.26,.26)
|
gc.clear(.26,.26,.26)
|
||||||
end
|
end
|
||||||
|
|
||||||
--MD Figure
|
--Figures
|
||||||
local t=Timer()
|
local t=Timer()
|
||||||
gc.setColor(.6+.3*sin(t*1.26),.6+.3*sin(t*2.6),.6+.3*sin(t*1.626),.2)
|
gc.setColor(1,1,1,.5+.2*sin(t))
|
||||||
gc.draw(IMG.electric,-162,-8,0,3.2)
|
gc.draw(IMG.hbm,-426,-86,0,1.5)
|
||||||
|
gc.draw(IMG.electric,326,142,0,2.6)
|
||||||
|
|
||||||
--Texts
|
--Texts
|
||||||
gc.setColor(.8,.8,.8)
|
gc.setColor(.8,.8,.8)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ local function check_LVup(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightBlue,
|
color=color.lBlue,
|
||||||
env={
|
env={
|
||||||
noFly=true,
|
noFly=true,
|
||||||
das=16,arr=6,sddas=2,sdarr=2,
|
das=16,arr=6,sddas=2,sdarr=2,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local max,rnd=math.max,math.random
|
local max,rnd=math.max,math.random
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=10,lock=30,
|
drop=10,lock=30,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
|
|||||||
@@ -11,13 +11,14 @@ return{
|
|||||||
local height=freeRow.get(0)
|
local height=freeRow.get(0)
|
||||||
local max=#P.field
|
local max=#P.field
|
||||||
if max>0 then
|
if max>0 then
|
||||||
|
--Get heights
|
||||||
for x=1,10 do
|
for x=1,10 do
|
||||||
local h=max
|
local h=max
|
||||||
while P.field[h][x]==0 and h>1 do
|
while P.field[h][x]==0 and h>1 do
|
||||||
h=h-1
|
h=h-1
|
||||||
end
|
end
|
||||||
height[x]=h
|
height[x]=h
|
||||||
end--get heights
|
end
|
||||||
else
|
else
|
||||||
for x=1,10 do
|
for x=1,10 do
|
||||||
height[x]=0
|
height[x]=0
|
||||||
@@ -42,8 +43,8 @@ return{
|
|||||||
goto END
|
goto END
|
||||||
end
|
end
|
||||||
|
|
||||||
--give I when no hole
|
--Give I when no hole
|
||||||
d=-999--height difference
|
d=-999--Height difference
|
||||||
--A=hole mark
|
--A=hole mark
|
||||||
for x=2,11 do
|
for x=2,11 do
|
||||||
local _=height[x]-height[x-1]
|
local _=height[x]-height[x-1]
|
||||||
@@ -59,7 +60,7 @@ return{
|
|||||||
res[A+2]=7
|
res[A+2]=7
|
||||||
end
|
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
|
d=0--d=0 count
|
||||||
A=0--d=1 count
|
A=0--d=1 count
|
||||||
for x=2,10 do
|
for x=2,10 do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local format=string.format
|
local format=string.format
|
||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
drop=1e99,lock=1e99,
|
drop=1e99,lock=1e99,
|
||||||
oncehold=false,
|
oncehold=false,
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ local function score(P)
|
|||||||
if P.modeData.point%100==99 then
|
if P.modeData.point%100==99 then
|
||||||
SFX.play("blip_1")
|
SFX.play("blip_1")
|
||||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
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
|
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"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5")
|
||||||
E.lock=death_lock[s]
|
E.lock=death_lock[s]
|
||||||
@@ -55,10 +56,10 @@ return{
|
|||||||
mStr((P.modeData.event+1)*100,-81,370)
|
mStr((P.modeData.event+1)*100,-81,370)
|
||||||
gc.rectangle("fill",-125,375,90,4)
|
gc.rectangle("fill",-125,375,90,4)
|
||||||
end,
|
end,
|
||||||
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
|
score=function(P)return{P.modeData.point,P.stat.time}end,
|
||||||
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
|
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
|
||||||
comp=function(a,b)
|
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,
|
end,
|
||||||
getRank=function(P)
|
getRank=function(P)
|
||||||
local S=P.modeData.point
|
local S=P.modeData.point
|
||||||
@@ -13,7 +13,8 @@ local function score(P)
|
|||||||
if P.modeData.point%100==99 then
|
if P.modeData.point%100==99 then
|
||||||
SFX.play("blip_1")
|
SFX.play("blip_1")
|
||||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
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
|
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"game1"or s==2 and"game2"or s==3 and"game3"or "game4")
|
||||||
E.lock=rush_lock[s]
|
E.lock=rush_lock[s]
|
||||||
@@ -59,25 +60,25 @@ return{
|
|||||||
mStr((P.modeData.event+1)*100,-81,370)
|
mStr((P.modeData.event+1)*100,-81,370)
|
||||||
gc.rectangle("fill",-125,375,90,4)
|
gc.rectangle("fill",-125,375,90,4)
|
||||||
end,
|
end,
|
||||||
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
|
score=function(P)return{P.modeData.point,P.stat.time}end,
|
||||||
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
|
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
|
||||||
comp=function(a,b)
|
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,
|
end,
|
||||||
getRank=function(P)
|
getRank=function(P)
|
||||||
local S=P.modeData.point
|
local S=P.modeData.point
|
||||||
if S==500 then
|
if S==500 then
|
||||||
local L=P.stat.clears[4]
|
local T=P.stat.time
|
||||||
return
|
return
|
||||||
L>=30 and 5 or
|
T<=170 and 5 or
|
||||||
L>=25 and 4 or
|
T<=200 and 4 or
|
||||||
3
|
3
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
S>=420 and 3 or
|
S>=460 and 3 or
|
||||||
S>=250 and 2 or
|
S>=350 and 2 or
|
||||||
S>=120 and 1 or
|
S>=200 and 1 or
|
||||||
S>=30 and 0
|
S>=50 and 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
@@ -11,21 +11,23 @@ local function score(P)
|
|||||||
MD.point=MD.point+s
|
MD.point=MD.point+s
|
||||||
if MD.point%100==99 then SFX.play("blip_1")end
|
if MD.point%100==99 then SFX.play("blip_1")end
|
||||||
if int(MD.point*.01)>MD.event then
|
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
|
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~=1 then E.lock=E.lock-1 end
|
||||||
if s~=2 then E.wait=E.wait-1 end
|
if s~=2 then E.wait=E.wait-1 end
|
||||||
if s~=3 then E.fall=E.fall-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
|
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
|
if s==4 or s==7 then E.das=E.das-1 end
|
||||||
s=s%3
|
s=s%3
|
||||||
if s==0 then E.lock=E.lock-1
|
if s==0 then E.lock=E.lock-1
|
||||||
elseif s==1 then E.wait=E.wait-1
|
elseif s==1 then E.wait=E.wait-1
|
||||||
elseif s==2 then E.fall=E.fall-1
|
elseif s==2 then E.fall=E.fall-1
|
||||||
end
|
end
|
||||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
|
||||||
else
|
else
|
||||||
MD.point,MD.event=1000,9
|
MD.point,MD.event=1000,9
|
||||||
P:win("finish")
|
P:win("finish")
|
||||||
@@ -35,7 +37,7 @@ local function score(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
noFly=true,
|
noFly=true,
|
||||||
das=5,arr=1,
|
das=5,arr=1,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ local function update_round(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=1e99,lock=1e99,
|
drop=1e99,lock=1e99,
|
||||||
oncehold=false,
|
oncehold=false,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ return{
|
|||||||
if P.stat.row<100 then return end
|
if P.stat.row<100 then return end
|
||||||
local T=P.stat.time
|
local T=P.stat.time
|
||||||
return
|
return
|
||||||
T<=62 and 5 or
|
T<=70 and 5 or
|
||||||
T<=90 and 4 or
|
T<=90 and 4 or
|
||||||
T<=130 and 3 or
|
T<=136 and 3 or
|
||||||
T<=196 and 2 or
|
T<=196 and 2 or
|
||||||
T<=260 and 1 or
|
T<=260 and 1 or
|
||||||
0
|
0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
target=1000,dropPiece=PLY.reach_winCheck,
|
target=1000,dropPiece=PLY.reach_winCheck,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local rnd=math.random
|
local rnd=math.random
|
||||||
return{
|
return{
|
||||||
color=color.lightBlue,
|
color=color.lBlue,
|
||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
target=20,dropPiece=PLY.reach_winCheck,
|
target=20,dropPiece=PLY.reach_winCheck,
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ return{
|
|||||||
if P.stat.row<400 then return end
|
if P.stat.row<400 then return end
|
||||||
local T=P.stat.time
|
local T=P.stat.time
|
||||||
return
|
return
|
||||||
T<=255 and 5 or
|
T<=300 and 5 or
|
||||||
T<=326 and 4 or
|
T<=340 and 4 or
|
||||||
T<=462 and 3 or
|
T<=462 and 3 or
|
||||||
T<=555 and 2 or
|
T<=555 and 2 or
|
||||||
T<=626 and 1 or
|
T<=626 and 1 or
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local max,rnd=math.max,math.random
|
local max,rnd=math.max,math.random
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=5,lock=60,
|
drop=5,lock=60,
|
||||||
fall=10,
|
fall=10,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local format=string.format
|
local format=string.format
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
arr=0,
|
arr=0,
|
||||||
drop=1e99,lock=60,
|
drop=1e99,lock=60,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local function tech_check_hard(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.darkMagenta,
|
color=color.dMagenta,
|
||||||
env={
|
env={
|
||||||
drop=30,lock=60,
|
drop=30,lock=60,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local function tech_check_hard(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.darkRed,
|
color=color.dRed,
|
||||||
env={
|
env={
|
||||||
_20G=true,lock=60,
|
_20G=true,lock=60,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local function tech_check_hard(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.darkGreen,
|
color=color.dGreen,
|
||||||
env={
|
env={
|
||||||
oncehold=false,
|
oncehold=false,
|
||||||
drop=1e99,lock=1e99,
|
drop=1e99,lock=1e99,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ local function selectTarget(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=15,lock=60,
|
drop=15,lock=60,
|
||||||
fall=20,
|
fall=20,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ local function selectTarget(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=15,lock=60,
|
drop=15,lock=60,
|
||||||
fall=20,
|
fall=20,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local function check_tsd(P)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return{
|
return{
|
||||||
color=color.lightYellow,
|
color=color.lYellow,
|
||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
freshLimit=15,
|
freshLimit=15,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local warnTime={60,90,105,115,116,117,118,119,120}
|
local warnTime={60,90,105,115,116,117,118,119,120}
|
||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
noFly=true,
|
noFly=true,
|
||||||
minarr=1,minsdarr=1,
|
minarr=1,minsdarr=1,
|
||||||
@@ -29,10 +29,10 @@ return{
|
|||||||
end,
|
end,
|
||||||
mesDisp=function(P,dx,dy)
|
mesDisp=function(P,dx,dy)
|
||||||
gc.setLineWidth(2)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle("line",-95,112,32,402)
|
gc.rectangle("line",-95,120,32,402)
|
||||||
local T=P.stat.time/120
|
local T=P.stat.time/120
|
||||||
gc.setColor(2*T,2-2*T,.2)
|
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,
|
end,
|
||||||
score=function(P)return{P.stat.score}end,
|
score=function(P)return{P.stat.score}end,
|
||||||
scoreDisp=function(D)return tostring(D[1])end,
|
scoreDisp=function(D)return tostring(D[1])end,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
return{
|
return{
|
||||||
color=color.lightGrey,
|
color=color.lGrey,
|
||||||
env={
|
env={
|
||||||
drop=120,lock=120,
|
drop=120,lock=120,
|
||||||
oncehold=false,target=200,
|
oncehold=false,target=200,
|
||||||
|
|||||||
40
parts/ai.lua
40
parts/ai.lua
@@ -198,7 +198,8 @@ end
|
|||||||
return{
|
return{
|
||||||
["9S"]={
|
["9S"]={
|
||||||
function(P,ctrl)
|
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
|
local field_org=P.field
|
||||||
for i=1,#field_org do
|
for i=1,#field_org do
|
||||||
Tfield[i]=freeRow.get(0)
|
Tfield[i]=freeRow.get(0)
|
||||||
@@ -206,7 +207,7 @@ return{
|
|||||||
Tfield[i][j]=field_org[i][j]
|
Tfield[i][j]=field_org[i][j]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local best={x=1,dir=0,hold=false,score=-1e99}
|
|
||||||
for ifhold=0,P.gameEnv.hold and 1 or 0 do
|
for ifhold=0,P.gameEnv.hold and 1 or 0 do
|
||||||
--Get block id
|
--Get block id
|
||||||
local bn
|
local bn
|
||||||
@@ -217,13 +218,17 @@ return{
|
|||||||
end
|
end
|
||||||
if not bn then goto CTN 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]
|
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
|
local cy=#Tfield+1
|
||||||
|
|
||||||
|
--Move to bottom
|
||||||
while not ifoverlapAI(Tfield,cb,cx,cy-1)do
|
while not ifoverlapAI(Tfield,cb,cx,cy-1)do
|
||||||
cy=cy-1
|
cy=cy-1
|
||||||
end--move to bottom
|
end
|
||||||
|
|
||||||
|
--Simulate lock
|
||||||
for i=1,#cb do
|
for i=1,#cb do
|
||||||
local y=cy+i-1
|
local y=cy+i-1
|
||||||
if not Tfield[y]then Tfield[y]=freeRow.get(0)end
|
if not Tfield[y]then Tfield[y]=freeRow.get(0)end
|
||||||
@@ -232,7 +237,7 @@ return{
|
|||||||
Tfield[y][cx+j-1]=1
|
Tfield[y][cx+j-1]=1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end--simulate lock
|
end
|
||||||
local score=getScore(Tfield,cb,cy)
|
local score=getScore(Tfield,cb,cy)
|
||||||
if score>best.score then
|
if score>best.score then
|
||||||
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
|
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
|
||||||
@@ -243,9 +248,11 @@ return{
|
|||||||
::CTN::
|
::CTN::
|
||||||
end
|
end
|
||||||
if not best.bn then return 1 end
|
if not best.bn then return 1 end
|
||||||
|
|
||||||
|
--Release cache
|
||||||
while #Tfield>0 do
|
while #Tfield>0 do
|
||||||
freeRow.discard(rem(Tfield,1))
|
freeRow.discard(rem(Tfield,1))
|
||||||
end--Release cache
|
end
|
||||||
local p=#ctrl+1
|
local p=#ctrl+1
|
||||||
if best.hold then
|
if best.hold then
|
||||||
ctrl[p]=8
|
ctrl[p]=8
|
||||||
@@ -270,15 +277,11 @@ return{
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
["CC"]={
|
["CC"]={
|
||||||
function(P)
|
function(P)--Start thinking
|
||||||
if P.AI_needFresh then
|
|
||||||
CC_updateField(P)
|
|
||||||
P.AI_needFresh=false
|
|
||||||
end
|
|
||||||
BOT.think(P.AI_bot)
|
BOT.think(P.AI_bot)
|
||||||
return 2
|
return 2
|
||||||
end,--start thinking
|
end,
|
||||||
function(P,ctrl)
|
function(P,ctrl)--Poll keys
|
||||||
if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end
|
if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end
|
||||||
local success,hold,move=BOT.getMove(P.AI_bot)
|
local success,hold,move=BOT.getMove(P.AI_bot)
|
||||||
if success then
|
if success then
|
||||||
@@ -294,10 +297,11 @@ return{
|
|||||||
ins(ctrl,6)
|
ins(ctrl,6)
|
||||||
return 3
|
return 3
|
||||||
else
|
else
|
||||||
return 2--stay this stage
|
--Stay this stage
|
||||||
|
return 2
|
||||||
end
|
end
|
||||||
end,--poll keys
|
end,
|
||||||
function(P)
|
function(P)--Check if time to change target
|
||||||
P.AI_delay=P.AI_delay0
|
P.AI_delay=P.AI_delay0
|
||||||
if Timer()-P.modeData.point>P.modeData.event then
|
if Timer()-P.modeData.point>P.modeData.event then
|
||||||
P.modeData.point=Timer()
|
P.modeData.point=Timer()
|
||||||
@@ -305,6 +309,6 @@ return{
|
|||||||
P:changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
|
P:changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
|
||||||
end
|
end
|
||||||
return 1
|
return 1
|
||||||
end,--check if time to change target
|
end,
|
||||||
},
|
},
|
||||||
}--AI think stage
|
}--AI think stage
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
setting={
|
setting={
|
||||||
--game
|
--Game
|
||||||
das=10,arr=2,
|
das=10,arr=2,
|
||||||
sddas=0,sdarr=2,
|
sddas=0,sdarr=2,
|
||||||
ihs=true,irs=true,ims=true,
|
ihs=true,irs=true,ims=true,
|
||||||
@@ -14,7 +14,7 @@ setting={
|
|||||||
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},
|
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={},
|
face={},
|
||||||
|
|
||||||
--graphic
|
--Graphic
|
||||||
ghost=true,center=true,
|
ghost=true,center=true,
|
||||||
smooth=true,grid=false,
|
smooth=true,grid=false,
|
||||||
bagLine=false,
|
bagLine=false,
|
||||||
@@ -31,7 +31,7 @@ setting={
|
|||||||
bg=true,
|
bg=true,
|
||||||
powerInfo=false,
|
powerInfo=false,
|
||||||
|
|
||||||
--sound
|
--Sound
|
||||||
sfx=10,
|
sfx=10,
|
||||||
spawn=0,
|
spawn=0,
|
||||||
bgm=7,
|
bgm=7,
|
||||||
@@ -39,15 +39,15 @@ setting={
|
|||||||
vib=0,
|
vib=0,
|
||||||
voc=0,
|
voc=0,
|
||||||
|
|
||||||
--virtualkey
|
--Virtualkey
|
||||||
VKSFX=3,--SFX volume
|
VKSFX=3,--SFX volume
|
||||||
VKVIB=0,--VIB
|
VKVIB=0,--VIB
|
||||||
VKSwitch=false,--if disp
|
VKSwitch=false,--If disp
|
||||||
VKTrack=false,--if tracked
|
VKTrack=false,--If tracked
|
||||||
VKDodge=false,--if dodge
|
VKDodge=false,--If dodge
|
||||||
VKTchW=3,--Touch-Pos Weight
|
VKTchW=3,--Touch-Pos Weight
|
||||||
VKCurW=4,--Cur-Pos Weight
|
VKCurW=4,--Cur-Pos Weight
|
||||||
VKIcon=true,--if disp icon
|
VKIcon=true,--If disp icon
|
||||||
VKAlpha=3,
|
VKAlpha=3,
|
||||||
}
|
}
|
||||||
for i=1,25 do
|
for i=1,25 do
|
||||||
@@ -64,7 +64,7 @@ stat={
|
|||||||
send=0,recv=0,pend=0,off=0,
|
send=0,recv=0,pend=0,off=0,
|
||||||
clear={},spin={},
|
clear={},spin={},
|
||||||
pc=0,hpc=0,b2b=0,b3b=0,score=0,
|
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
|
for i=1,25 do
|
||||||
stat.clear[i]={0,0,0,0,0}
|
stat.clear[i]={0,0,0,0,0}
|
||||||
@@ -73,9 +73,9 @@ end
|
|||||||
|
|
||||||
keyMap={
|
keyMap={
|
||||||
{"left","right","x","z","c","up","down","space","tab","r"},{},
|
{"left","right","x","z","c","up","down","space","tab","r"},{},
|
||||||
--keyboard
|
--Keyboard
|
||||||
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder"},{},
|
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder"},{},
|
||||||
--joystick
|
--Joystick
|
||||||
}
|
}
|
||||||
for i=1,#keyMap do for j=1,20 do
|
for i=1,#keyMap do for j=1,20 do
|
||||||
if not keyMap[i][j]then keyMap[i][j]=""end
|
if not keyMap[i][j]then keyMap[i][j]=""end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local freeRow={}
|
local freeRow={}
|
||||||
local L={}--storage
|
local L={}--Storage
|
||||||
local _=0--lenth
|
local _=0--Lenth
|
||||||
function freeRow.reset(num)
|
function freeRow.reset(num)
|
||||||
if num<_ then
|
if num<_ then
|
||||||
for i=_,num+1,-1 do
|
for i=_,num+1,-1 do
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ function destroyPlayers()
|
|||||||
for i=#players.alive,1,-1 do
|
for i=#players.alive,1,-1 do
|
||||||
players.alive[i]=nil
|
players.alive[i]=nil
|
||||||
end
|
end
|
||||||
players.human=0
|
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,18 +42,22 @@ function restoreVirtualKey()
|
|||||||
virtualkey[9].ava=false
|
virtualkey[9].ava=false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function copyBoard()
|
function copyBoard()
|
||||||
local str=""
|
local str=""
|
||||||
local H=0
|
local H=0
|
||||||
|
|
||||||
for y=20,1,-1 do
|
for y=20,1,-1 do
|
||||||
for x=1,10 do
|
for x=1,10 do
|
||||||
if preField[y][x]~=0 then
|
if preField[y][x]~=0 then
|
||||||
H=y
|
H=y
|
||||||
goto L
|
goto topFound
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
::L::
|
::topFound::
|
||||||
|
|
||||||
|
--Encode field
|
||||||
for y=1,H do
|
for y=1,H do
|
||||||
local S=""
|
local S=""
|
||||||
local L=preField[y]
|
local L=preField[y]
|
||||||
@@ -63,38 +66,36 @@ function copyBoard()
|
|||||||
end
|
end
|
||||||
str=str..S
|
str=str..S
|
||||||
end
|
end
|
||||||
love.system.setClipboardText("Techmino sketchpad:"..data.encode("string","base64",data.compress("string","deflate",str)))
|
return data.encode("string","base64",data.compress("string","deflate",str))
|
||||||
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
|
|
||||||
end
|
end
|
||||||
function pasteBoard()
|
function pasteBoard(str)
|
||||||
local _
|
local _
|
||||||
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
|
||||||
|
|
||||||
--Read data
|
--Decode
|
||||||
local str=love.system.getClipboardText()
|
|
||||||
local p=find(str,":")--ptr*
|
|
||||||
if p then str=sub(str,p+1)end
|
|
||||||
_,str=pcall(data.decode,"string","base64",str)
|
_,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)
|
_,str=pcall(data.decompress,"string","deflate",str)
|
||||||
if not _ then goto ERROR end
|
if not _ then return end
|
||||||
|
|
||||||
p=1
|
|
||||||
|
|
||||||
|
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
|
||||||
|
local p=1
|
||||||
while true do
|
while true do
|
||||||
_=byte(str,p)--1byte
|
_=byte(str,p)--1byte
|
||||||
|
|
||||||
|
--Str end
|
||||||
if not _ then
|
if not _ then
|
||||||
if fX~=1 then
|
if fX~=1 then
|
||||||
goto ERROR
|
return
|
||||||
else
|
else
|
||||||
fY=fY+1
|
fY=fY+1
|
||||||
break
|
break
|
||||||
end
|
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]=__
|
preField[fY][fX]=__
|
||||||
if fX<10 then
|
if fX<10 then
|
||||||
fX=fX+1
|
fX=fX+1
|
||||||
@@ -111,8 +112,40 @@ function pasteBoard()
|
|||||||
preField[y][x]=0
|
preField[y][x]=0
|
||||||
end
|
end
|
||||||
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
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function mergeStat(stat,delta)
|
function mergeStat(stat,delta)
|
||||||
@@ -128,7 +161,7 @@ function mergeStat(stat,delta)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function randomTarget(P)
|
function randomTarget(P)--Return a random opponent for P
|
||||||
if #players.alive>1 then
|
if #players.alive>1 then
|
||||||
local R
|
local R
|
||||||
repeat
|
repeat
|
||||||
@@ -136,7 +169,7 @@ function randomTarget(P)
|
|||||||
until R~=P
|
until R~=P
|
||||||
return R
|
return R
|
||||||
end
|
end
|
||||||
end--return a random opponent for P
|
end
|
||||||
function freshMostDangerous()
|
function freshMostDangerous()
|
||||||
game.mostDangerous,game.secDangerous=nil
|
game.mostDangerous,game.secDangerous=nil
|
||||||
local m,m2=0,0
|
local m,m2=0,0
|
||||||
@@ -198,7 +231,7 @@ function royaleLevelup()
|
|||||||
if P.gameEnv.drop==0 then
|
if P.gameEnv.drop==0 then
|
||||||
P.curY=P.y_img
|
P.curY=P.y_img
|
||||||
P.gameEnv._20G=true
|
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
|
||||||
end
|
end
|
||||||
@@ -223,65 +256,34 @@ end
|
|||||||
function resumeGame()
|
function resumeGame()
|
||||||
SCN.swapTo("play","none")
|
SCN.swapTo("play","none")
|
||||||
end
|
end
|
||||||
function loadGame(M)
|
function loadGame(M,ifQuickPlay)
|
||||||
--rec={}
|
|
||||||
stat.lastPlay=M
|
stat.lastPlay=M
|
||||||
curMode=Modes[M]
|
curMode=Modes[M]
|
||||||
local lang=setting.lang
|
local lang=setting.lang
|
||||||
drawableText.modeName:set(text.modes[M][1])
|
drawableText.modeName:set(text.modes[M][1])
|
||||||
drawableText.levelName:set(text.modes[M][2])
|
drawableText.levelName:set(text.modes[M][2])
|
||||||
needResetGameData=true
|
needResetGameData=true
|
||||||
SCN.swapTo("play","fade_togame")
|
SCN.swapTo("play",ifQuickPlay and"swipe"or"fade_togame")
|
||||||
SFX.play("enter")
|
SFX.play("enter")
|
||||||
end
|
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()
|
function resetGameData()
|
||||||
game={
|
game.frame=150-setting.reTime*15
|
||||||
frame=150-setting.reTime*15,
|
game.result=false
|
||||||
result=false,
|
game.pauseTime=0
|
||||||
pauseTime=0,--Time paused
|
game.pauseCount=0
|
||||||
pauseCount=0,--Pausing count
|
game.garbageSpeed=1
|
||||||
garbageSpeed=1,--garbage timing speed
|
game.warnLVL0=0
|
||||||
warnLVL0=0,
|
game.warnLVL=0
|
||||||
warnLVL=0,
|
game.recording=true
|
||||||
}
|
game.replaying=false
|
||||||
|
game.rec={}
|
||||||
|
math.randomseed(tm.getTime())
|
||||||
|
game.seed=rnd(261046101471026)
|
||||||
|
|
||||||
destroyPlayers()
|
destroyPlayers()
|
||||||
modeEnv=curMode.env
|
modeEnv=curMode.env
|
||||||
curMode.load()--bg/bgm need redefine in custom,so up here
|
math.randomseed(game.seed)
|
||||||
|
curMode.load()--BG/BGM need redefine in custom,so up here
|
||||||
if modeEnv.task then
|
if modeEnv.task then
|
||||||
for i=1,#players do
|
for i=1,#players do
|
||||||
players[i]:newTask(modeEnv.task)
|
players[i]:newTask(modeEnv.task)
|
||||||
@@ -306,6 +308,47 @@ function resetGameData()
|
|||||||
SFX.play("ready")
|
SFX.play("ready")
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
end
|
end
|
||||||
|
function resetPartGameData(replaying)
|
||||||
|
game.result=false
|
||||||
|
game.garbageSpeed=1
|
||||||
|
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.rec={}
|
||||||
|
math.randomseed(tm.getTime())
|
||||||
|
game.seed=rnd(1046101471,2662622626)
|
||||||
|
end
|
||||||
|
|
||||||
|
destroyPlayers()
|
||||||
|
modeEnv=curMode.env
|
||||||
|
math.randomseed(game.seed)
|
||||||
|
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()
|
function gameStart()
|
||||||
SFX.play("start")
|
SFX.play("start")
|
||||||
for P=1,#players do
|
for P=1,#players do
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ local L
|
|||||||
if setting.lang==1 or setting.lang==2 then
|
if setting.lang==1 or setting.lang==2 then
|
||||||
L={
|
L={
|
||||||
"ZS JL T O I",
|
"ZS JL T O I",
|
||||||
|
"VVVVVV好玩!",
|
||||||
"uid:225238922",
|
"uid:225238922",
|
||||||
"tetr.js也很好玩!",
|
"tetr.js也很好玩!",
|
||||||
"tetr.io也很好玩!",
|
"tetr.io也很好玩!",
|
||||||
@@ -20,7 +21,11 @@ if setting.lang==1 or setting.lang==2 then
|
|||||||
"l-=-1",
|
"l-=-1",
|
||||||
"jstris也很好玩!",
|
"jstris也很好玩!",
|
||||||
"iced,永远的神",
|
"iced,永远的神",
|
||||||
|
"fin neo iso 是满足tspin条件的特殊t2的名字",
|
||||||
|
"e^(pi*i/2)=i",
|
||||||
|
"e^(pi*i)=-1",
|
||||||
"DT炮=TSD+TST炮",
|
"DT炮=TSD+TST炮",
|
||||||
|
"Cultris II也很好玩!",
|
||||||
"COOL!!",
|
"COOL!!",
|
||||||
"CLASSIC SEXY RUSSIAN BLOCKS",
|
"CLASSIC SEXY RUSSIAN BLOCKS",
|
||||||
"BT炮=beta炮",
|
"BT炮=beta炮",
|
||||||
@@ -70,7 +75,6 @@ if setting.lang==1 or setting.lang==2 then
|
|||||||
"别问游戏名怎么取的,问就是随便想的",
|
"别问游戏名怎么取的,问就是随便想的",
|
||||||
"本游戏难度上限很高, 做好心理准备",
|
"本游戏难度上限很高, 做好心理准备",
|
||||||
"本游戏可不是休闲游戏",
|
"本游戏可不是休闲游戏",
|
||||||
"啊这,不会吧不会吧",
|
|
||||||
"626r/s",
|
"626r/s",
|
||||||
"40行世界纪录:15.654s",
|
"40行世界纪录:15.654s",
|
||||||
"4+4+4+4+2+2+1=17",
|
"4+4+4+4+2+2+1=17",
|
||||||
@@ -82,6 +86,7 @@ if setting.lang==1 or setting.lang==2 then
|
|||||||
"2.7182818284590452353",
|
"2.7182818284590452353",
|
||||||
"15puzzle好玩!",
|
"15puzzle好玩!",
|
||||||
"11renPC!",
|
"11renPC!",
|
||||||
|
"1, 2, 9!!!!!",
|
||||||
"<方块研究所>有一个Nspire-CX版本!",
|
"<方块研究所>有一个Nspire-CX版本!",
|
||||||
"↑↑↓↓←→←→BABA",
|
"↑↑↓↓←→←→BABA",
|
||||||
"(RUR'U')R'FR2U'R'U'(RUR'F')",
|
"(RUR'U')R'FR2U'R'U'(RUR'F')",
|
||||||
@@ -134,6 +139,8 @@ elseif setting.lang==3 then
|
|||||||
"Have you noticed what does \"rotating\" do to block?",
|
"Have you noticed what does \"rotating\" do to block?",
|
||||||
"Find out what's in the setting!",
|
"Find out what's in the setting!",
|
||||||
"Enjoy Tech. Rotation System!",
|
"Enjoy Tech. Rotation System!",
|
||||||
|
"e^(pi*i/2)=i",
|
||||||
|
"e^(pi*i)=-1",
|
||||||
"DT cannon=TSD+TST",
|
"DT cannon=TSD+TST",
|
||||||
"Don't look directly at the bugs!",
|
"Don't look directly at the bugs!",
|
||||||
"DO NOT PRESS F10",
|
"DO NOT PRESS F10",
|
||||||
@@ -147,10 +154,12 @@ elseif setting.lang==3 then
|
|||||||
"B2B2B???",
|
"B2B2B???",
|
||||||
"Any suggestions to author!",
|
"Any suggestions to author!",
|
||||||
"Am G F G",
|
"Am G F G",
|
||||||
"Also try tetr.js!",
|
"Also try VVVVVV!",
|
||||||
"Also try tetr.io!",
|
"Also try Tetr.js!",
|
||||||
"Also try nullpomino!",
|
"Also try Tetr.io!",
|
||||||
"Also try jstris!",
|
"Also try Jstris!",
|
||||||
|
"Also try Cultris II!",
|
||||||
|
"Also try Bullpomino!",
|
||||||
"ALLSPIN!",
|
"ALLSPIN!",
|
||||||
"少女祈禱中",
|
"少女祈禱中",
|
||||||
"40L WR: 15.654s",
|
"40L WR: 15.654s",
|
||||||
@@ -162,6 +171,7 @@ elseif setting.lang==3 then
|
|||||||
"2.7182818284590452353",
|
"2.7182818284590452353",
|
||||||
"15puzzle is fun!",
|
"15puzzle is fun!",
|
||||||
"11renPC!",
|
"11renPC!",
|
||||||
|
"1, 2, 9!!!!!",
|
||||||
"↑↑↓↓←→←→BABA",
|
"↑↑↓↓←→←→BABA",
|
||||||
"\"Free block game with royale mode\"",
|
"\"Free block game with royale mode\"",
|
||||||
"/osk/",
|
"/osk/",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ local ZERO={[01]=Zero,[10]=Zero,[03]=Zero,[30]=Zero,[12]=Zero,[21]=Zero,[32]=Zer
|
|||||||
|
|
||||||
local map={}
|
local map={}
|
||||||
for x=-3,3 do map[x]={}for y=-3,3 do map[x][y]={x,y}end end
|
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
|
if type(T)=="table"then
|
||||||
for _,T in next,T do
|
for _,T in next,T do
|
||||||
for k,vec 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
|
||||||
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[23]=L[01]L[32]=L[10]
|
||||||
L[21]=L[03]L[12]=L[30]
|
L[21]=L[03]L[12]=L[30]
|
||||||
end
|
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
|
if not O then return end
|
||||||
local L={}
|
local L={}
|
||||||
for i=1,#O do
|
for i=1,#O do
|
||||||
|
|||||||
@@ -189,17 +189,14 @@ drawableText={
|
|||||||
mxcmb=T(20,"Max Combo"),
|
mxcmb=T(20,"Max Combo"),
|
||||||
pc=T(20,"Perfect Clear"),
|
pc=T(20,"Perfect Clear"),
|
||||||
ko=T(25,"KO"),
|
ko=T(25,"KO"),
|
||||||
D=T(100,"D"),
|
D=T(100,"D"),C=T(100,"C"),B=T(100,"B"),A=T(100,"A"),S=T(100,"S"),
|
||||||
C=T(100,"C"),
|
|
||||||
B=T(100,"B"),
|
|
||||||
A=T(100,"A"),
|
|
||||||
S=T(100,"S"),
|
|
||||||
|
|
||||||
|
|
||||||
modeName=T(30),levelName=T(30),
|
modeName=T(30),levelName=T(30),
|
||||||
|
|
||||||
|
|
||||||
anykey=T(40),
|
anykey=T(40),
|
||||||
|
replaying=T(20),
|
||||||
next=T(40),hold=T(40),
|
next=T(40),hold=T(40),
|
||||||
win=T(120),finish=T(120),
|
win=T(120),finish=T(120),
|
||||||
lose=T(120),pause=T(120),
|
lose=T(120),pause=T(120),
|
||||||
@@ -210,9 +207,7 @@ drawableText={
|
|||||||
preview=T(40),
|
preview=T(40),
|
||||||
keyboard=T(25),joystick=T(25),
|
keyboard=T(25),joystick=T(25),
|
||||||
ctrlSetHelp=T(30),
|
ctrlSetHelp=T(30),
|
||||||
musicRoom=T(80),
|
musicRoom=T(80),nowPlaying=T(50),
|
||||||
nowPlaying=T(50),
|
|
||||||
VKTchW=T(30),VKOrgW=T(30),VKCurW=T(30),
|
VKTchW=T(30),VKOrgW=T(30),VKCurW=T(30),
|
||||||
noScore=T(45),
|
noScore=T(45),highScore=T(30),
|
||||||
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_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="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_beginner", x=0, y=-1000, size=35,shape=1,icon="master", unlock={"master_advance"}},
|
||||||
{name="master_adavnce", x=0, y=-1200, size=35,shape=1,icon="master", unlock={"master_final","GM"}},
|
{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="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={}},
|
{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="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_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="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={}},
|
||||||
}
|
}
|
||||||
600
parts/player.lua
600
parts/player.lua
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,12 @@ SKIN.libColor={
|
|||||||
color.purple,
|
color.purple,
|
||||||
color.magenta,
|
color.magenta,
|
||||||
color.pink,
|
color.pink,
|
||||||
color.darkGrey,
|
color.dGrey,
|
||||||
color.grey,
|
color.grey,
|
||||||
color.lightGrey,
|
color.lGrey,
|
||||||
color.darkPurple,
|
color.dPurple,
|
||||||
color.darkRed,
|
color.dRed,
|
||||||
color.darkGreen,
|
color.dGreen,
|
||||||
}
|
}
|
||||||
function SKIN.load()
|
function SKIN.load()
|
||||||
local _
|
local _
|
||||||
@@ -97,33 +97,33 @@ function SKIN.load()
|
|||||||
gc.pop()
|
gc.pop()
|
||||||
end
|
end
|
||||||
local L=#list
|
local L=#list
|
||||||
function SKIN.prevSet()--prev skin_set
|
function SKIN.prevSet()--Prev skin_set
|
||||||
local _=(setting.skinSet-2)%L+1
|
local _=(setting.skinSet-2)%L+1
|
||||||
setting.skinSet=_
|
setting.skinSet=_
|
||||||
SKIN.change(_)
|
SKIN.change(_)
|
||||||
_=list[_]
|
_=list[_]
|
||||||
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
||||||
end
|
end
|
||||||
function SKIN.nextSet()--next skin_set
|
function SKIN.nextSet()--Next skin_set
|
||||||
local _=setting.skinSet%L+1
|
local _=setting.skinSet%L+1
|
||||||
setting.skinSet=_
|
setting.skinSet=_
|
||||||
SKIN.change(_)
|
SKIN.change(_)
|
||||||
_=list[_]
|
_=list[_]
|
||||||
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
|
||||||
end
|
end
|
||||||
function SKIN.prev(i)--prev skin for [i]
|
function SKIN.prev(i)--Prev skin for [i]
|
||||||
local _=setting.skin
|
local _=setting.skin
|
||||||
_[i]=(_[i]-2)%11+1
|
_[i]=(_[i]-2)%11+1
|
||||||
end
|
end
|
||||||
function SKIN.next(i)--next skin for [i]
|
function SKIN.next(i)--Next skin for [i]
|
||||||
local _=setting.skin
|
local _=setting.skin
|
||||||
_[i]=_[i]%11+1
|
_[i]=_[i]%11+1
|
||||||
end
|
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
|
setting.face[i]=(setting.face[i]+1)%4
|
||||||
SFX.play("rotate")
|
SFX.play("rotate")
|
||||||
end
|
end
|
||||||
function SKIN.change(i)--change to skin_set[i]
|
function SKIN.change(i)--Change to skin_set[i]
|
||||||
blockSkin=SKIN.lib[i]
|
blockSkin=SKIN.lib[i]
|
||||||
blockSkinMini=SKIN.libMini[i]
|
blockSkinMini=SKIN.libMini[i]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ local Tick={}
|
|||||||
function Tick.finish(P)
|
function Tick.finish(P)
|
||||||
P.endCounter=P.endCounter+1
|
P.endCounter=P.endCounter+1
|
||||||
if P.endCounter<40 then
|
if P.endCounter<40 then
|
||||||
|
--Make field visible
|
||||||
for j=1,#P.field do for i=1,10 do
|
for j=1,#P.field do for i=1,10 do
|
||||||
if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end
|
if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end
|
||||||
end end--Make field visible
|
end end
|
||||||
elseif P.endCounter==60 then
|
elseif P.endCounter==60 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -13,9 +14,10 @@ end
|
|||||||
function Tick.lose(P)
|
function Tick.lose(P)
|
||||||
P.endCounter=P.endCounter+1
|
P.endCounter=P.endCounter+1
|
||||||
if P.endCounter<40 then
|
if P.endCounter<40 then
|
||||||
|
--Make field visible
|
||||||
for j=1,#P.field do for i=1,10 do
|
for j=1,#P.field do for i=1,10 do
|
||||||
if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end
|
if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end
|
||||||
end end--Make field visible
|
end end
|
||||||
elseif P.endCounter>80 then
|
elseif P.endCounter>80 then
|
||||||
for i=1,#P.field do
|
for i=1,#P.field do
|
||||||
for j=1,10 do
|
for j=1,10 do
|
||||||
@@ -35,6 +37,7 @@ function Tick.lose(P)
|
|||||||
end
|
end
|
||||||
if not modeEnv.royaleMode and #players>1 then
|
if not modeEnv.royaleMode and #players>1 then
|
||||||
P.y=P.y+P.endCounter*.26
|
P.y=P.y+P.endCounter*.26
|
||||||
|
P.absFieldY=P.absFieldY+P.endCounter*.26
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Tick.throwBadge(data)--{ifAI,Sender,timer}
|
function Tick.throwBadge(data)--{ifAI,Sender,timer}
|
||||||
@@ -52,8 +55,9 @@ function Tick.throwBadge(data)--{ifAI,Sender,timer}
|
|||||||
else
|
else
|
||||||
x2,y2=R.x+66*R.size,R.y+344*R.size
|
x2,y2=R.x+66*R.size,R.y+344*R.size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Generate badge object
|
||||||
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
|
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
|
||||||
--generate badge object
|
|
||||||
|
|
||||||
if not data[1]and data[3]%8==0 then
|
if not data[1]and data[3]%8==0 then
|
||||||
SFX.play("collect")
|
SFX.play("collect")
|
||||||
|
|||||||
1317
parts/updateLog.lua
1317
parts/updateLog.lua
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user