Compare commits

...

25 Commits

Author SHA1 Message Date
MrZ_26
5d74d980e9 0.10.0:回放更新 2020-08-03 16:45:08 +08:00
MrZ_26
25fe724bf8 整理注释 2020-08-03 16:37:43 +08:00
MrZ_26
8b1e406c42 优化复制场地代码 2020-08-03 16:18:22 +08:00
MrZ_26
6ced348734 新过场动画 2020-08-03 16:15:41 +08:00
MrZ_26
858e320434 彩色自定义序列 2020-08-03 16:13:59 +08:00
MrZ_26
7773fca23a 序列复制粘贴,回放 2020-08-03 16:08:21 +08:00
MrZ_26
5a5c843ed9 简洁按钮 2020-08-03 16:02:37 +08:00
MrZ_26
798f691b4c 统一注释位置 2020-08-03 04:16:54 +08:00
MrZ_26
1cbd9e717a stage显示数字错误 2020-08-03 04:01:24 +08:00
MrZ_26
4b010e29b8 更换极简错误音效 2020-08-03 03:45:48 +08:00
MrZ_26
19ea11ffc2 控件动效优化 2020-08-03 03:45:01 +08:00
MrZ_26
c547095169 20G初心评级调整+清除数据 2020-08-02 18:22:28 +08:00
MrZ_26
edfe626988 倒计时条位置微调 2020-08-02 01:57:33 +08:00
MrZ_26
4fb7d3482a debug菜单重置数据 2020-08-01 22:39:13 +08:00
MrZ_26
330396b736 注释首字母大写 2020-07-31 00:35:43 +08:00
MrZ_26
cef926707a 改注释 2020-07-30 23:12:12 +08:00
MrZ_26
ecc88ec360 取消垂直同步 2020-07-30 22:44:35 +08:00
MrZ_26
6b547eed22 100L/400L评级改动 2020-07-30 01:08:54 +08:00
MrZ_26
1545d30edd 更新后跳转 2020-07-30 01:07:45 +08:00
MrZ_26
61277c60dd 玩家掉落动画修复 2020-07-30 00:16:45 +08:00
MrZ_26
3260afcac2 帧率控制代码换回之前的 2020-07-29 02:33:40 +08:00
MrZ_26
e5ed78bac8 暂停界面布局微调 2020-07-29 02:32:51 +08:00
MrZ_26
bd619fc4f4 文本修改 2020-07-28 01:36:56 +08:00
MrZ_26
71960756d1 CC刷新场地细节 2020-07-28 01:36:35 +08:00
MrZ_26
3bef016019 0.9.3:性能优化,细节修改 2020-07-27 00:14:57 +08:00
61 changed files with 2200 additions and 1671 deletions

Binary file not shown.

View File

@@ -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
gc.clear(t,t,t)
end,
}--light-dark
}--Light-dark
back.rgb={
init=function()
t=0
@@ -57,7 +57,7 @@ back.flink={
else gc.clear(0,0,0)
end
end,
}--flash after random time
}--Flash after random time
back.aura={
init=function()
t=rnd()*3600
@@ -76,7 +76,7 @@ back.aura={
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--cool liquid background
}--Cool liquid background
back.game1={
init=function()
t=0
@@ -222,19 +222,20 @@ back.space={
local S=stars
for i=1,1260,5 do
local s=rnd(26,40)*.1
S[i]=s*scr.k --size
S[i+1]=rnd(W)-10 --x
S[i+2]=rnd(H)-10 --y
S[i+3]=(rnd()-.5)*.01*s --vx
S[i+4]=(rnd()-.5)*.01*s --vy
end--800 var
S[i]=s*scr.k --Size
S[i+1]=rnd(W)-10 --X
S[i+2]=rnd(H)-10 --Y
S[i+3]=(rnd()-.5)*.01*s --Vx
S[i+4]=(rnd()-.5)*.01*s --Vy
end
end,
update=function(dt)
local S=stars
--Star moving
for i=1,1260,5 do
S[i+1]=(S[i+1]+S[i+3])%W
S[i+2]=(S[i+2]+S[i+4])%H
end--star moving
end
end,
draw=function()
gc.clear(.2,.2,.2)
@@ -254,13 +255,14 @@ back.space={
end,
}
--Make BG vars invisible
for _,bg in next,back do
if not bg.init then bg.init= NULL end setfenv(bg.init ,BGvars)
if not bg.resize then bg.resize= NULL end setfenv(bg.resize ,BGvars)
if not bg.update then bg.update= NULL end setfenv(bg.update ,BGvars)
if not bg.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars)
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars)
end--make BG vars invisible
end
BG={
cur="none",

View File

@@ -7,25 +7,25 @@ local color={
cyan={0,1,1},
grey={.6,.6,.6},
lightRed={1,.5,.5},
lightGreen={.5,1,.5},
lightBlue={.6,.6,1},
lightCyan={.5,1,1},
lightMagenta={1,.5,1},
lightYellow={1,1,.5},
lightPurple={.8,.4,1},
lightOrange={1,.7,.3},
lightGrey={.8,.8,.8},
lRed={1,.5,.5},
lGreen={.5,1,.5},
lBlue={.6,.6,1},
lCyan={.5,1,1},
lMagenta={1,.5,1},
lYellow={1,1,.5},
lPurple={.8,.4,1},
lOrange={1,.7,.3},
lGrey={.8,.8,.8},
darkRed={.6,0,0},
darkGreen={0,.6,0},
darkBlue={0,0,.6},
darkCyan={0,.6,.6},
darkMagenta={.6,0,.6},
darkYellow={.6,.6,0},
darkPurple={.3,0,.6},
darkOrange={.6,.4,0},
darkGrey={.3,.3,.3},
dRed={.6,0,0},
dGreen={0,.6,0},
dBlue={0,0,.6},
dCyan={0,.6,.6},
dMagenta={.6,0,.6},
dYellow={.6,.6,0},
dPurple={.3,0,.6},
dOrange={.6,.4,0},
dGrey={.3,.3,.3},
black={0,0,0},
orange={1,.6,0},
@@ -36,24 +36,4 @@ local color={
white={1,1,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

View File

@@ -59,7 +59,7 @@ local function dumpTable(L,t)
end
return s..tabs[t-1].."}"
end
local function addToTable(G,base)--refresh default base with G-values
local function addToTable(G,base)--Refresh default base with G-values
for k,v in next,G do
if type(v)==type(base[k])then
if type(v)=="table"then

View File

@@ -18,6 +18,7 @@ local IMG={
miyaF4="miya/f4.png",
electric="mess/electric.png",
hbm="mess/hbm.png",
}
local list={}
local count=0

View File

@@ -29,7 +29,7 @@ local ins,rem=table.insert,table.remove
local scr=scr
local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false
local touching=nil--first touching ID(userdata)
local touching=nil--First touching ID(userdata)
local touchDist=nil
joysticks={}
@@ -150,14 +150,13 @@ function mouseDown.intro(x,y,k)
end
end
function touchDown.intro(id,x,y)
SCN.goto("main")
mouseDown.intro()
end
function keyDown.intro(key)
if key=="escape"then
VOC.play("bye")
SCN.back()
mouseDown.intro(nil,nil,2)
else
SCN.goto("main")
mouseDown.intro()
end
end
@@ -229,7 +228,7 @@ function touchMove.mode(id,x,y,dx,dy)
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
elseif not L[3]then
x,y=xOy:inverseTransformPoint(tc.getPosition(L[1]))
dx,dy=xOy:inverseTransformPoint(tc.getPosition(L[2]))--not delta!!!
dx,dy=xOy:inverseTransformPoint(tc.getPosition(L[2]))--Not delta!!!
local d=(x-dx)^2+(y-dy)^2
if d>100 then
d=d^.5
@@ -388,6 +387,18 @@ function keyDown.sequence(key)
else
sceneTemp.sure=50
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
@@ -460,10 +471,16 @@ function keyDown.draw(key)
SCN.swapTo("custom")
elseif key=="escape"then
SCN.back()
elseif key=="c"and kb.isDown("lctrl","rctrl")then
copyBoard()
elseif key=="v"and kb.isDown("lctrl","rctrl")then
pasteBoard()
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
love.system.setClipboardText("Techmino Field:"..copyBoard())
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=love.system.getClipboardText()
local p=string.find(str,":")--ptr*
if p then str=string.sub(str,p+1)end
if not pasteBoard(str)then
TEXT.show(text.dataCorrupted,350,360,35,"flicker",.5)
end
else
pen=penKey[key]or pen
end
@@ -602,64 +619,68 @@ function keyDown.pause(key)
mergeStat(stat,players[1].stat)
resetGameData()
SCN.swapTo("play","none")
elseif key=="p"and game.result then
TASK.removeTask_code(TICK.autoPause)
resetPartGameData(true)
SCN.swapTo("play","none")
end
end
function touchDown.play(id,x,y)
if setting.VKSwitch then
local t=onVirtualkey(x,y)
if t then
players[1]:pressKey(t)
if setting.VKSFX>0 then
SFX.play("virtualKey",setting.VKSFX*.25)
end
virtualkey[t].isDown=true
virtualkey[t].pressTime=10
if setting.VKTrack then
local B=virtualkey[t]
if setting.VKDodge then--button collision (not accurate)
for i=1,#virtualkey do
local b=virtualkey[i]
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--hit depth(Neg means distance)
if d>0 then
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
end
if not setting.VKSwitch or game.replaying then return end
local t=onVirtualkey(x,y)
if t then
players[1]:pressKey(t)
if setting.VKSFX>0 then
SFX.play("virtualKey",setting.VKSFX*.25)
end
virtualkey[t].isDown=true
virtualkey[t].pressTime=10
if setting.VKTrack then
local B=virtualkey[t]
if setting.VKDodge then--Button collision (not accurate)
for i=1,#virtualkey do
local b=virtualkey[i]
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--Hit depth(Neg means distance)
if d>0 then
b.x=b.x+(b.x-B.x)*d*b.r*5e-4
b.y=b.y+(b.y-B.y)*d*b.r*5e-4
end
end
local O=VK_org[t]
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1
local _OW=1-_FW-_CW
--Auto follow: finger, current, origin (weight from setting)
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
end
VIB(setting.VKVIB)
local O=VK_org[t]
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1
local _OW=1-_FW-_CW
--Auto follow: finger, current, origin (weight from setting)
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
end
VIB(setting.VKVIB)
end
end
function touchUp.play(id,x,y)
if setting.VKSwitch then
local t=onVirtualkey(x,y)
if t then
players[1]:releaseKey(t)
end
if not setting.VKSwitch or game.replaying then return end
local t=onVirtualkey(x,y)
if t then
players[1]:releaseKey(t)
end
end
function touchMove.play(id,x,y,dx,dy)
if setting.VKSwitch then
local l=tc.getTouches()
for n=1,#virtualkey do
local B=virtualkey[n]
for i=1,#l do
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
goto next
end
if not setting.VKSwitch or game.replaying then return end
local l=tc.getTouches()
for n=1,#virtualkey do
local B=virtualkey[n]
for i=1,#l do
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
goto next
end
players[1]:releaseKey(n)
::next::
end
players[1]:releaseKey(n)
::next::
end
end
function keyDown.play(key)
@@ -667,6 +688,7 @@ function keyDown.play(key)
pauseGame()
return
end
if game.replaying then return end
local m=keyMap
for k=1,20 do
if key==m[1][k]or key==m[2][k]then
@@ -678,6 +700,7 @@ function keyDown.play(key)
end
end
function keyUp.play(key)
if game.replaying then return end
local m=keyMap
for k=1,20 do
if key==m[1][k]or key==m[2][k]then
@@ -689,6 +712,8 @@ function keyUp.play(key)
end
function gamepadDown.play(key)
if key=="back"then SCN.back()return end
if game.replaying then return end
local m=keyMap
for k=1,20 do
if key==m[3][k]or key==m[4][k]then
@@ -700,14 +725,14 @@ function gamepadDown.play(key)
end
end
function gamepadUp.play(key)
if game.replaying then return end
local m=keyMap
for p=1,players.human do
for k=1,20 do
if key==m[3][k]or key==m[4][k]then
players[1]:releaseKey(k)
virtualkey[k].isDown=false
return
end
for k=1,20 do
if key==m[3][k]or key==m[4][k]then
players[1]:releaseKey(k)
virtualkey[k].isDown=false
return
end
end
end
@@ -745,15 +770,15 @@ function wheelMoved.history(x,y)
end
function keyDown.history(key)
if key=="up"then
sceneTemp[2]=max(sceneTemp[2]-1,1)
sceneTemp.pos=max(sceneTemp.pos-1,1)
elseif key=="down"then
sceneTemp[2]=min(sceneTemp[2]+1,#sceneTemp[1])
sceneTemp.pos=min(sceneTemp.pos+1,#sceneTemp.text)
elseif key=="escape"then
SCN.back()
end
end
-------------------------------------------------------------
local lastX,lastY=0,0--last clickDown pos
local lastX,lastY=0,0--Last clickDown pos
function love.mousepressed(x,y,k,t,num)
if t then return end
mouseShow=true
@@ -808,7 +833,7 @@ function love.touchpressed(id,x,y)
touching=id
love.touchmoved(id,x,y,0,0)
end
touchDist=nil--reset distance
touchDist=nil--Reset distance
x,y=xOy:inverseTransformPoint(x,y)
lastX,lastY=x,y
if touchDown[SCN.cur]then
@@ -849,8 +874,19 @@ function love.touchreleased(id,x,y)
end
function love.keypressed(i)
mouseShow=false
if SCN.swapping then return end
if devMode then
if not devMode then
if i~="f8"then
if SCN.swapping then return end
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
elseif i=="escape"then SCN.back()
else WIDGET.keyPressed(i)
end
else
devMode=1
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
end
else
if i=="f5"then
print("DEBUG:")
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
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
function love.keyreleased(i)
@@ -987,6 +1015,7 @@ end
function love.focus(f)
if f then
TASK.new(TICK.autoResize,{0})
love.timer.step()
elseif SCN.cur=="play"and setting.autoPause then
pauseGame()
end
@@ -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 devColor={
color.white,
color.lightMagenta,
color.lightGreen,
color.lightBlue,
color.lMagenta,
color.lGreen,
color.lBlue,
}
local FPS=love.timer.getFPS
love.draw,love.update=nil
function love.run()
local T=love.timer
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 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())
SCN.init("load")--Scene Launch
marking=true
return function()
local _
lastFrame=Timer()
--EVENT
PUMP()
for N,a,b,c,d,e in POLL()do
@@ -1025,7 +1063,8 @@ function love.run()
end
--UPDATE
STEP()local dt=GETDelta()
STEP()
local dt=GETDelta()
TASK.update()
VOC.update()
BG.update(dt)
@@ -1045,8 +1084,14 @@ function love.run()
BG.draw()
gc.push("transform")
gc.replaceTransform(xOy)
--Draw scene contents
if Pnt[SCN.cur]then Pnt[SCN.cur]()end
WIDGET.draw()--Draw widgets
--Draw widgets
WIDGET.draw()
--Draw cursor
if mouseShow then
local r=Timer()*.5
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.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end--Awesome mouse!
end
sysFX.draw()
TEXT.draw()
gc.pop()
--Draw power info.
gc.setColor(1,1,1)
if setting.powerInfo then
gc.draw(infoCanvas,0,0,0,scr.k)
end
--Power Info
--Draw scene swapping animation
if SCN.swapping then
_=SCN.swap
_.draw(_.time)
end--Scene swapping animation
end
setFont(15)
--Draw FPS
gc.setColor(1,1,1)
setFont(15)
_=scr.h-20
gc.print(FPS(),5,_)
--Debug info.
if devMode then
gc.setColor(devColor[devMode])
gc.print("Cache used:"..gcinfo(),5,_-20)
gc.print("Free Row:"..freeRow.getCount(),5,_-40)
gc.print("Mouse:"..mx.." "..my,5,_-60)
gc.print("Memory:"..gcinfo(),5,_-20)
gc.print("Lines:"..freeRow.getCount(),5,_-40)
gc.print("Cursor:"..mx.." "..my,5,_-60)
gc.print("Voices:"..VOC.getCount(),5,_-80)
gc.print("Tasks:"..TASK.getCount(),5,_-100)
if devMode==3 then love.timer.sleep(.26)
elseif devMode==4 then love.timer.sleep(.626)
ins(LIST,1,dt)rem(LIST,126)
for i=1,#LIST do
gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000)
end
end--DEV info
if devMode==3 then WAIT(.26)
elseif devMode==4 then WAIT(.626)
end
end
gc.present()
end
end
--FRAME TIME CTRL
if Timer()-lastFrame<.058 then WAIT(.01)end
while Timer()-lastFrame<.0159 do WAIT(.001)end
--FRESH POWERINFO
lastFrame=Timer()
--Fresh power info.
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
updatePowerInfo()
lastFreshPow=Timer()
end
--Keep 60fps
_=Timer()-lastFrame
if _<.016 then WAIT(.016-_)end
while Timer()-lastFrame<1/60-0.000005 do WAIT(0)end
end
end

View File

@@ -2,6 +2,7 @@ local langList={
{
anykey="按任意键继续",
newVersion="检测到更新!",
newBigVersion="检测到大更新!大量存档信息被改动",
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
lang="中文",
atkModeName={"随机","徽章","击杀","反击"},
@@ -12,6 +13,7 @@ local langList={
mini="Mini",b2b="B2B ",b3b="B2B2B ",
PC="Perfect Clear",HPC="Half Clear",
hold="暂存",next="下一个",
replaying="[回放]",
stage=function(n)return"关卡 "..n end,
great="Great!",
@@ -164,9 +166,9 @@ local langList={
"程序:MrZ, FinnTenzor",
"美术:MrZ, (Gnyar)",
"音乐:MrZ, (T0722)",
"音效:MrZ",
"语音:Miya, MrZ",
"官网:渣渣120",
"音效/语音: MrZ, Miya",
"演出: 模电, 吉备宏纯",
"官网: 渣渣120",
"",
"特别感谢:",
"Flyz, Farter, 蕴空之灵,",
@@ -228,6 +230,8 @@ local langList={
right="",
backsp="<X",
reset="R",
copy="复制",
paste="粘贴",
back="返回",
},
draw={
@@ -244,9 +248,10 @@ local langList={
pause="暂停",
},
pause={
setting="设置(S)",
replay= "回放(P)",
resume= "继续(esc)",
restart="重新开始(R)",
setting="设置(S)",
quit= "退出(Q)",
},
setting_game={
@@ -351,7 +356,7 @@ local langList={
},
setting_lang={
back="返回",
},--langName added later
},--LangName added later
help={
staff="制作人员",
his="更新历史",
@@ -373,7 +378,10 @@ local langList={
debug={
killWTM="关闭水印",
unlock="解锁全模式",
reset="清空所有数据",
reset="重置?",
reset1="重置解锁/等级",
reset2="重置统计",
reset3="清空所有数据",
back="返回",
},
},
@@ -404,8 +412,8 @@ local langList={
["round_3"]= {"回合制", "困难", "下棋模式"},
["round_4"]= {"回合制", "疯狂", "下棋模式"},
["round_5"]= {"回合制", "极限", "下棋模式"},
["master_beginner"]= {"大师", "疯狂", "20G:初心者适用"},
["master_adavnce"]= {"大师", "极限", "20G:上级者的挑战"},
["master_beginner"]= {"大师", "疯狂", "20G初心者练习"},
["master_advance"]= {"大师", "极限", "上级者20G挑战"},
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
["GM"]= {"宗师", "GM", "成为方块大师"},
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
@@ -457,6 +465,7 @@ local langList={
{
anykey="按任意键继续",
newVersion="检测到更新!",
newBigVersion="检测到大更新!大量存档信息被改动",
marking="游戏作者:MrZ_26\n任何视频/直播不得出现此水印\n任何转述声明无效",
lang="全中文",
atkModeName={"随机","徽章","击杀","反击"},
@@ -467,6 +476,7 @@ local langList={
mini="迷你",b2b="满贯",b3b="大满贯",
PC="场地全清",HPC="场地半清",
hold="暂存",next="下一个",
replaying="[回放]",
stage=function(n)return"关卡 "..n end,
great="不错!",
@@ -616,9 +626,9 @@ local langList={
"程序:MrZ, FinnTenzor",
"美术:MrZ, (T0722, Gnyar)",
"音乐:MrZ, (T0722)",
"音效:MrZ",
"语音:Miya, MrZ",
"官网:渣渣120",
"音效/语音: MrZ, Miya",
"演出: 模电, 吉备宏纯",
"官网: 渣渣120",
"",
"特别感谢:",
"Flyz, Farter, 蕴空之灵,",
@@ -680,6 +690,8 @@ local langList={
right="",
backsp="<X",
reset="R",
copy="复制",
paste="粘贴",
back="返回",
},
draw={
@@ -696,9 +708,10 @@ local langList={
pause="暂停",
},
pause={
setting="设置(S)",
replay= "回放(P)",
resume= "继续(esc)",
restart="重新开始(R)",
setting="设置(S)",
quit= "退出(Q)",
},
setting_game={
@@ -803,7 +816,7 @@ local langList={
},
setting_lang={
back="返回",
},--langName added later
},--LangName added later
help={
staff="制作人员",
his="更新历史",
@@ -825,7 +838,10 @@ local langList={
debug={
killWTM="关闭水印",
unlock="解锁全模式",
reset="清空所有数据",
reset="重置?",
reset1="重置解锁/等级",
reset2="重置统计",
reset3="清空所有数据",
back="返回",
},
},
@@ -856,8 +872,8 @@ local langList={
["round_3"]= {"回合制", "困难", "下棋模式"},
["round_4"]= {"回合制", "疯狂", "下棋模式"},
["round_5"]= {"回合制", "极限", "下棋模式"},
["master_beginner"]= {"大师", "疯狂", "20G:初心者适用"},
["master_adavnce"]= {"大师", "极限", "20G:上级者的挑战"},
["master_beginner"]= {"大师", "疯狂", "20G初心者练习"},
["master_advance"]= {"大师", "极限", "上级者20G挑战"},
["master_final"]= {"大师", "终点", "究极20G:无法触及的终点"},
["GM"]= {"宗师", "GM", "成为方块大师"},
["blind_easy"]= {"隐形", "半隐", "不强大脑"},
@@ -909,16 +925,18 @@ local langList={
{
anykey="Press any button",
newVersion="Updating detected!",
newBigVersion="Big updating detected! Save data altered",
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
lang="English",
atkModeName={"Random","Badges","K.O.s","Attackers"},
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"},
block=nil,spin="-spin ",
clear={"single","double"," triple","Techrash","Techrash+"},
clear={"single","double","triple","Techrash","Techrash+"},
mini="Mini",b2b="B2B ",b3b="B2B2B ",
PC="Perfect Clear",HPC="Clear",
hold="Hold",next="Next",
replaying="[Replaying]",
stage=function(n)return"Stage "..n end,
great="Great!",
@@ -1065,8 +1083,8 @@ local langList={
"Program: MrZ, FinnTenzor",
"Art: MrZ, (Gnyar)",
"Music: MrZ, (T0722)",
"Sound: MrZ",
"Voice: Miya, MrZ",
"Voice/ Sound: MrZ, Miya",
"Performance: 模电 吉备宏纯",
"Web: 渣渣120",
"",
"Special Thanks:",
@@ -1121,6 +1139,8 @@ local langList={
right="",
backsp="<X",
reset="R",
copy="Copy",
paste="Paste",
back="Back",
},
draw={
@@ -1137,9 +1157,10 @@ local langList={
pause="Pause",
},
pause={
setting="Settings (S)",
replay="Replay (P)",
resume="Resume (esc)",
restart="Retry (R)",
setting="Settings (S)",
quit="Quit (Q)",
},
setting_game={
@@ -1244,7 +1265,7 @@ local langList={
},
setting_lang={
back="Back",
},--langName added later
},--LangName added later
help={
staff="Staff",
his="History",
@@ -1264,9 +1285,12 @@ local langList={
back="Back",
},
debug={
killWTM="kill watermark",
unlock="unlock all",
reset="reset all",
killWTM="Kill watermark",
unlock="Unlock all",
reset="Reset?",
reset1="Reset rank",
reset2="Reset data",
reset3="Reset ALL",
back="Back",
},
},
@@ -1297,8 +1321,8 @@ local langList={
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
["master_beginner"]= {"Master", "LUNATIC", "20G: For beginners."},
["master_adavnce"]= {"Master", "ULTIMATE", "20G: Professional challenge!"},
["master_beginner"]= {"Master", "LUNATIC", "For 20G beginners."},
["master_advance"]= {"Master", "ULTIMATE", "Professional 20G challenge!"},
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
["blind_easy"]= {"Blind", "HALF", "For novice players."},
@@ -1350,6 +1374,7 @@ local langList={
{
anykey="↓□↓",
newVersion="&!!!",
newBigVersion="&!!!~~~",
marking="Game Author:MrZ_26\nIllegal recording if see this\nAny explanation invalid",
lang="?????",
atkModeName={"?","( )","!","←→"},
@@ -1360,6 +1385,7 @@ local langList={
mini="v",b2b="^ ",b3b="^^ ",
PC="#<>#",HPC="<>",
hold="[ ]",next="",
replaying="[Replaying]",
stage=function(n)return"::"..n.."::"end,
great="!~",
@@ -1502,8 +1528,8 @@ local langList={
"Program: MrZ, FinnTenzor",
"Art: MrZ, (Gnyar)",
"Music: MrZ, (T0722)",
"Sound: MrZ",
"Voice: Miya, MrZ",
"Voice/ Sound: MrZ, Miya",
"Performance: 模电 吉备宏纯",
"Web: 渣渣120",
"",
"Special Thanks:",
@@ -1558,6 +1584,8 @@ local langList={
right="",
backsp="<X",
reset="R",
copy="→__",
paste="__→",
back="X",
},
draw={
@@ -1574,9 +1602,10 @@ local langList={
pause="||",
},
pause={
setting="_?_ (S)",
replay="## (P)",
resume="!! (esc)",
restart="_→_ (R)",
setting="_?_ (S)",
quit="X (Q)",
},
setting_game={
@@ -1681,7 +1710,7 @@ local langList={
},
setting_lang={
back="X",
},--langName added later
},--LangName added later
help={
staff="Orz",
his="_&_",
@@ -1701,9 +1730,12 @@ local langList={
back="X",
},
debug={
killWTM="kill watermark",
unlock="unlock all",
reset="reset all",
killWTM="Kill watermark",
unlock="Unlock all",
reset="Reset?",
reset1="Reset rank",
reset2="Reset data",
reset3="Reset ALL",
back="X",
},
},
@@ -1734,8 +1766,8 @@ local langList={
["round_3"]= {"Turn-Based", "HARD", "Chess mode"},
["round_4"]= {"Turn-Based", "LUNATIC", "Chess mode"},
["round_5"]= {"Turn-Based", "ULTIMATE", "Chess mode"},
["master_beginner"]= {"Master", "LUNATIC", "20G: For beginners."},
["master_adavnce"]= {"Master", "ULTIMATE", "20G: Professional challenge!"},
["master_beginner"]= {"Master", "LUNATIC", "For 20G beginners."},
["master_advance"]= {"Master", "ULTIMATE", "Professional 20G challenge!"},
["master_final"]= {"Master", "FINAL", "20G: Unreachable end point!"},
["GM"]= {"GrandMaster", "GM", "To be Grand Master"},
["blind_easy"]= {"Blind", "HALF", "For novice players."},
@@ -1831,6 +1863,7 @@ local gc=love.graphics
local LANG={}
local drawableTextLoad={
"anykey",
"replaying",
"next","hold",
"win","finish","lose","pause",
"custom","sequence",

View File

@@ -26,7 +26,7 @@ local function draw(L)
lightRenderShader:send("xresolution",L.size);
shadowMapShader:send("yresolution",L.size);
--get up-left of light
--Get up-left of light
local X=L.x-L.size*.5
local Y=L.y-L.size*.5
@@ -74,10 +74,10 @@ function LIGHT.add(x,y,R,F)
--Methods
id=id,
x=x,y=y,size=R,
blackCanvas=gc.newCanvas(R,R),--solid canvas
blackCanvas=gc.newCanvas(R,R),--Solid canvas
shadowCanvas=gc.newCanvas(R,1),--1D vis-depth canvas
renderCanvas=gc.newCanvas(R,R),--light canvas
blackFn=F,--solid draw funcion
renderCanvas=gc.newCanvas(R,R),--Light canvas
blackFn=F,--Solid draw funcion
move=move,

View File

@@ -9,12 +9,12 @@ local mStr=mStr
local scr=scr
local scs=require("parts/spinCenters")
local modeRankColor={
color.bronze, --Rank1
color.lightGrey, --Rank2
color.lightYellow, --Rank3
color.lightPurple, --Rank4
color.lightCyan, --Rank5
color.purple, --Special
color.bronze, --Rank1
color.lGrey, --Rank2
color.lYellow, --Rank3
color.lPurple, --Rank4
color.lCyan, --Rank5
color.lGreen, --Special
}
local rankString={
"D","C","B","A","S",
@@ -66,7 +66,7 @@ local function drawVirtualkey()
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)--Button outline
_=V[i].pressTime
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--icon
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--Icon
if _>0 then
gc.setColor(1,1,1,a*_*.08)
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
@@ -186,6 +186,7 @@ function Pnt.mode()
local sel=cam.sel
setFont(30)
--Draw lines connecting modes
gc.setLineWidth(8)
gc.setColor(1,1,1,.2)
for name,M in next,Modes do
@@ -195,7 +196,7 @@ function Pnt.mode()
gc.line(M.x,M.y,m.x,m.y)
end
end
end--lines connecting modes
end
for name,M in next,Modes do
if R[name]then
@@ -217,7 +218,7 @@ function Pnt.mode()
gc.setLineWidth(10)
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
end
elseif M.shape==2 then--diamond
elseif M.shape==2 then--Diamond
gc.circle("fill",M.x,M.y,S+5,4)
if sel==name then
gc.setColor(1,1,1)
@@ -353,10 +354,14 @@ function Pnt.sequence()
gc.print(len,120,300)
local L=TEXTURE.miniBlock
local lib=SKIN.libColor
local set=setting.skin
local x,y=120,126
local cx,cy=120,126
for i=1,len do
local B=L[bag[i]]
gc.setColor(lib[set[bag[i]]])
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
x=x+B:getWidth()*15+10
if x>1126 then
@@ -441,6 +446,7 @@ function Pnt.play()
for p=1,#players do
players[p]:draw()
end
gc.setLineWidth(5)
for i=1,#FX_attack do
local A=FX_attack[i]
@@ -463,9 +469,11 @@ function Pnt.play()
gc.rotate(A.t*.1)
gc.circle("fill",0,0,A.rad,A.corner)
gc.pop()
end--FX animation
end
gc.setColor(1,1,1)
if setting.VKSwitch then drawVirtualkey()end
if modeEnv.royaleMode then
for i=1,#FX_badge do
local b=FX_badge[i]
@@ -501,7 +509,13 @@ function Pnt.play()
gc.draw(drawableText.modeName,485,10)
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10)
--Danger
--Replaying
if game.replaying then
gc.setColor(1,1,Timer()%1>.5 and 1 or 0)
mText(drawableText.replaying,410,17)
end
--Warning
gc.push("transform")
gc.origin()
if restartCount>0 then
@@ -545,8 +559,8 @@ function Pnt.pause()
--Mode Info
_=drawableText.modeName
gc.draw(_,40,180)
gc.draw(drawableText.levelName,60+_:getWidth(),180)
gc.draw(_,40,170)
gc.draw(drawableText.levelName,60+_:getWidth(),170)
--Result Text
setFont(35)
@@ -843,6 +857,6 @@ function Pnt.history()
gc.rectangle("line",30,45,1000,632)
setFont(20)
local _=sceneTemp
gc.print(_[1][_[2]],40,50)
gc.print(_.text[_.pos],40,50)
end
return Pnt

View File

@@ -1,20 +1,9 @@
local gc=love.graphics
local int,max,log=math.floor,math.max,math.log
local int,abs=math.floor,math.abs
local max,log=math.max,math.log
local rnd,sin,cos=math.random,math.sin,math.cos
local format=string.format
local scr=scr
local SCN={
cur="load",--Current scene
swapping=false,--ifSwapping
swap={
tar=nil, --Swapping target
style=nil, --Swapping style
mid=nil, --Loading point
time=nil, --Full swap time
draw=nil, --Swap draw func
},
seq={"quit","slowFade"},--Back sequence
}--scene datas,returned
local sceneInit={}
sceneInit.quit=love.event.quit
@@ -50,11 +39,18 @@ end
function sceneInit.main()
BG.set("space")
BGM.play("blank")
destroyPlayers()
game.frame=0
game.recording=false
game.replaying=false
game.seed=1046101471
game.rec={}
modeEnv={}
if not players[1]then
PLY.newDemoPlayer(1,900,35,1.1)
end--Create demo player
destroyPlayers()
--Create demo player
PLY.newDemoPlayer(1,900,35,1.1)
end
function sceneInit.music()
if BGM.nowPlay then
@@ -120,18 +116,18 @@ function sceneInit.pause(org)
timer=org=="play"and 0 or 50,
list={
toTime(S.time),
S.key.."/"..S.rotate.."/"..S.hold,
format("%d/%d/%d",S.key,S.rotate,S.hold),
format("%d %.2fPPS",S.piece,S.piece/S.time),
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
format("%d(%d)",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/%d",S.clears[1],S.clears[2],S.clears[3],S.clears[4]),
format("(%d)/%d/%d/%d",S.spins[1],S.spins[2],S.spins[3],S.spins[4]),
format("%d(+%d)/%d(%d)",S.b2b,S.b3b,S.pc,S.hpc),
format("%d/%d;%d/%d",S.b2b,S.b3b,S.pc,S.hpc),
format("%d[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
},
--from right-down, 60 degree each
--From right-down, 60 degree each
radar={
(S.off+S.dig)/S.time*60,--DefPM
(S.off)/S.time*60, --OffPM
@@ -186,7 +182,10 @@ function sceneInit.setting_video()
BG.set("space")
end
function sceneInit.setting_sound()
sceneTemp={last=0,jump=0}--last sound time,animation count(10 to 0)
sceneTemp={
last=0,--Last sound time
jump=0,--Animation timer(10 to 0)
}
BG.set("space")
end
function sceneInit.setting_control()
@@ -207,7 +206,7 @@ function sceneInit.setting_key()
}
end
function sceneInit.setting_touch()
BG.set("game2")
BG.set("game3")
sceneTemp={
default=1,
snap=1,
@@ -265,12 +264,19 @@ function sceneInit.stat()
end
end
function sceneInit.history()
BG.set("game1")
sceneTemp={require("parts/updateLog"),1}--scroll pos
BG.set("game3")
sceneTemp={
text=require("parts/updateLog"),--Text list
pos=1,--Scroll pos
}
if newVersionLaunch then
newVersionLaunch=nil
sceneTemp.pos=4
end
end
function sceneInit.debug()
sceneTemp={
ct=0,
reset=false,
}
end
function sceneInit.quit()
@@ -282,40 +288,47 @@ function sceneInit.quit()
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()
local S=SCN.swap
S.time=S.time-1
@@ -342,9 +355,38 @@ function SCN.push(tar,style)
end
function SCN.pop()
local _=SCN.seq
_[#_-1]=nil
_[#_],_[#_-1]=nil
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
if not SCN.swapping and tar~=SCN.cur then
SCN.swapping=true
@@ -357,17 +399,18 @@ function SCN.swapTo(tar,style)
S.draw=swap[3]
end
end
function SCN.goto(tar,style)
function SCN.goto(tar,style)--Normal scene swapping, can back
SCN.push()SCN.swapTo(tar,style)
end
function SCN.back()
if backFunc[SCN.cur] then backFunc[SCN.cur]()end
--func when scene end
--Leave scene
if sceneBack[SCN.cur] then sceneBack[SCN.cur]()end
--Poll&Back to previous Scene
local m=#SCN.seq
if m>0 then
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
SCN.seq[m],SCN.seq[m-1]=nil
--Poll&Back to preScene
end
end
return SCN

View File

@@ -38,7 +38,7 @@ function SFX.fieldPlay(s,v,P)
end
function SFX.play(s,vol,pos,force)
if setting.sfx==0 and not force then return end
local S=SFX.list[s]--source list
local S=SFX.list[s]--Source list
if not S then return end
local n=1
while S[n]:isPlaying()do

View File

@@ -9,6 +9,6 @@ return{
aura=N("aura"),
gradient1=N("grad1"),--Horizonal red-blue gradient
gradient2=N("grad2"),--Vertical red-green gradient
rgb1=N("rgb1"),--colorful RGB
rgb2=N("rgb2"),--blue RGB
rgb1=N("rgb1"),--Colorful RGB
rgb2=N("rgb2"),--Blue RGB
}

View File

@@ -3,9 +3,9 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
return vec4(
.8-y*.6-.2*sin(t/6.26),
.3+.1*sin(t),
.2+x*.6,
.8-y*.7+.2*sin(t/6.26),
.2+y*.5+.15*sin(t/4.),
.2+x*.6-.1*sin(t/2.83),
1.
);
}

View File

@@ -74,7 +74,7 @@ local TEXT={}
function TEXT.clear()
texts={}
end
function TEXT.getText(text,x,y,font,style,spd,stop)
function TEXT.getText(text,x,y,font,style,spd,stop)--Another version of TEXT()
return{
c=0,
text=text,
@@ -85,17 +85,17 @@ function TEXT.getText(text,x,y,font,style,spd,stop)
stop=stop,
draw=textFX[style]or assert(false,"unavailable type:"..style),
}
end--another version of TEXT()
end
function TEXT.show(text,x,y,font,style,spd,stop)
texts[#texts+1]={
c=0, --timer
text=text, --string
x=x or 0, --x
y=y or 0, --y
font=font or 40, --font
spd=(spd or 1)/60, --timing speed(1=last 1 sec)
stop=stop, --stop time(sustained text)
draw=textFX[style]or assert(false,"unavailable type:"..style), --draw method
c=0, --Timer
text=text, --String
x=x or 0, --X
y=y or 0, --Y
font=font or 40, --Font
spd=(spd or 1)/60, --Timing speed(1=last 1 sec)
stop=stop, --Stop time(sustained text)
draw=textFX[style]or assert(false,"unavailable type:"..style), --Draw method
}
end
function TEXT.update(list)

View File

@@ -18,8 +18,8 @@ function Tmr.load()
elseif S.phase==4 then
IMG.loadOne(S.cur)
elseif S.phase==5 then
local m=Modes[S.cur]--mode template
local M=require("modes/"..m.name)--mode file
local m=Modes[S.cur]--Mode template
local M=require("modes/"..m.name)--Mode file
Modes[m.name],Modes[S.cur]=M
for k,v in next,m do
M[k]=v
@@ -38,7 +38,12 @@ function Tmr.load()
S.cur=S.cur+1
S.tar=S.cur
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
return
end
@@ -62,25 +67,6 @@ end
function Tmr.main(dt)
players[1]:update(dt)
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)
local cam=mapCam
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
end
cam.x,cam.y=x,y
--keyboard controlling
--Keyboard controlling
cam.x1=cam.x1*.85+x*.15
cam.y1=cam.y1*.85+y*.15
@@ -160,9 +146,11 @@ function Tmr.draw()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.play(dt)
local _
game.frame=game.frame+1
stat.time=stat.time+dt
local P1=players[1]
--Update attack FX
for i=#FX_attack,1,-1 do
local b=FX_attack[i]
b.t=b.t+1
@@ -170,15 +158,16 @@ function Tmr.play(dt)
b.rad=b.rad*1.05+.1
b.x,b.y=b.x2,b.y2
elseif b.t>10 then
local t=((b.t-10)*.025)t=(3-2*t)*t*t
b.x,b.y=b.x1*(1-t)+b.x2*t,b.y1*(1-t)+b.y2*t
_=(b.t-10)*.025
_=(3-2*_)*_*_
b.x,b.y=b.x1*(1-_)+b.x2*_,b.y1*(1-_)+b.y2*_
end
if b.t<60 then
local L=FX_attack[i].drag
if #L==4*setting.atkFX then
rem(L,1)rem(L,1)
_=FX_attack[i].drag
if #_==4*setting.atkFX then
rem(_,1)rem(_,1)
end
ins(L,b.x)ins(L,b.y)
ins(_,b.x)ins(_,b.y)
else
for i=i,#FX_attack do
FX_attack[i]=FX_attack[i+1]
@@ -186,6 +175,7 @@ function Tmr.play(dt)
end
end
--Update badge FX
for i=#FX_badge,1,-1 do
local b=FX_badge[i]
b.t=b.t+1
@@ -193,14 +183,38 @@ function Tmr.play(dt)
rem(FX_badge,i)
end
end
local _
for i=1,#virtualkey do
_=virtualkey[i]
if _.pressTime>0 then
_.pressTime=_.pressTime-1
--Update virtualkey animation
if setting.VKSwitch then
for i=1,#virtualkey do
_=virtualkey[i]
if _.pressTime>0 then
_.pressTime=_.pressTime-1
end
end
end
local P1=players[1]
--Replay
if game.replaying then
_=game.replaying
local L=game.rec
while game.frame==L[_]do
local k=L[_+1]
if k>0 then
P1:pressKey(k)
virtualkey[k].isDown=true
virtualkey[k].pressTime=10
else
virtualkey[-k].isDown=false
P1:releaseKey(-k)
end
_=_+2
end
game.replaying=_
end
--Counting,include pre-das,directy RETURN,or restart counting
if game.frame<180 then
if game.frame==179 then
gameStart()
@@ -224,26 +238,31 @@ function Tmr.play(dt)
if restartCount>20 then
TASK.clear("play")
mergeStat(stat,P1.stat)
resetGameData()
resetPartGameData()
return
end
elseif restartCount>0 then
restartCount=restartCount>2 and restartCount-2 or 0
end--Counting,include pre-das,directy RETURN,or restart counting
end
--Update players
for p=1,#players do
local P=players[p]
P:update(dt)
end
--Fresh royale target
if game.frame%120==0 then
if modeEnv.royaleMode then freshMostDangerous()end
end
--Warning check
if P1.alive then
if game.frame%26==0 and setting.warn then
local F=P1.field
local M=#F
local height=0--max height of row 4~7
local height=0--Max height of row 4~7
for x=4,7 do
for y=M,1,-1 do
for y=#F,1,-1 do
if F[y][x]>0 then
if y>height then
height=y
@@ -254,13 +273,13 @@ function Tmr.play(dt)
end
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
end
local M=game.warnLVL
if M<game.warnLVL0 then
M=M*.95+game.warnLVL0*.05
elseif M>0 then
M=max(M-.026,0)
_=game.warnLVL
if _<game.warnLVL0 then
_=_*.95+game.warnLVL0*.05
elseif _>0 then
_=max(_-.026,0)
end
game.warnLVL=M
game.warnLVL=_
elseif game.warnLVL>0 then
game.warnLVL=max(game.warnLVL-.026,0)
end

View File

@@ -57,7 +57,7 @@ local function getVoice(str)
end
end
return L[n]
--load voice with string
--Load voice with string
end
function VOC.loadOne(_)
local N=VOC.name[_]
@@ -94,21 +94,21 @@ function VOC.update()
Q[1]:setVolume(setting.voc*.1)
Q[1]:play()
Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--playing 1,ready 2
elseif Q.s==2 then--Playing 1,ready 2
if Q[1]:getDuration()-Q[1]:tell()<.08 then
Q[2]=getVoice(Q[2])
Q[2]:setVolume(setting.voc*.1)
Q[2]:play()
Q.s=3
end
elseif Q.s==3 then--playing 12 same time
elseif Q.s==3 then--Playing 12 same time
if not Q[1]:isPlaying()then
for i=1,#Q do
Q[i]=Q[i+1]
end
Q.s=Q[2]and 2 or 4
end
elseif Q.s==4 then--playing last
elseif Q.s==4 then--Playing last
if not Q[1].isPlaying(Q[1])then
Q[1]=nil
Q.s=0
@@ -124,10 +124,10 @@ function VOC.play(s,chn)
if not _ then print("no VOC called:"..s)return end
L[#L+1]=_[rnd(#_)]
L.s=1
--add to queue[chn]
--Add to queue[chn]
else
voiceQueue[VOC.getFreeChannel()]={s=1,VOC.list[s][rnd(#VOC.list[s])]}
--create new channel & play
--Create new channel & play
end
end
end

View File

@@ -3,48 +3,62 @@ local kb=love.keyboard
local int,abs=math.floor,math.abs
local format=string.format
local color=color
local EMPTY={}
local setFont=setFont
local button={
type="button",
ATV=0,--activating time(0~8)
ATV=0,--Activating time(0~8)
}
function button:reset()
self.ATV=0
end
function button:isAbove(x,y)
return x>self.x-self.ATV and x<self.x+self.w+2*self.ATV and y>self.y-self.ATV and y<self.y+self.h+2*self.ATV
local ATV=self.ATV
return
x>self.x-ATV and
y>self.y-ATV and
x<self.x+self.w+2*ATV and
y<self.y+self.h+2*ATV
end
function button:getCenter()
return self.x+self.w*.5,self.y+self.h*.5
end
function button:FX()
sysFX.new("ripple",.16,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV)
local ATV=self.ATV
sysFX.new(
"ripple",
.16,
self.x-ATV,
self.y-ATV,
self.w+2*ATV,
self.h+2*ATV
)
end
function button:update()
local ATV=self.ATV
if WIDGET.sel==self then
if self.ATV<8 then self.ATV=self.ATV+1 end
if ATV<8 then self.ATV=ATV+1 end
else
if self.ATV>0 then self.ATV=self.ATV-1 end
if ATV>0 then self.ATV=ATV-.5 end
end
end
function button:draw()
local x,y,w,h=self.x,self.y,self.w,self.h
local ATV=self.ATV
local r,g,b=unpack(self.color)
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
gc.rectangle("fill",x-self.ATV,y-self.ATV,w+2*self.ATV,h+2*self.ATV)
if self.ATV>0 then
gc.rectangle("fill",x-ATV,y-ATV,w+2*ATV,h+2*ATV)
if ATV>0 then
gc.setLineWidth(4)
gc.setColor(1,1,1,self.ATV*.125)
gc.rectangle("line",x-self.ATV+2,y-self.ATV+2,w+2*self.ATV-4,h+2*self.ATV-4)
gc.setColor(1,1,1,ATV*.125)
gc.rectangle("line",x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4)
end
local t=self.text
if t then
if type(t)=="function"then t=t()end
setFont(self.font)
local y0=y+h*.5-self.font*.7
gc.setColor(1,1,1,.3)
local y0=y+h*.5-self.font*.7-ATV*.5
gc.setColor(1,1,1,.2+ATV*.05)
gc.printf(t,x-2,y0-2,w,"center")
gc.printf(t,x-2,y0+2,w,"center")
gc.printf(t,x+2,y0-2,w,"center")
@@ -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))
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={
type="switch",
ATV=0,--activating time(0~8)
CHK=0,--check alpha(0~6)
ATV=0,--Activating time(0~8)
CHK=0,--Check alpha(0~6)
}
function switch:reset()
self.ATV=0
@@ -75,7 +139,7 @@ end
function switch:update()
local _=self.ATV
if WIDGET.sel==self then if _<8 then self.ATV=_+1 end
else if _>0 then self.ATV=_-1 end
else if _>0 then self.ATV=_-.5 end
end
_=self.CHK
if self:disp()then if _<6 then self.CHK=_+1 end
@@ -84,10 +148,11 @@ function switch:update()
end
function switch:draw()
local x,y=self.x,self.y-25
local ATV=self.ATV
--Checked
if self.ATV>0 then
gc.setColor(1,1,1,self.ATV*.08)
if ATV>0 then
gc.setColor(1,1,1,ATV*.08)
gc.rectangle("fill",x,y,50,50)
end
if self.CHK>0 then
@@ -98,7 +163,7 @@ function switch:draw()
--Frame
gc.setLineWidth(4)
gc.setColor(1,1,1,.6+self.ATV*.05)
gc.setColor(1,1,1,.6+ATV*.05)
gc.rectangle("line",x,y,50,50)
--Text
@@ -106,7 +171,7 @@ function switch:draw()
if t then
gc.setColor(1,1,1)
setFont(self.font)
gc.printf(t,x-412,y+20-self.font*.7,400,"right")
gc.printf(t,x-412-ATV,y+20-self.font*.7-ATV*.5,400,"right")
end
end
function switch:getInfo()
@@ -115,8 +180,8 @@ end
local slider={
type="slider",
ATV=0,--activating time(0~8)
pos=0,--position shown
ATV=0,--Activating time(0~8)
pos=0,--Position shown
}
function slider:reset()
self.ATV=0
@@ -133,7 +198,7 @@ function slider:update()
if WIDGET.sel==self then
if _<6 then self.ATV=_+1 end
else
if _>0 then self.ATV=_-1 end
if _>0 then self.ATV=_-.5 end
end
if not(self.hide and self.hide())then
self.pos=self.pos*.7+self.disp()*.3
@@ -141,36 +206,37 @@ function slider:update()
end
function slider:draw()
local x,y=self.x,self.y
local ATV=self.ATV
--Units
gc.setColor(1,1,1,.5+self.ATV*.06)
gc.setColor(1,1,1,.5+ATV*.06)
gc.setLineWidth(2)
local x1,x2=x,x+self.w
for p=0,self.unit do
local x=x1+(x2-x1)*p/self.unit
gc.line(x,y+7,x,y-7)
end
--Axis
gc.setLineWidth(4)
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
local t=self.text
if t then
gc.setColor(1,1,1)
setFont(self.font)
gc.printf(t,x-312,y-self.font*.7,300,"right")
end
--Block
local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV*.5,y-16-self.ATV,20+self.ATV,32+2*self.ATV
gc.setColor(.8,.8,.8)
gc.rectangle("fill",x,y,w,h)
if self.ATV>0 then
gc.setLineWidth(2)
gc.setColor(1,1,1,self.ATV*.16)
gc.rectangle("line",x+1,y+1,w-2,h-2)
gc.printf(t,x-312-ATV,y-self.font*.7-ATV*.5,300,"right")
end
end
function slider:getInfo()
@@ -178,15 +244,17 @@ function slider:getInfo()
end
local WIDGET={}
WIDGET.active=EMPTY--table, contains all active widgets
WIDGET.sel=nil--selected widget
WIDGET.active={}--Table, contains all active widgets
WIDGET.sel=nil--Selected widget
function WIDGET.set(L)
WIDGET.sel=nil
WIDGET.active=L or EMPTY
WIDGET.active=L or{}
--Reset all widgets
if L then
for _,W in next,L do
W:reset()
end--Reset all widgets
end
end
end
@@ -238,13 +306,36 @@ function WIDGET.newButton(D)
hide= D.hide,
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.newKey(D)
local _={
name= D.name,
x= D.x-D.w*.5,
y= D.y-D.h*.5,
w= D.w,
h= D.h,
resCtr={
D.x,D.y,
D.x-D.w*.35,D.y-D.h*.35,
D.x-D.w*.35,D.y+D.h*.35,
D.x+D.w*.35,D.y-D.h*.35,
D.x+D.w*.35,D.y+D.h*.35,
},
color= color[D.color]or D.color,
font= D.font,
code= D.code,
hide= D.hide,
}for k,v in next,key do _[k]=v end return _
end
function WIDGET.newSwitch(D)
local _={
name= D.name,
x= D.x,
y= D.y,
cx= D.x+25,
cy= D.y,
resCtr={
@@ -301,6 +392,9 @@ function WIDGET.press(x,y)
W:FX()
SFX.play("button")
VOC.play("nya")
elseif W.type=="key"then
W.code()
SFX.play("lock")
elseif W.type=="switch"then
W.code()
SFX.play("move",.6)
@@ -331,7 +425,7 @@ function WIDGET.keyPressed(i)
WIDGET.press()
end
elseif kb.isDown("lshift","lalt","lctrl")then
--when hold [↑], control slider with left/right
--When hold [↑], control slider with left/right
if i=="left"or i=="right"then
local W=WIDGET.sel
if W then
@@ -354,7 +448,7 @@ function WIDGET.keyPressed(i)
if i=="left"or i=="right"then
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 then
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
@@ -372,7 +466,7 @@ function WIDGET.keyPressed(i)
else
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 then
if W~=W1 and W1.resCtr then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
@@ -396,21 +490,25 @@ function WIDGET.keyPressed(i)
end
end
end
local keyMirror={
dpup="up",
dpdown="down",
dpleft="left",
dpright="right",
start="return",
back="escape",
}
function WIDGET.gamepadPressed(i)
if i=="dpup"or i=="dpdown"then
if i=="start"then
if WIDGET.sel then
WIDGET.sel=i=="dpup"and WIDGET.sel.prev or WIDGET.sel.next or WIDGET.sel
else
WIDGET.sel=select(2,next(WIDGET.active))
WIDGET.press()
end
elseif i=="start"then
if WIDGET.sel then
WIDGET.press(WIDGET.sel)
end
elseif i=="dpleft"or i=="dpright"then
if WIDGET.sel then
local W=WIDGET.sel
if W.type=="slider"then
elseif i=="a"or i=="b"then
local W=WIDGET.sel
if W then
if W.type=="button"or W.type=="key"then
WIDGET.press()
elseif W.type=="slider"then
local p=W.disp()
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
@@ -418,6 +516,8 @@ function WIDGET.gamepadPressed(i)
if W.change then W.change()end
end
end
elseif i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
WIDGET.keyPressed(keyMirror[i])
end
end

View File

@@ -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 setLang(n) return function()LANG.set(n)setting.lang=n end end
--newXXX
--NewXXX
newText=WIDGET.newText
newImage=WIDGET.newImage
newButton=WIDGET.newButton
newKey=WIDGET.newKey
newSwitch=WIDGET.newSwitch
newSlider=WIDGET.newSlider
@@ -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="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.goto("help")end}),
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.goto("stat")end}),
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay)end}),
newButton({name="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="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
},
mode={
newButton({name="setting",x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
newButton({name="setting", x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
SCN.goto("custom")
end,
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}),
},
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="play", x=1100, y=340, w=120,h=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
newButton({name="down", x=1100, y=480, w=120,h=120, color="white", font=55,code=pressKey("down")}),
newButton({name="back", x=640, y=630, w=230,h=90, color="white", font=40,code=BACK}),
},
custom={
newButton({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
newButton({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
newButton({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
newButton({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
newKey({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
newKey({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
newKey({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
newKey({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
newButton({name="set1", x=940, y=320, w=260,h=70, color="lYellow",font=32,code=pressKey("1")}),
newButton({name="set2", x=940, y=400, w=260,h=70, color="lYellow",font=32,code=pressKey("2")}),
@@ -141,87 +142,83 @@ local Widgets={
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
},
sequence={
newButton({name="Z", x=150, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
newButton({name="S", x=250, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
newButton({name="J", x=350, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
newButton({name="L", x=450, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
newButton({name="T", x=550, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
newButton({name="O", x=650, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
newButton({name="I", x=750, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
newKey({name="Z", x=100, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
newKey({name="S", x=200, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
newKey({name="J", x=300, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
newKey({name="L", x=400, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
newKey({name="T", x=500, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
newKey({name="O", x=600, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
newKey({name="I", x=700, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
newButton({name="Z5", x=150, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(8)}),
newButton({name="S5", x=250, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(9)}),
newButton({name="P", x=350, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(10)}),
newButton({name="Q", x=450, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(11)}),
newButton({name="F", x=550, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(12)}),
newButton({name="E", x=650, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(13)}),
newButton({name="T5", x=750, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(14)}),
newButton({name="U", x=850, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(15)}),
newButton({name="V", x=950, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(16)}),
newButton({name="W", x=150, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(17)}),
newButton({name="X", x=250, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(18)}),
newButton({name="J5", x=350, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(19)}),
newButton({name="L5", x=450, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(20)}),
newButton({name="R", x=550, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(21)}),
newButton({name="Y", x=650, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(22)}),
newButton({name="N", x=750, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(23)}),
newButton({name="H", x=850, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(24)}),
newButton({name="I5", x=950, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(25)}),
newKey({name="Z5", x=100, y=540, w=90,h=90, color="grey", font=50,code=pressKey(8)}),
newKey({name="S5", x=200, y=540, w=90,h=90, color="grey", font=50,code=pressKey(9)}),
newKey({name="P", x=300, y=540, w=90,h=90, color="grey", font=50,code=pressKey(10)}),
newKey({name="Q", x=400, y=540, w=90,h=90, color="grey", font=50,code=pressKey(11)}),
newKey({name="F", x=500, y=540, w=90,h=90, color="grey", font=50,code=pressKey(12)}),
newKey({name="E", x=600, y=540, w=90,h=90, color="grey", font=50,code=pressKey(13)}),
newKey({name="T5", x=700, y=540, w=90,h=90, color="grey", font=50,code=pressKey(14)}),
newKey({name="U", x=800, y=540, w=90,h=90, color="grey", font=50,code=pressKey(15)}),
newKey({name="V", x=900, y=540, w=90,h=90, color="grey", font=50,code=pressKey(16)}),
newKey({name="W", x=100, y=640, w=90,h=90, color="grey", font=50,code=pressKey(17)}),
newKey({name="X", x=200, y=640, w=90,h=90, color="grey", font=50,code=pressKey(18)}),
newKey({name="J5", x=300, y=640, w=90,h=90, color="grey", font=50,code=pressKey(19)}),
newKey({name="L5", x=400, y=640, w=90,h=90, color="grey", font=50,code=pressKey(20)}),
newKey({name="R", x=500, y=640, w=90,h=90, color="grey", font=50,code=pressKey(21)}),
newKey({name="Y", x=600, y=640, w=90,h=90, color="grey", font=50,code=pressKey(22)}),
newKey({name="N", x=700, y=640, w=90,h=90, color="grey", font=50,code=pressKey(23)}),
newKey({name="H", x=800, y=640, w=90,h=90, color="grey", font=50,code=pressKey(24)}),
newKey({name="I5", x=900, y=640, w=90,h=90, color="grey", font=50,code=pressKey(25)}),
newButton({name="left", x=850, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
newButton({name="right", x=950, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
newButton({name="backsp", x=1050, y=440, w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
newButton({name="reset", x=1050, y=540, w=90,h=90, color="lRed", font=50,code=pressKey("delete")}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
newKey({name="left", x=800, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
newKey({name="right", x=900, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
newKey({name="backsp", x=1000, y=440, w=90,h=90, color="lYellow",font=50,code=pressKey("backspace")}),
newKey({name="reset", x=1000, y=540, w=90,h=90, color="lYellow",font=50,code=pressKey("delete")}),
newButton({name="copy", x=1140, y=440, w=170,h=90, color="lRed", font=40,code=pressKey("cC"),hide=function()return #preBag==0 end}),
newButton({name="paste", x=1140, y=540, w=170,h=90, color="lBlue", font=40,code=pressKey("cV")}),
newButton({name="back", x=1090, y=640, w=270,h=90, color="white", font=50,code=BACK}),
},
draw={
newButton({name="b1", x=500+65*1, y=150,w=58,h=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=150,w=58,h=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=150,w=58,h=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=150,w=58,h=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=150,w=58,h=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=150,w=58,h=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=150,w=58,h=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=150,w=58,h=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=150,w=58,h=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=150,w=58,h=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=150,w=58,h=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b1", x=500+65*1, y=150, w=58, h=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=150, w=58, h=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=150, w=58, h=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=150, w=58, h=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=150, w=58, h=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=150, w=58, h=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=150, w=58, h=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=150, w=58, h=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=150, w=58, h=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=150, w=58, h=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=150, w=58, h=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b12", x=500+65*1, y=230,w=58,h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=230,w=58,h=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=230,w=58,h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=230,w=58,h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=230,w=58,h=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=230,w=58,h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="b12", x=500+65*1, y=230, w=58, h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=230, w=58, h=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=230, w=58, h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=230, w=58, h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=230, w=58, h=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=230, w=58, h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="any", x=600, y=360, w=120,h=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=360, w=120,h=120, color="grey", font=65,code=setPen(-1)}),
newButton({name="clear", x=1200, y=500, w=120,h=120, color="white", font=40,code=pressKey("delete")}),
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
newButton({name="copy", x=920, y=640, w=120,h=120, color="lRed", font=35,code=function()copyBoard()end}),
newButton({name="paste", x=1060, y=640, w=120,h=120, color="lBlue", font=35,code=function()pasteBoard()end}),
newButton({name="custom", x=110, y=80, w=140,h=80, color="white", font=35,code=function()SCN.goto("custom")end}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
newButton({name="any", x=600, y=360, w=120, h=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=360, w=120, h=120, color="grey", font=65,code=setPen(-1)}),
newButton({name="clear", x=1200, y=500, w=120, h=120, color="white", font=40,code=pressKey("delete")}),
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
newButton({name="copy", x=920, y=640, w=120, h=120, color="lRed", font=35,code=pressKey("cC")}),
newButton({name="paste", x=1060, y=640, w=120, h=120, color="lBlue", font=35,code=pressKey("cV")}),
newButton({name="custom", x=110, y=80, w=140, h=80, color="white", font=35,code=function()SCN.goto("custom")end}),
newButton({name="back", x=1200, y=640, w=120, h=120, color="white", font=35,code=BACK}),
},
play={
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
},
pause={
newButton({name="resume", x=640,y=290,w=240,h=100,color="white",font=30,code=function()resumeGame()end}),
newButton({name="restart", x=640,y=445,w=240,h=100,color="white",font=33,code=function()
TASK.removeTask_code(TICK.autoPause)
mergeStat(stat,players[1].stat)
resetGameData()
SCN.swapTo("play","none")
end}),
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue",font=35,code=function()
SCN.goto("setting_sound")
end}),
newButton({name="quit", x=640, y=600, w=240,h=100,color="white",font=35,code=BACK}),
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}),
newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not game.result end}),
newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}),
newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=33,code=pressKey("r")}),
newButton({name="quit", x=640, y=600, w=240,h=100,color="lGrey", font=35,code=BACK}),
},
setting_game={
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video")end}),
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound")end}),
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.goto("setting_control")end}),
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.goto("setting_key")end}),
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.goto("setting_touch")end}),
@@ -231,14 +228,14 @@ local Widgets={
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function()
SCN.goto("setting_skin")
end}),
newSwitch({name="quickR", x=1050,y=320,font=35, disp=SETval("quickR"), code=SETrev("quickR")}),
newSwitch({name="swap", x=1050,y=400,font=20, disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1050,y=480,font=20, disp=SETval("fine"), code=SETrev("fine")}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
newSwitch({name="quickR", x=1050, y=320, font=35,disp=SETval("quickR"), code=SETrev("quickR")}),
newSwitch({name="swap", x=1050, y=400, font=20,disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1050, y=480, font=20,disp=SETval("fine"), code=SETrev("fine")}),
newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}),
},
setting_video={
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound")end}),
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
newSwitch({name="ghost", x=250, y=180,font=35, disp=SETval("ghost"), code=SETrev("ghost")}),
newSwitch({name="smooth", x=250, y=260,font=25, disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}),
@@ -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="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="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
end,
code=function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end}),
newSwitch({name="text", x=1050, y=180, font=35,disp=SETval("text"),code=SETrev("text")}),
newSwitch({name="warn", x=1050, y=260, font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="fullscreen",x=1050,y=340, font=35,disp=SETval("fullscreen"),code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
code=function(i)
setting.frameMul=i<5 and 5*i+20 or 10*i
end}),
newSwitch({name="text", x=1050, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
newSwitch({name="warn", x=1050, y=260,font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="fullscreen",x=1050,y=340,font=35,disp=SETval("fullscreen"),
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}),
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}),
},
setting_sound={
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video")end}),
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newSlider({name="sfx", x=180, y=200,w=400,unit=10,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400,unit=10,font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400,unit=10,font=30,change=function()SFX.play("spawn_1",setting.spawn,nil,true)end, disp=SETval("spawn"), code=SETsto("spawn")}),
@@ -289,11 +292,12 @@ local Widgets={
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="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()
local _=setting
_.das,_.arr=10,2
_.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
code=function()
local _=setting
_.das,_.arr=10,2
_.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false
end}),
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="spin4", x=550,y=540,w=90,h=65,color="white",font=30,code=nextDir(4)}),
newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",font=30,code=nextDir(5)}),
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--cannot rotate O
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--Cannot rotate O
newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",font=30,code=nextDir(7)}),
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,code=function()
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")
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
code=function()
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}),
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,code=function()
for i=1,25 do
setting.face[i]=0
end
SFX.play("hold")
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,
code=function()
for i=1,25 do
setting.face[i]=0
end
SFX.play("hold")
end}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_touch={
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,code=function()
local D=virtualkeySet[sceneTemp.default]
for i=1,#VK_org do
VK_org[i].ava=false
end
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]
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,
code=function()
local D=virtualkeySet[sceneTemp.default]
for i=1,#VK_org do
VK_org[i].ava=false
end
end--Replace keys
sceneTemp.default=sceneTemp.default%5+1
sceneTemp.sel=nil
--Replace keys
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}),
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,code=function()
sceneTemp.snap=sceneTemp.snap%6+1
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,
code=function()
sceneTemp.snap=sceneTemp.snap%6+1
end}),
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,code=function()
SCN.goto("setting_touchSwitch")
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
code=function()
SCN.goto("setting_touchSwitch")
end}),
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,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
end,
code=function(v)
@@ -373,7 +385,7 @@ local Widgets={
end,
hide=function()
return not sceneTemp.sel
end}),
end}),
},
setting_touchSwitch={
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="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")}),
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,code=function()
SCN.goto("setting_trackSetting")
end,hide=function()return not setting.VKTrack end}),
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
code=function()
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")}),
newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}),
},
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="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}),
@@ -432,8 +448,8 @@ local Widgets={
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
},
history={
newButton({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp[2]==1 end}),
newButton({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp[2]==#sceneTemp[1]end}),
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.pos==#sceneTemp.text end}),
newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}),
},
stat={
@@ -441,28 +457,57 @@ local Widgets={
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
},
debug={
newButton({name="killWTM", x=340, y=200,w=260,h=100,color="white",font=35,code=function()
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
SFX.play("clear")
newButton({name="killWTM", x=340,y=200,w=260,h=100,color="white",font=35,
code=function()
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
SFX.play("clear")
end,
hide=function()
return not marking
end}),
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,code=function()
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,
code=function()
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
end
end
end
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
end}),
newButton({name="reset", x=940,y=200,w=260,h=100,color="white",font=40,code=function()
sceneTemp.ct=sceneTemp.ct+1
if sceneTemp.ct==1 then
TEXT.show("RESET ALL DATA?",640,360,50,"appear",.5)
elseif sceneTemp.ct==5 then
TEXT.show("SURE?????",640,360,80,"beat",.5)
elseif sceneTemp.ct==10 then
newButton({name="reset", x=940,y=200,w=260,h=100,color="yellow",font=40,
code=function()
sceneTemp.reset=true
end,
hide=function()
return sceneTemp.reset
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("")
for i=1,#L do
local s=L[i]
@@ -471,10 +516,12 @@ local Widgets={
end
end
SFX.play("clear_4")SFX.play("finesseError_long")
TEXT.clear()
TEXT.show("ALL SAVING FILE DELETED",640,360,60,"stretch",.4)
TEXT.show("all file deleted",640,330,60,"stretch",.4)
TEXT.show("effected after restart game",640,390,60,"stretch",.4)
SCN.back()
end
end,
hide=function()
return not sceneTemp.reset
end}),
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
},

View File

@@ -1,11 +1,10 @@
gameVersion="Alpha V0.9.2"
gameVersion="Alpha V0.10.0"
function love.conf(t)
t.identity="Techmino"--saving folder
t.identity="Techmino"--Saving folder
t.version="11.1"
t.console=false
t.gammacorrect=false
t.appendidentity=true--search files in source then in save directory
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
t.appendidentity=true--Search files in source then in save directory
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
if t.audio then t.audio.mixwithsystem=true end
local W=t.window
@@ -17,12 +16,12 @@ function love.conf(t)
W.resizable=true
W.fullscreentype="desktop"--"exclusive"
W.fullscreen=false
W.vsync=0--unlimit
W.msaa=false--num of samples to use with multi-sampled antialiasing
W.depth=0--bits/samp of depth buffer
W.stencil=1--bits/samp of stencil buffer
W.display=1--monitor ID
W.highdpi=false--high-dpi mode for the window on a Retina display
W.vsync=0--Do not limit FPS
W.msaa=false--Num of samples to use with multi-sampled antialiasing
W.depth=0--Bits/samp of depth buffer
W.stencil=1--Bits/samp of stencil buffer
W.display=1--Monitor ID
W.highdpi=true--High-dpi mode for the window on a Retina display
W.x,W.y=nil
local M=t.modules

View File

@@ -11,16 +11,15 @@ spin判定:
攻击系统:
普通消除:
消1/2/3/4攻击0.25/1.25/2.25/4
消1/2/3/4攻击0.5/1.5/2.5/4
特殊消除:
spin1/2/3攻击2/4/6,若mini则减半
spin1/2/3攻击2/4/6,若mini则减至一
B2B:加1(techrash/spin1/spin2)或2(spin3)攻击
B3B:在B2B效果之上消四再加1,spin再加0.5*消行数攻击,二者都+1额外抵挡
堆楼连击:0,0,1,1,2,2,2,3,3,3,4,4,3, 之后都是2
挖掘连击:0,0,1,1,2,2,3,3,4,4,4, 之后都是5
连击:给予上述攻击[连击数*20%]的加成,上限200%,连消3次之后额外加1攻击
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
全消:将上述伤害之和开根号,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
全消:将上述伤害之和减半,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
根据上述规则计算后,向下取整,攻击打出
分数系统:
@@ -37,7 +36,7 @@ spin判定:
back to back(B2B)点数说明:
B2B点数的范围在0~1200,在点数>=40时进行特殊消除为B2B,>1000时特殊消除为B3B
普通消除-250
spin1/2/3:+50/100/180(mini变为原来40%)
spin1/2/3:+50/100/180(mini变为原来25%)
消四:+100
空spin:+20,此法得到的点数不能超过1000
当点数在1000以上时空放一块-40(不减到低于1000)
@@ -67,16 +66,15 @@ Spin detection:
Attack system:
Regular line clears:
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
Single/Double/Triple/Techrash sends 0.5/1.5/2.5/4
Special line clears:
Spin Single/Double/Triple sends 2/4/6, half if Mini
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
Combo: each combo gives 20% more attack (capped at 200%), extra 1 attack after 3 combo
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
Perfect Clear: half all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
After calculating all above, the damage value will be rounded down then sent
Score system:
@@ -93,7 +91,7 @@ Countering:
Back to Back (B2B) gauge:
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
A regular line clear -250
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
Spin Single/Double/Triple +50/100/180 (x25% if Mini)
Techrash +100
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)

BIN
image/mess/hbm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -6,7 +6,7 @@
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game
]]
]]--
--Global Setting & Vars
math.randomseed(os.time()*626)
@@ -18,17 +18,18 @@ function NULL()end
system=love.system.getOS()
game={}
mapCam={
sel=nil,--selected mode ID
sel=nil,--Selected mode ID
x=0,y=0,k=1,--camera pos/k
x1=0,y1=0,k1=1,--camera pos/k shown
--basic paras
--Basic paragrams
x=0,y=0,k=1,--Camera pos/k
x1=0,y1=0,k1=1,--Camera pos/k shown
keyCtrl=false,--if controlling with key
--If controlling with key
keyCtrl=false,
--For auto zooming when enter/leave scene
zoomMethod=nil,
zoomK=nil,
--for auto zooming when enter/leave scene
}
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--wid,hei,radius,scale K
@@ -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
preBag={}
players={alive={},human=0}
--blockSkin,blockSkinMini={},{}--redefined in SKIN.change
game={
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
blocks= require("parts/mino")
@@ -58,7 +72,7 @@ Modes= require("parts/modes")
TICK= require("parts/tick")
--load files & settings
--Load files & settings
modeRanks={sprint_10=0}
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
--update data file
S=stat
while #modeRanks>73 do
table.remove(modeRanks)
end
if modeRanks[73]==6 then modeRanks[73]=0 end
if modeRanks[1]then--rename key of modeRanks
local L=modeRanks
--Update modeRanks
R=modeRanks
if R[1]then
local L=R
for i=1,#L do
L[Modes[i].name],L[i]=L[i]
end
elseif R.master_adavnce then
R.master_advance,R.master_adavnce=R.master_adavnce
end
--Update data file
S=stat
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then
setting.spawn=0
end
if S.version~=gameVersion then
S.version=gameVersion
TEXT.show(text.newVersion,640,200,30,"fly",.3)
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
S=nil
R,S=nil

View File

@@ -2,7 +2,8 @@ local int,max,min=math.floor,math.max,math.min
local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
local function score(P)
local F=false
if P.modeData.point<70 then--if Less then MM
--If Less then MM
if P.modeData.point<70 then
local R=#P.clearedRow
if R==0 then return end
if R==4 then R=10 end
@@ -12,7 +13,7 @@ local function score(P)
end
return{
color=color.lightBlue,
color=color.lBlue,
env={
noFly=true,
minarr=1,

View File

@@ -1,6 +1,6 @@
local int,rnd,min=math.floor,math.random,math.min
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=5,lock=60,
fall=8,

View File

@@ -7,7 +7,7 @@ local function newField(P)
end
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=1e99,lock=1e99,
hold=false,

View File

@@ -24,11 +24,12 @@ return{
gc.clear(.26,.26,.26)
end
--MD Figure
--Figures
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.draw(IMG.electric,-162,-8,0,3.2)
gc.setColor(1,1,1,.5+.2*sin(t))
gc.draw(IMG.hbm,-426,-86,0,1.5)
gc.draw(IMG.electric,326,142,0,2.6)
--Texts
gc.setColor(.8,.8,.8)
mText(drawableText.line,-81,300)

View File

@@ -14,7 +14,7 @@ local function check_LVup(P)
end
return{
color=color.lightBlue,
color=color.lBlue,
env={
noFly=true,
das=16,arr=6,sddas=2,sdarr=2,

View File

@@ -1,6 +1,6 @@
local max,rnd=math.max,math.random
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=10,lock=30,
freshLimit=15,

View File

@@ -11,13 +11,14 @@ return{
local height=freeRow.get(0)
local max=#P.field
if max>0 then
--Get heights
for x=1,10 do
local h=max
while P.field[h][x]==0 and h>1 do
h=h-1
end
height[x]=h
end--get heights
end
else
for x=1,10 do
height[x]=0
@@ -42,8 +43,8 @@ return{
goto END
end
--give I when no hole
d=-999--height difference
--Give I when no hole
d=-999--Height difference
--A=hole mark
for x=2,11 do
local _=height[x]-height[x-1]
@@ -59,7 +60,7 @@ return{
res[A+2]=7
end
--give O when no d=0/give T when no d=1
--Give O when no d=0/give T when no d=1
d=0--d=0 count
A=0--d=1 count
for x=2,10 do

View File

@@ -1,6 +1,6 @@
local format=string.format
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=1e99,lock=1e99,
oncehold=false,

View File

@@ -14,7 +14,8 @@ local function score(P)
if P.modeData.point%100==99 then
SFX.play("blip_1")
elseif P.modeData.point>=100*(P.modeData.event+1)then
local s=P.modeData.event+1;P.modeData.event=s--level up!
--Level up!
local s=P.modeData.event+1;P.modeData.event=s
local E=P.gameEnv
BG.set(s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5")
E.lock=death_lock[s]
@@ -55,10 +56,10 @@ return{
mStr((P.modeData.event+1)*100,-81,370)
gc.rectangle("fill",-125,375,90,4)
end,
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
score=function(P)return{P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
comp=function(a,b)
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
end,
getRank=function(P)
local S=P.modeData.point

View File

@@ -13,7 +13,8 @@ local function score(P)
if P.modeData.point%100==99 then
SFX.play("blip_1")
elseif P.modeData.point>=100*(P.modeData.event+1)then
local s=P.modeData.event+1;P.modeData.event=s--level up!
--Level up!
local s=P.modeData.event+1;P.modeData.event=s
local E=P.gameEnv
BG.set(s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4")
E.lock=rush_lock[s]
@@ -59,25 +60,25 @@ return{
mStr((P.modeData.event+1)*100,-81,370)
gc.rectangle("fill",-125,375,90,4)
end,
score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end,
score=function(P)return{P.modeData.point,P.stat.time}end,
scoreDisp=function(D)return D[1].."P "..toTime(D[2])end,
comp=function(a,b)
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
return a[1]>b[1]or(a[1]==b[1]and a[2]<b[2])
end,
getRank=function(P)
local S=P.modeData.point
if S==500 then
local L=P.stat.clears[4]
local T=P.stat.time
return
L>=30 and 5 or
L>=25 and 4 or
T<=170 and 5 or
T<=200 and 4 or
3
else
return
S>=420 and 3 or
S>=250 and 2 or
S>=120 and 1 or
S>=30 and 0
S>=460 and 3 or
S>=350 and 2 or
S>=200 and 1 or
S>=50 and 0
end
end,
}

View File

@@ -11,21 +11,23 @@ local function score(P)
MD.point=MD.point+s
if MD.point%100==99 then SFX.play("blip_1")end
if int(MD.point*.01)>MD.event then
local s=MD.event+1;MD.event=s--level up!
--Level up!
local s=MD.event+1;MD.event=s
local E=P.gameEnv
if s<4 then--first 300
if s<4 then
P:showTextF(text.stage(s),0,-120,80,"fly")
--First 300
if s~=1 then E.lock=E.lock-1 end
if s~=2 then E.wait=E.wait-1 end
if s~=3 then E.fall=E.fall-1 end
P:showTextF(text.stage(s),0,-120,80,"fly")
elseif s<10 then
P:showTextF(text.stage(s),0,-120,60,"fly",1.26)
if s==4 or s==7 then E.das=E.das-1 end
s=s%3
if s==0 then E.lock=E.lock-1
elseif s==1 then E.wait=E.wait-1
elseif s==2 then E.fall=E.fall-1
end
P:showTextF(text.stage(s),0,-120,80,"fly")
else
MD.point,MD.event=1000,9
P:win("finish")
@@ -35,7 +37,7 @@ local function score(P)
end
return{
color=color.lightGrey,
color=color.lGrey,
env={
noFly=true,
das=5,arr=1,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=1e99,lock=1e99,
oncehold=false,

View File

@@ -1,5 +1,5 @@
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=60,lock=60,
freshLimit=15,

View File

@@ -29,9 +29,9 @@ return{
if P.stat.row<100 then return end
local T=P.stat.time
return
T<=62 and 5 or
T<=70 and 5 or
T<=90 and 4 or
T<=130 and 3 or
T<=136 and 3 or
T<=196 and 2 or
T<=260 and 1 or
0

View File

@@ -1,7 +1,7 @@
local gc=love.graphics
local rnd=math.random
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=60,lock=60,
target=1000,dropPiece=PLY.reach_winCheck,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics
local rnd=math.random
return{
color=color.lightBlue,
color=color.lBlue,
env={
drop=60,lock=60,
target=20,dropPiece=PLY.reach_winCheck,

View File

@@ -29,8 +29,8 @@ return{
if P.stat.row<400 then return end
local T=P.stat.time
return
T<=255 and 5 or
T<=326 and 4 or
T<=300 and 5 or
T<=340 and 4 or
T<=462 and 3 or
T<=555 and 2 or
T<=626 and 1 or

View File

@@ -1,6 +1,6 @@
local max,rnd=math.max,math.random
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=5,lock=60,
fall=10,

View File

@@ -1,7 +1,7 @@
local format=string.format
return{
color=color.lightYellow,
color=color.lYellow,
env={
arr=0,
drop=1e99,lock=60,

View File

@@ -9,7 +9,7 @@ local function tech_check_hard(P)
end
return{
color=color.darkMagenta,
color=color.dMagenta,
env={
drop=30,lock=60,
freshLimit=15,

View File

@@ -9,7 +9,7 @@ local function tech_check_hard(P)
end
return{
color=color.darkRed,
color=color.dRed,
env={
_20G=true,lock=60,
freshLimit=15,

View File

@@ -9,7 +9,7 @@ local function tech_check_hard(P)
end
return{
color=color.darkGreen,
color=color.dGreen,
env={
oncehold=false,
drop=1e99,lock=1e99,

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=15,lock=60,
fall=20,

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=15,lock=60,
fall=20,

View File

@@ -9,7 +9,7 @@ local function check_tsd(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=60,lock=60,
freshLimit=15,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics
local warnTime={60,90,105,115,116,117,118,119,120}
return{
color=color.lightGrey,
color=color.lGrey,
env={
noFly=true,
minarr=1,minsdarr=1,
@@ -29,10 +29,10 @@ return{
end,
mesDisp=function(P,dx,dy)
gc.setLineWidth(2)
gc.rectangle("line",-95,112,32,402)
gc.rectangle("line",-95,120,32,402)
local T=P.stat.time/120
gc.setColor(2*T,2-2*T,.2)
gc.rectangle("fill",-94,513,30,(T-1)*400)
gc.rectangle("fill",-94,521,30,(T-1)*400)
end,
score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return tostring(D[1])end,

View File

@@ -1,5 +1,5 @@
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=120,lock=120,
oncehold=false,target=200,

View File

@@ -198,7 +198,8 @@ end
return{
["9S"]={
function(P,ctrl)
local Tfield={}--test field
local Tfield={}--Test field
local best={x=1,dir=0,hold=false,score=-1e99}--Best method
local field_org=P.field
for i=1,#field_org do
Tfield[i]=freeRow.get(0)
@@ -206,7 +207,7 @@ return{
Tfield[i][j]=field_org[i][j]
end
end
local best={x=1,dir=0,hold=false,score=-1e99}
for ifhold=0,P.gameEnv.hold and 1 or 0 do
--Get block id
local bn
@@ -217,13 +218,17 @@ return{
end
if not bn then goto CTN end
for dir=0,dirCount[bn] do--each dir
for dir=0,dirCount[bn] do--Each dir
local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos
for cx=1,11-#cb[1]do--Each pos
local cy=#Tfield+1
--Move to bottom
while not ifoverlapAI(Tfield,cb,cx,cy-1)do
cy=cy-1
end--move to bottom
end
--Simulate lock
for i=1,#cb do
local y=cy+i-1
if not Tfield[y]then Tfield[y]=freeRow.get(0)end
@@ -232,7 +237,7 @@ return{
Tfield[y][cx+j-1]=1
end
end
end--simulate lock
end
local score=getScore(Tfield,cb,cy)
if score>best.score then
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
@@ -243,9 +248,11 @@ return{
::CTN::
end
if not best.bn then return 1 end
--Release cache
while #Tfield>0 do
freeRow.discard(rem(Tfield,1))
end--Release cache
end
local p=#ctrl+1
if best.hold then
ctrl[p]=8
@@ -270,15 +277,11 @@ return{
end,
},
["CC"]={
function(P)
if P.AI_needFresh then
CC_updateField(P)
P.AI_needFresh=false
end
function(P)--Start thinking
BOT.think(P.AI_bot)
return 2
end,--start thinking
function(P,ctrl)
end,
function(P,ctrl)--Poll keys
if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end
local success,hold,move=BOT.getMove(P.AI_bot)
if success then
@@ -294,10 +297,11 @@ return{
ins(ctrl,6)
return 3
else
return 2--stay this stage
--Stay this stage
return 2
end
end,--poll keys
function(P)
end,
function(P)--Check if time to change target
P.AI_delay=P.AI_delay0
if Timer()-P.modeData.point>P.modeData.event then
P.modeData.point=Timer()
@@ -305,6 +309,6 @@ return{
P:changeAtkMode(rnd()<.85 and 1 or #P.atker>3 and 4 or rnd()<.3 and 2 or 3)
end
return 1
end,--check if time to change target
end,
},
}--AI think stage

View File

@@ -1,5 +1,5 @@
setting={
--game
--Game
das=10,arr=2,
sddas=0,sdarr=2,
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},
face={},
--graphic
--Graphic
ghost=true,center=true,
smooth=true,grid=false,
bagLine=false,
@@ -31,7 +31,7 @@ setting={
bg=true,
powerInfo=false,
--sound
--Sound
sfx=10,
spawn=0,
bgm=7,
@@ -39,15 +39,15 @@ setting={
vib=0,
voc=0,
--virtualkey
--Virtualkey
VKSFX=3,--SFX volume
VKVIB=0,--VIB
VKSwitch=false,--if disp
VKTrack=false,--if tracked
VKDodge=false,--if dodge
VKSwitch=false,--If disp
VKTrack=false,--If tracked
VKDodge=false,--If dodge
VKTchW=3,--Touch-Pos Weight
VKCurW=4,--Cur-Pos Weight
VKIcon=true,--if disp icon
VKIcon=true,--If disp icon
VKAlpha=3,
}
for i=1,25 do
@@ -64,7 +64,7 @@ stat={
send=0,recv=0,pend=0,off=0,
clear={},spin={},
pc=0,hpc=0,b2b=0,b3b=0,score=0,
lastPlay="sprint_10",--last played mode ID
lastPlay="sprint_10",--Last played mode ID
}
for i=1,25 do
stat.clear[i]={0,0,0,0,0}
@@ -73,9 +73,9 @@ end
keyMap={
{"left","right","x","z","c","up","down","space","tab","r"},{},
--keyboard
--Keyboard
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder"},{},
--joystick
--Joystick
}
for i=1,#keyMap do for j=1,20 do
if not keyMap[i][j]then keyMap[i][j]=""end

View File

@@ -1,6 +1,6 @@
local freeRow={}
local L={}--storage
local _=0--lenth
local L={}--Storage
local _=0--Lenth
function freeRow.reset(num)
if num<_ then
for i=_,num+1,-1 do

View File

@@ -25,7 +25,6 @@ function destroyPlayers()
for i=#players.alive,1,-1 do
players.alive[i]=nil
end
players.human=0
collectgarbage()
end
@@ -43,18 +42,22 @@ function restoreVirtualKey()
virtualkey[9].ava=false
end
end
function copyBoard()
local str=""
local H=0
for y=20,1,-1 do
for x=1,10 do
if preField[y][x]~=0 then
H=y
goto L
goto topFound
end
end
end
::L::
::topFound::
--Encode field
for y=1,H do
local S=""
local L=preField[y]
@@ -63,38 +66,36 @@ function copyBoard()
end
str=str..S
end
love.system.setClipboardText("Techmino sketchpad:"..data.encode("string","base64",data.compress("string","deflate",str)))
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
return data.encode("string","base64",data.compress("string","deflate",str))
end
function pasteBoard()
function pasteBoard(str)
local _
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
--Read data
local str=love.system.getClipboardText()
local p=find(str,":")--ptr*
if p then str=sub(str,p+1)end
--Decode
_,str=pcall(data.decode,"string","base64",str)
if not _ then goto ERROR end
if not _ then return end
_,str=pcall(data.decompress,"string","deflate",str)
if not _ then goto ERROR end
p=1
if not _ then return end
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
local p=1
while true do
_=byte(str,p)--1byte
--Str end
if not _ then
if fX~=1 then
goto ERROR
return
else
fY=fY+1
break
end
end--str end
end
__=_%32-1--Block id
if __>17 then return end--Illegal blockid
_=int(_/32)--Mode id
__=_%32-1--block id
if __>17 then goto ERROR end--illegal blockid
_=int(_/32)--mode id
preField[fY][fX]=__
if fX<10 then
fX=fX+1
@@ -111,8 +112,40 @@ function pasteBoard()
preField[y][x]=0
end
end
do return end
::ERROR::TEXT.show(text.dataCorrupted,350,360,35,"flicker",.5)
return true
end
function copySequence()
local str=""
for i=1,#preBag do
str=str..char(preBag[i]-1)
end
return data.encode("string","base64",data.compress("string","deflate",str))
end
function pasteSequence(str)
local _
--Decode
_,str=pcall(data.decode,"string","base64",str)
if not _ then return end
_,str=pcall(data.decompress,"string","deflate",str)
if not _ then return end
local bag={}
for i=1,#str do
_=byte(str,i)
if _<25 then
bag[i]=_+1
else
return
end
end
preBag=bag
return true
end
function mergeStat(stat,delta)
@@ -128,7 +161,7 @@ function mergeStat(stat,delta)
end
end
end
function randomTarget(P)
function randomTarget(P)--Return a random opponent for P
if #players.alive>1 then
local R
repeat
@@ -136,7 +169,7 @@ function randomTarget(P)
until R~=P
return R
end
end--return a random opponent for P
end
function freshMostDangerous()
game.mostDangerous,game.secDangerous=nil
local m,m2=0,0
@@ -198,7 +231,7 @@ function royaleLevelup()
if P.gameEnv.drop==0 then
P.curY=P.y_img
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
@@ -223,65 +256,34 @@ end
function resumeGame()
SCN.swapTo("play","none")
end
function loadGame(M)
--rec={}
function loadGame(M,ifQuickPlay)
stat.lastPlay=M
curMode=Modes[M]
local lang=setting.lang
drawableText.modeName:set(text.modes[M][1])
drawableText.levelName:set(text.modes[M][2])
needResetGameData=true
SCN.swapTo("play","fade_togame")
SCN.swapTo("play",ifQuickPlay and"swipe"or"fade_togame")
SFX.play("enter")
end
function resetPartGameData()
game={
frame=150-setting.reTime*15,
result=false,
pauseTime=0,
pauseCount=0,
garbageSpeed=1,
warnLVL0=0,
warnLVL=0,
}
destroyPlayers()
curMode.load()
TEXT.clear()
if modeEnv.task then
for i=1,#players do
players[i]:newTask(modeEnv.task)
end
end
if modeEnv.royaleMode then
for i=1,#players do
players[i]:changeAtk(randomTarget(players[i]))
end
end
BG.set(modeEnv.bg)
BGM.play(modeEnv.bgm)
if modeEnv.royaleMode then
for i=1,#players do
players[i]:changeAtk(randomTarget(players[i]))
end
game.stage=1
game.garbageSpeed=.3
end
restoreVirtualKey()
collectgarbage()
end
function resetGameData()
game={
frame=150-setting.reTime*15,
result=false,
pauseTime=0,--Time paused
pauseCount=0,--Pausing count
garbageSpeed=1,--garbage timing speed
warnLVL0=0,
warnLVL=0,
}
game.frame=150-setting.reTime*15
game.result=false
game.pauseTime=0
game.pauseCount=0
game.garbageSpeed=1
game.warnLVL0=0
game.warnLVL=0
game.recording=true
game.replaying=false
game.rec={}
math.randomseed(tm.getTime())
game.seed=rnd(261046101471026)
destroyPlayers()
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
for i=1,#players do
players[i]:newTask(modeEnv.task)
@@ -306,6 +308,47 @@ function resetGameData()
SFX.play("ready")
collectgarbage()
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()
SFX.play("start")
for P=1,#players do

View File

@@ -2,6 +2,7 @@ local L
if setting.lang==1 or setting.lang==2 then
L={
"ZS JL T O I",
"VVVVVV好玩!",
"uid:225238922",
"tetr.js也很好玩!",
"tetr.io也很好玩!",
@@ -20,7 +21,11 @@ if setting.lang==1 or setting.lang==2 then
"l-=-1",
"jstris也很好玩!",
"iced,永远的神",
"fin neo iso 是满足tspin条件的特殊t2的名字",
"e^(pi*i/2)=i",
"e^(pi*i)=-1",
"DT炮=TSD+TST炮",
"Cultris II也很好玩!",
"COOL!!",
"CLASSIC SEXY RUSSIAN BLOCKS",
"BT炮=beta炮",
@@ -70,7 +75,6 @@ if setting.lang==1 or setting.lang==2 then
"别问游戏名怎么取的,问就是随便想的",
"本游戏难度上限很高, 做好心理准备",
"本游戏可不是休闲游戏",
"啊这,不会吧不会吧",
"626r/s",
"40行世界纪录:15.654s",
"4+4+4+4+2+2+1=17",
@@ -82,6 +86,7 @@ if setting.lang==1 or setting.lang==2 then
"2.7182818284590452353",
"15puzzle好玩!",
"11renPC!",
"1, 2, 9!!!!!",
"<方块研究所>有一个Nspire-CX版本!",
"↑↑↓↓←→←→BABA",
"(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?",
"Find out what's in the setting!",
"Enjoy Tech. Rotation System!",
"e^(pi*i/2)=i",
"e^(pi*i)=-1",
"DT cannon=TSD+TST",
"Don't look directly at the bugs!",
"DO NOT PRESS F10",
@@ -147,10 +154,12 @@ elseif setting.lang==3 then
"B2B2B???",
"Any suggestions to author!",
"Am G F G",
"Also try tetr.js!",
"Also try tetr.io!",
"Also try nullpomino!",
"Also try jstris!",
"Also try VVVVVV!",
"Also try Tetr.js!",
"Also try Tetr.io!",
"Also try Jstris!",
"Also try Cultris II!",
"Also try Bullpomino!",
"ALLSPIN!",
"少女祈禱中",
"40L WR: 15.654s",
@@ -162,6 +171,7 @@ elseif setting.lang==3 then
"2.7182818284590452353",
"15puzzle is fun!",
"11renPC!",
"1, 2, 9!!!!!",
"↑↑↓↓←→←→BABA",
"\"Free block game with royale mode\"",
"/osk/",

View File

@@ -4,7 +4,7 @@ local ZERO={[01]=Zero,[10]=Zero,[03]=Zero,[30]=Zero,[12]=Zero,[21]=Zero,[32]=Zer
local map={}
for x=-3,3 do map[x]={}for y=-3,3 do map[x][y]={x,y}end end
local function collect(T)--make all vec point to the same vec
local function collect(T)--Make all vec point to the same vec
if type(T)=="table"then
for _,T in next,T do
for k,vec in next,T do
@@ -14,11 +14,11 @@ local function collect(T)--make all vec point to the same vec
end
end
local function C_sym(L)--use this if the block is centrosymmetry, *PTR!!!
local function C_sym(L)--Use this if the block is centrosymmetry, *PTR!!!
L[23]=L[01]L[32]=L[10]
L[21]=L[03]L[12]=L[30]
end
local function flipList(O)--use this to copy a symmetry list
local function flipList(O)--Use this to copy a symmetry list
if not O then return end
local L={}
for i=1,#O do

View File

@@ -189,17 +189,14 @@ drawableText={
mxcmb=T(20,"Max Combo"),
pc=T(20,"Perfect Clear"),
ko=T(25,"KO"),
D=T(100,"D"),
C=T(100,"C"),
B=T(100,"B"),
A=T(100,"A"),
S=T(100,"S"),
D=T(100,"D"),C=T(100,"C"),B=T(100,"B"),A=T(100,"A"),S=T(100,"S"),
modeName=T(30),levelName=T(30),
anykey=T(40),
replaying=T(20),
next=T(40),hold=T(40),
win=T(120),finish=T(120),
lose=T(120),pause=T(120),
@@ -210,9 +207,7 @@ drawableText={
preview=T(40),
keyboard=T(25),joystick=T(25),
ctrlSetHelp=T(30),
musicRoom=T(80),
nowPlaying=T(50),
musicRoom=T(80),nowPlaying=T(50),
VKTchW=T(30),VKOrgW=T(30),VKCurW=T(30),
noScore=T(45),
highScore=T(30),
noScore=T(45),highScore=T(30),
}

View File

@@ -27,8 +27,8 @@ return{
{name="round_4", x=-900, y=-800, size=35,shape=1,icon="round", unlock={"round_5"}},
{name="round_5", x=-1100, y=-800, size=35,shape=1,icon="round", unlock={}},
{name="master_beginner", x=0, y=-1000, size=35,shape=1,icon="master", unlock={"master_adavnce"}},
{name="master_adavnce", x=0, y=-1200, size=35,shape=1,icon="master", unlock={"master_final","GM"}},
{name="master_beginner", x=0, y=-1000, size=35,shape=1,icon="master", unlock={"master_advance"}},
{name="master_advance", x=0, y=-1200, size=35,shape=1,icon="master", unlock={"master_final","GM"}},
{name="master_final", x=0, y=-1400, size=40,shape=2,icon="master", unlock={}},
{name="GM", x=150, y=-1500, size=35,shape=1,icon="master", unlock={}},
@@ -82,5 +82,5 @@ return{
{name="infinite_dig", x=-1000, y=-600, size=35,shape=1,icon="infinite_dig",unlock={}},
{name="custom_clear", x=200, y=-350, size=45,shape=3,icon="custom", unlock={}},
{name="custom_puzzle", x=200, y=-200, size=45,shape=3,icon="puzzle", unlock={}},
{name="sprintPenta", x=-200, y=-200, size=45,shape=3,icon="sprint", unlock={}},
{name="sprintPenta", x=-200, y=-200, size=50,shape=2,icon="sprint", unlock={}},
}

File diff suppressed because it is too large Load Diff

View File

@@ -38,12 +38,12 @@ SKIN.libColor={
color.purple,
color.magenta,
color.pink,
color.darkGrey,
color.dGrey,
color.grey,
color.lightGrey,
color.darkPurple,
color.darkRed,
color.darkGreen,
color.lGrey,
color.dPurple,
color.dRed,
color.dGreen,
}
function SKIN.load()
local _
@@ -97,33 +97,33 @@ function SKIN.load()
gc.pop()
end
local L=#list
function SKIN.prevSet()--prev skin_set
function SKIN.prevSet()--Prev skin_set
local _=(setting.skinSet-2)%L+1
setting.skinSet=_
SKIN.change(_)
_=list[_]
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end
function SKIN.nextSet()--next skin_set
function SKIN.nextSet()--Next skin_set
local _=setting.skinSet%L+1
setting.skinSet=_
SKIN.change(_)
_=list[_]
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end
function SKIN.prev(i)--prev skin for [i]
function SKIN.prev(i)--Prev skin for [i]
local _=setting.skin
_[i]=(_[i]-2)%11+1
end
function SKIN.next(i)--next skin for [i]
function SKIN.next(i)--Next skin for [i]
local _=setting.skin
_[i]=_[i]%11+1
end
function SKIN.rotate(i)--change direction of [i]
function SKIN.rotate(i)--Change direction of [i]
setting.face[i]=(setting.face[i]+1)%4
SFX.play("rotate")
end
function SKIN.change(i)--change to skin_set[i]
function SKIN.change(i)--Change to skin_set[i]
blockSkin=SKIN.lib[i]
blockSkinMini=SKIN.libMini[i]
end

View File

@@ -3,9 +3,10 @@ local Tick={}
function Tick.finish(P)
P.endCounter=P.endCounter+1
if P.endCounter<40 then
--Make field visible
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
end end--Make field visible
end end
elseif P.endCounter==60 then
return true
end
@@ -13,9 +14,10 @@ end
function Tick.lose(P)
P.endCounter=P.endCounter+1
if P.endCounter<40 then
--Make field visible
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
end end--Make field visible
end end
elseif P.endCounter>80 then
for i=1,#P.field do
for j=1,10 do
@@ -35,6 +37,7 @@ function Tick.lose(P)
end
if not modeEnv.royaleMode and #players>1 then
P.y=P.y+P.endCounter*.26
P.absFieldY=P.absFieldY+P.endCounter*.26
end
end
function Tick.throwBadge(data)--{ifAI,Sender,timer}
@@ -52,8 +55,9 @@ function Tick.throwBadge(data)--{ifAI,Sender,timer}
else
x2,y2=R.x+66*R.size,R.y+344*R.size
end
--Generate badge object
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
--generate badge object
if not data[1]and data[3]%8==0 then
SFX.play("collect")

File diff suppressed because it is too large Load Diff