0.8.16Fantastic Global Update

This commit is contained in:
MrZ_26
2020-04-19 11:50:17 +08:00
parent e88553bc00
commit 7d63386410
103 changed files with 2237 additions and 1702 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.8.15"
gameVersion="Alpha V0.8.16"
function love.conf(t)
t.identity="Techmino"--SaveDir name
t.version="11.1"

View File

@@ -1,6 +1,7 @@
setting={
das=10,arr=2,
sddas=0,sdarr=2,
ihs=true,irs=true,ims=true,
reTime=10,
maxNext=6,
quickR=true,
@@ -25,7 +26,6 @@ setting={
text=true,
fullscreen=false,
bg=true,
bgspace=true,
--graphic
sfx=10,bgm=7,
@@ -43,13 +43,17 @@ setting={
--control
}
stat={
version=gameVersion,
run=0,game=0,time=0,
key=0,rotate=0,hold=0,
extraPiece=0,extraRate=0,
key=0,rotate=0,hold=0,piece=0,row=0,
atk=0,send=0,recv=0,pend=0,
clear_1=0,clear_2=0,clear_3=0,clear_4=0,
spin_0=0,spin_1=0,spin_2=0,spin_3=0,
pc=0,c=0,b2b=0,b3b=0,score=0,
piece=0,row=0,dig=0,
atk=0,digatk=0,send=0,recv=0,pend=0,
clear_S={0,0,0,0},clear_B={0,0,0,0,0,0,0},
spin_S={0,0,0,0},spin_B={0,0,0,0,0,0,0},
clear={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}},
spin={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}},
pc=0,hpc=0,b2b=0,b3b=0,score=0,
lastPlay=1,--last played mode ID
}
keyMap={
@@ -63,8 +67,8 @@ keyMap={
for i=1,#keyMap do for j=1,20 do
if not keyMap[i][j]then keyMap[i][j]=""end
end end
--Things related to virtualkey
VK_org={--Original set,for restore VK' position
VK_org={--Original virtualkey set,for restore VKs' position before each game
{ava=true, x=80, y=720-200, r=80},--moveLeft
{ava=true, x=320, y=720-200, r=80},--moveRight
{ava=true, x=1280-80, y=720-200, r=80},--rotRight

View File

@@ -17,9 +17,9 @@ spin判定:
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,4,3,2…(后面都是2)
连击:0,0,1,1,2,2,3,3,4,4,3,2,3,2,3,2,3…(后面都是2)
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
半全消("下方有剩余方块"的全消):伤害+2,额外抵挡+2
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
全消:将上述伤害之和开根号,再+6~10(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
根据上述规则计算后,向下取整,攻击打出
@@ -54,3 +54,5 @@ back to back(B2B)点数说明:
自定义模式说明:
玩家可以自由调整大多数参数(不包括上述各种游戏模式的特殊效果),也可以画一个场地去消除或者是作为提示模板来进行拼图模式.
在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利.
附录:
ZXC的Ospin地图:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB

151
file.lua
View File

@@ -3,13 +3,7 @@ local int,max,min=math.floor,math.max,math.min
local sub,find=string.sub,string.find
local toN,toS=tonumber,tostring
local concat=table.concat
local FILE={
data= fs.newFile("data.dat"),
setting=fs.newFile("setting.dat"),
VK= fs.newFile("virtualkey.dat"),
keyMap= fs.newFile("key.dat"),
unlock= fs.newFile("unlock.dat"),
}
local function splitS(s,sep)
local t,n={},1
repeat
@@ -20,7 +14,6 @@ local function splitS(s,sep)
until #s==0
return t
end
local tabs={
[0]="",
"\t",
@@ -61,16 +54,28 @@ local function dumpTable(L,t)
end
return s..tabs[t-1].."}"
end
local function addToTable(G,base)--push all values to base
local function addToTable(G,base)--refresh default base with G-values
for k,v in next,G do
if type(v)=="table"and type(base[k])=="table"then
addToTable(v,base[k])
else
base[k]=v
if type(v)==type(base[k])then
if type(v)=="table"then
addToTable(v,base[k])
else
base[k]=v
end
end
end
end
function loadRecord(N)
local files={
data= fs.newFile("data.dat"),
setting=fs.newFile("setting.dat"),
VK= fs.newFile("virtualkey.dat"),
keyMap= fs.newFile("key.dat"),
unlock= fs.newFile("unlock.dat"),
}
local File={}
function File.loadRecord(N)
local F=fs.newFile(N..".dat")
if F:open("r")then
local s=loadstring(F:read())
@@ -83,21 +88,21 @@ function loadRecord(N)
end
end
end
function saveRecord(N,L)
function File.saveRecord(N,L)
local F=fs.newFile(N..".dat")
F:open("w")
local _,mes=F:write(dumpTable(L))
F:flush()F:close()
if not _ then
TEXT(text.recSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
TEXT.show(text.recSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
function delRecord(N)
function File.delRecord(N)
fs.remove(N..".dat")
end
function loadUnlock()
local F=FILE.unlock
function File.loadUnlock()
local F=files.unlock
if F:open("r")then
local s=F:read()
if s:sub(1,6)~="return"then s="return{"..s.."}"end
@@ -109,18 +114,18 @@ function loadUnlock()
end
end
end
function saveUnlock()
local F=FILE.unlock
function File.saveUnlock()
local F=files.unlock
F:open("w")
local _,mes=F:write(dumpTable(modeRanks))
F:flush()F:close()
if not _ then
TEXT(text.unlockSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
TEXT.show(text.unlockSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
function loadData()
local F=FILE.data
function File.loadData()
local F=files.data
if F:open("r")then
local s=F:read()
if s:sub(1,6)~="return"then
@@ -130,22 +135,64 @@ function loadData()
F:close()
if s then
setfenv(s,{})
addToTable(s(),stat)
local S=s()
if S.version~=gameVersion then
S.version=gameVersion
S.clear_S={S.clear_1,S.clear_2,S.clear_3,S.clear_4}
S.clear={{},{},{},{},{},{},{}}
local A,B,C,D=int(S.clear_1/7),int(S.clear_2/7),int(S.clear_3/7),int(S.clear_4/7)
for i=1,7 do
S.clear[i][1]=A
S.clear[i][2]=B
S.clear[i][3]=C
S.clear[i][4]=D
end
for i=1,S.clear_1%7 do S.clear[i][1]=S.clear[i][1]+1 end
for i=1,S.clear_2%7 do S.clear[i][2]=S.clear[i][2]+1 end
for i=1,S.clear_3%7 do S.clear[i][3]=S.clear[i][3]+1 end
for i=1,S.clear_4%7 do S.clear[i][4]=S.clear[i][4]+1 end
S.clear_B={}
for i=1,7 do
S.clear_B[i]=S.clear[i][1]+S.clear[i][2]+S.clear[i][3]+S.clear[i][4]
end
S.spin_S={S.spin_0,S.spin_1,S.spin_2,S.spin_3}
S.spin={{},{},{},{},{},{},{}}
A,B,C,D=int(S.spin_0/7),int(S.spin_1/7),int(S.spin_2/7),int(S.spin_3/7)
for i=1,7 do
S.spin[i][1]=A
S.spin[i][2]=B
S.spin[i][3]=C
S.spin[i][4]=D
end
for i=1,S.spin_0%7 do S.spin[i][1]=S.spin[i][1]+1 end
for i=1,S.spin_1%7 do S.spin[i][2]=S.spin[i][2]+1 end
for i=1,S.spin_2%7 do S.spin[i][3]=S.spin[i][3]+1 end
for i=1,S.spin_3%7 do S.spin[i][4]=S.spin[i][4]+1 end
S.spin_B={}
for i=1,7 do
S.spin_B[i]=S.spin[i][1]+S.spin[i][2]+S.spin[i][3]+S.spin[i][4]
end
S.hpc=S.c
TEXT.show(text.newVersion,640,200,30,"fly",.3)
end
addToTable(S,stat)
end
end
end
function saveData()
local F=FILE.data
function File.saveData()
local F=files.data
F:open("w")
local _,mes=F:write(dumpTable(stat))
F:flush()F:close()
if not _ then
TEXT(text.statSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
TEXT.show(text.statSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
function loadSetting()
local F=FILE.setting
function File.loadSetting()
local F=files.setting
if F:open("r")then
local s=F:read()
if s:sub(1,6)~="return"then
@@ -159,18 +206,18 @@ function loadSetting()
end
end
end
function saveSetting()
local F=FILE.setting
function File.saveSetting()
local F=files.setting
F:open("w")
local _,mes=F:write(dumpTable(setting))
F:flush()F:close()
if _ then TEXT(text.settingSaved,1140,650,40,"sudden",.5)
else TEXT(text.settingSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then TEXT.show(text.settingSaved,1140,650,40,"sudden",.5)
else TEXT.show(text.settingSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
function loadKeyMap()
local F=FILE.keyMap
function File.loadKeyMap()
local F=files.keyMap
if F:open("r")then
local s=loadstring(F:read())
F:close()
@@ -180,18 +227,18 @@ function loadKeyMap()
end
end
end
function saveKeyMap()
local F=FILE.keyMap
function File.saveKeyMap()
local F=files.keyMap
F:open("w")
local _,mes=F:write(dumpTable(keyMap))
F:flush()F:close()
if _ then TEXT(text.keyMapSaved,1140,650,26,"sudden",.5)
else TEXT(text.keyMapSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then TEXT.show(text.keyMapSaved,1140,650,26,"sudden",.5)
else TEXT.show(text.keyMapSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
function loadVK()
local F=FILE.VK
function File.loadVK()
local F=files.VK
if F:open("r")then
local s=loadstring(F:read())
F:close()
@@ -201,23 +248,13 @@ function loadVK()
end
end
end
function saveVK()
local F=FILE.VK
function File.saveVK()
local F=files.VK
F:open("w")
local _,mes=F:write(dumpTable(VK_org))
F:flush()F:close()
if _ then TEXT(text.VKSaved,1140,650,26,"sudden",.5)
else TEXT(text.VKSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then TEXT.show(text.VKSaved,1140,650,26,"sudden",.5)
else TEXT.show(text.VKSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
end
end
if fs.getInfo("unlock.dat")then loadUnlock()end
if fs.getInfo("data.dat")then loadData()end
if fs.getInfo("key.dat")then loadKeyMap()end
if fs.getInfo("virtualkey.dat")then loadVK()end
if fs.getInfo("setting.dat")then loadSetting()
elseif system=="Android"or system=="iOS" then
setting.VKSwitch=true
setting.swap=false
setting.vib=2
end
return File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
image/mess/pay1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
image/mess/pay2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -9,20 +9,18 @@ local actName={
"落在最左:","落在最右:","列在最左:","列在最右:",
}
return{
anykey="按任意键继续",
newVersion="检测到更新!可能有部分数据被重新处理",
lang="中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="Techrash",
techrashB2B="B2B Techrash",
techrashB3B="B2B2B Techrash",
techrash="Techrash",techrashB2B="B2B Techrash",techrashB3B="B2B2B Techrash",
spin={"Z-spin","S-spin","L-spin","J-spin","T-spin","O-spin","I-spin"},
block={"Z","S","L","J","T","O","I"},
clear={" single"," double"," triple"},
spin={"Z-spin","S-spin","L-spin","J-spin","T-spin","O-spin","I-spin"},
b2b="B2B ",b3b="B2B2B ",
mini="Mini",
PC="Perfect Clear",
C="Clear",
mini="Mini",b2b="B2B ",b3b="B2B2B ",
PC="Perfect Clear",HPC="Half Clear",
hold="暂存",next="下一个",
stage=function(n)return"关卡 "..n end,
@@ -38,6 +36,11 @@ return{
pause="暂停",
pauseCount="暂停统计",
atk="ATK",
spd="SPD",
recv="RECV",
eff="EFF",
custom="自定义游戏",
customOption={
drop="下落速度:",
@@ -104,40 +107,31 @@ return{
actName=actName,
load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载模式ing","加载乱七八糟的东西ing"},
load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载图片ing","加载模式ing","加载乱七八糟的东西ing"},
pauseStat={
"时间:",
"按键/旋转/暂存:",
"使用方块:",
"消行:",
"攻击:",
"发送数:",
"接收数:",
"直接消除数:",
"旋转消除数:",
"满贯数:",
"全清数:",
"效率:",
"多余操作方块:",
"最简操作率:",
"块:",
"消行/挖掘:",
"攻击/挖掘攻击:",
"上涨/接收/抵消:",
"B2B/B3B/PC/HPC:",
"Finesse:",
},
stat={
spin="spin0~3",
clear="clear1~4",
"游戏运行次数:",
"游戏局数:",
"游戏时间:",
"按键:",
"旋转数:",
"暂存数:",
"方块使用:",
"消行数:",
"攻击(发送)数:",
"接收数:",
"直接消除数:",
"旋转消除数:",
"满贯数:",
"全清数:",
"效率:",
"多余操作:",
"按键/旋转/暂存:",
"方块/消行/攻击:",
"接收/抵消/上涨:",
"挖掘/挖掘攻击:",
"效率/挖掘效率:",
"多余操作/极简率:",
"满贯/大满贯:",
"全/半清:",
},
help={
"好像也没啥好帮助的吧?就当是关于了",
@@ -146,7 +140,7 @@ return{
"",
"使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:MrZ/Miya",
"特别感谢:Flyz,Farter,196,Teatube,T830,[所有内测人员]和 你!",
"",
"错误或者建议请附带截图发送到内测群或者作者邮箱~",
@@ -165,7 +159,7 @@ return{
simple-love-lights[dylhunn]
]],
support="支持作者",
group="官方QQ群",
group="官方QQ群(如果没有被暗改的话就是这个):822023725",
WidgetText={
main={
play="开始",
@@ -243,7 +237,6 @@ return{
grid="网格",
center="旋转中心",
bg="背景",
bgspace="星空背景",
smooth="平滑下落",
lockFX="锁定特效等级",
dropFX="下落特效等级",
@@ -267,6 +260,9 @@ return{
setting_control={
das="DAS",arr="ARR",
sddas="软降DAS",sdarr="软降ARR",
ihs="提前Hold",
irs="提前旋转",
ims="提前移动",
reset="重置",
back=BK,
},

View File

@@ -9,20 +9,18 @@ local actName={
"落在最左:","落在最右:","列在最左:","列在最右:",
}
return{
anykey="按任意键继续",
newVersion="检测到更新!可能有部分数据被重新处理",
lang="全中文",
atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="四清",
techrashB2B="满贯 四清",
techrashB3B="大满贯 四清",
techrash="四清",techrashB2B="满贯 四清",techrashB3B="大满贯 四清",
spin={"Z型回旋","S型回旋","L型回旋","J型回旋","T型回旋","O型回旋","I型回旋"},
block={"Z","S","L","J","T","O","I"},
clear={"单清","双清","三清"},
spin={"Z型回旋","S型回旋","L型回旋","J型回旋","T型回旋","O型回旋","I型回旋"},
b2b="满贯",b3b="大满贯",
mini="迷你",
PC="场地全清",
C="场地半清",
mini="迷你",b2b="满贯",b3b="大满贯",
PC="场地全清",HPC="场地半清",
hold="暂存",next="下一个",
stage=function(n)return"关卡 "..n end,
@@ -38,6 +36,11 @@ return{
pause="暂停",
pauseCount="暂停统计",
atk="",
spd="",
recv="",
eff="",
custom="自定义游戏",
customOption={
drop="下落速度:",
@@ -102,40 +105,31 @@ return{
actName=actName,
load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载模式ing","加载乱七八糟的东西ing"},
load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载图片ing","加载模式ing","加载乱七八糟的东西ing"},
pauseStat={
"时间:",
"按键/旋转/暂存:",
"使用方块:",
"消行:",
"攻击:",
"发送数:",
"接收数:",
"直接消除数:",
"旋转消除数:",
"满贯数:",
"全清数:",
"效率:",
"多余操作方块:",
"最简操作率:",
"块:",
"消行/挖掘:",
"攻击/挖掘攻击:",
"上涨/接收/抵消:",
"(大)满贯/全(半)清:",
"非极简操作:",
},
stat={
spin="回旋0~3",
clear="消除1~4",
"游戏运行次数:",
"游戏局数:",
"游戏时间:",
"按键:",
"旋转数:",
"暂存数:",
"方块使用:",
"消行数:",
"攻击(发送)数:",
"接收数:",
"直接消除数:",
"旋转消除数:",
"满贯数:",
"全清数:",
"效率:",
"多余操作:",
"按键/旋转/暂存:",
"方块/消行/攻击:",
"接收/抵消/上涨:",
"挖掘/挖掘攻击:",
"效率/挖掘效率:",
"多余操作/极简率:",
"满贯/大满贯:",
"全/半清:",
},
help={
"好像也没啥好帮助的吧?就当是关于了",
@@ -144,7 +138,7 @@ return{
"",
"使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:Miya",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ 语音:MrZ/Miya",
"特别感谢:Flyz,Farter,196,Teatube,T830,[所有内测人员]和 你!",
"",
"错误或者建议请附带截图发送到内测群或者作者邮箱~",
@@ -163,7 +157,7 @@ return{
simple-love-lights[dylhunn]
]],
support="支持作者",
group="官方QQ群",
group="官方QQ群(如果没有被暗改的话就是这个):822023725",
WidgetText={
main={
play="开始",
@@ -240,7 +234,6 @@ return{
grid="网格",
center="旋转中心",
bg="背景",
bgspace="星空背景",
smooth="平滑下落",
lockFX="锁定特效等级",
dropFX="下落特效等级",
@@ -264,6 +257,9 @@ return{
setting_control={
das="首次移动延迟",arr="移动重复延迟",
sddas="首次软降延迟",sdarr="软降重复延迟",
ihs="提前暂存",
irs="提前旋转",
ims="提前移动",
reset="重置",
back=BK,
},
@@ -324,4 +320,4 @@ return{
back=BK,
},
},
}--译
}

View File

@@ -7,20 +7,18 @@ local actName={
"Left Drop:","Right Drop:","Left INS:","Right INS:",
}
return{
anykey="Any Key to Continue",
newVersion="Updating detected!Maybe some data is recalculated",
lang="English",
atkModeName={"Random","Badges","K.O.s","Counters"},
royale_remain=function(n)return n.." Players Remain"end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="Techrash",
techrashB2B="B2B Techrash",
techrashB3B="B2B2B Techrash",
techrash="Techrash",techrashB2B="B2B Techrash",techrashB3B="B2B2B Techrash",
spin={"Z-spin","S-spin","L-spin","J-spin","T-spin","O-spin","I-spin"},
block={"Z","S","L","J","T","O","I"},
clear={" single"," double"," triple"},
spin={"Z-spin","S-spin","L-spin","J-spin","T-spin","O-spin","I-spin"},
b2b="B2B ",b3b="B2B2B ",
mini="Mini",
PC="Perfect Clear",
C="Clear",
mini="Mini",b2b="B2B ",b3b="B2B2B ",
PC="Perfect Clear",HPC="Clear",
hold="Hold",next="Next",
stage=function(n)return"STAGE "..n end,
@@ -36,6 +34,11 @@ return{
pause="PAUSE",
pauseCount="Pause Count",
atk="ATK",
spd="SPD",
recv="RECV",
eff="EFF",
custom="Custom Game",
customOption={
drop="Drop speed:",
@@ -96,44 +99,34 @@ return{
noScore="No Score Yet",
highScore="Highscore",
newRecord="New Rocord",
errorMsg="Techmino ran into a problem and needs to restart.\nWe collected some error info,and you can send them to author.",
errorMsg="Techmino ran into a problem and needs to restart.\nWe collected some error info, and you can send them to the author.",
actName=actName,
load={[0]="Finished","Loading VOICE","Loading BGM","Loading SFX","Loading modes","Loading other things"},
load={[0]="Finished","Loading VOICE","Loading BGM","Loading SFX","Loading images","Loading modes","Loading other things"},
pauseStat={
"Time:",
"Key/Rot./Hold:",
"Block used:",
"Lines:",
"Attack:",
"Send:",
"Key/Rotate/Hold:",
"Piece:",
"Row/Dig:",
"Attack/DigAtk:",
"Receive:",
"Clear:",
"Spin:",
"B2B:",
"PC:",
"Efficiency:",
"Finesse err:",
"Finesse rate:",
"B2B/B3B/PC/HPC:",
"Finesse:",
},
stat={
"Games run:",
"Games played:",
"Game time:",
"Key pressed:",
"Rotate:",
"Hold:",
"Block used:",
"Lines cleared:",
"Attack(Sent):",
"Receive:",
"Clear:",
"Spin:",
"B2B:",
"PC:",
"Efficiency:",
"Finesse error:",
spin="spin0~3",
clear="clear1~4",
"Game Runned:",
"Game Played:",
"Game Time:",
"Key/Rotate/Hold:",
"Block/Row/Atk.:",
"Recv./Res./Asc.:",
"Dig/Dig Atk.:",
"Eff./Dig Eff.:",
"Finesse Err./Rate:",
"B2B/B3B:",
"PC/HPC:",
},
help={
"I don't think you need \"help\".",
@@ -142,14 +135,14 @@ return{
"",
"Powered by LOVE2D",
"Author:MrZ E-mail:1046101471@qq.com",
"Program:MrZ Art:MrZ Music:MrZ SFX:MrZ VOICE:Miya",
"Program:MrZ Art:MrZ Music:MrZ SFX:MrZ VOICE:MrZ/Miya",
"Special thanks:Flyz,Farter,196,Teatube,T830,[all test staff] and YOU!",
"",
"Any bugs/suggestions to my E-mail.(may with screenshot)",
"Only released in test group for FREE",
"Game downloaded from other way may implanted with virous",
"Only network/vibrating permission applied",
"Author is not responsible for any loss by eddited game",
"Author is not responsible for any loss by edited game",
},
used=[[
Tool used:
@@ -161,7 +154,7 @@ Lib used:
simple-love-lights[dylhunn]
]],
support="Support Author",
group="Official QQ Group",
group="Official QQ Group(if not hacked):822023725",
WidgetText={
main={
play="Play",
@@ -239,7 +232,6 @@ Lib used:
grid="Grid",
center="Center",
bg="Background",
bgspace="BG space",
smooth="Smooth drop",
lockFX="Lock FX level",
dropFX="Drop FX level",
@@ -263,6 +255,9 @@ Lib used:
setting_control={
das="DAS",arr="ARR",
sddas="softdrop DAS",sdarr="softdrop ARR",
ihs="Initial Hold",
irs="Initial Rotate",
ims="Initial Move",
reset="Reset",
back=BK,
},

604
main.lua
View File

@@ -5,7 +5,7 @@
math.randomseed(os.time()*626)
local love=love
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local gc,sys=love.graphics,love.system
local gc,sys,fs=love.graphics,love.system,love.filesystem
local Timer=love.timer.getTime
local int,rnd,max,min=math.floor,math.random,math.max,math.min
local abs=math.abs
@@ -20,7 +20,7 @@ local touching=nil--第一触摸ID
local touchDist=nil
joysticks={}
local devMode=0
local devMode
players={alive={},human=0}
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--x,y,wid,hei,radius,scale K
local scr=scr
@@ -37,8 +37,6 @@ mapCam={
zoomK=nil,
--for auto zooming when enter/leave scene
}
curBG="none"
voiceQueue={free=0}
texts={}
widget_sel=nil--selected widget object
@@ -54,31 +52,35 @@ for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
--Game system Vars
-------------------------------------------------------------
require("parts/list")
space=require("parts/space")local space=space
require("toolfunc")
setFont=require("parts/setfont")
freeRow=require("parts/freeRow")
blocks=require("parts/mino")
require("texture")
FILE=require("file")
VIB=require("parts/vib")
SFX=require("parts/sfx")
BGM=require("parts/bgm")
require("parts/voice")
Event_task=require("parts/task")
VOC=require("parts/voice")
sysFX=require("parts/sysFX")
TEXT=require("parts/text")
TASK=require("parts/task")
tickEvent=require("parts/tickEvent")
AITemplate=require("parts/AITemplate")
require("parts/modes")
SCN=require("scene")
skin=require("parts/skin")
BG=require("parts/bg")
IMG=require("parts/img")
SHADER=require("parts/shader")
-- require("parts/light")
-- require("parts/shader")
scene=require("scene")
require("parts/modes")
require("default_data")
require("class")
require("ai")
require("toolfunc")
require("file")
require("text")
require("parts/widget")
require("parts/ai")
require("player")
Widget=require("widgetList")
require("texture")
local Tmr=require("timer")
local Pnt=require("paint")
--Modules
@@ -97,7 +99,7 @@ if sys.getPowerInfo()~="unknown"then
gc.setColor(1,1,1)
gc.setLineWidth(2)
gc.line(74,5,100,22)
else
elseif pow then
if charging then gc.setColor(0,1,0)
elseif pow>50 then gc.setColor(1,1,1)
elseif pow>26 then gc.setColor(1,1,0)
@@ -178,11 +180,15 @@ local touchDown,touchUp,touchMove={},{},{}
local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{}
function mouseDown.load()
sceneTemp.skip=true
function mouseDown.load(x,y,k)
if k==1 then
sceneTemp.skip=true
end
end
function keyDown.load()
sceneTemp.skip=true
function keyDown.load(k)
if k=="space"or k=="return"then
sceneTemp.skip=true
end
end
function touchDown.load()
sceneTemp.skip=true
@@ -190,24 +196,24 @@ end
function mouseDown.intro(x,y,k)
if k==2 then
VOICE("bye")
scene.back()
VOC.play("bye")
SCN.back()
else
scene.push()
scene.swapTo("main")
SCN.push()
SCN.swapTo("main")
end
end
function touchDown.intro(id,x,y)
scene.push()
scene.swapTo("main")
SCN.push()
SCN.swapTo("main")
end
function keyDown.intro(key)
if key=="escape"then
VOICE("bye")
scene.back()
VOC.play("bye")
SCN.back()
else
scene.push()
scene.swapTo("main")
SCN.push()
SCN.swapTo("main")
end
end
@@ -298,19 +304,19 @@ function keyDown.mode(key)
if key=="return"then
if mapCam.sel then
mapCam.keyCtrl=false
scene.push()loadGame(mapCam.sel)
SCN.push()loadGame(mapCam.sel)
end
elseif key=="escape"then
if mapCam.sel then
mapCam.sel=nil
else
scene.back()
SCN.back()
end
elseif mapCam.sel==71 or mapCam.sel==72 then
if key=="q"then
scene.push()scene.swapTo("draw")
SCN.push()SCN.swapTo("draw")
elseif key=="e"then
scene.push()scene.swapTo("custom")
SCN.push()SCN.swapTo("custom")
end
end
end
@@ -335,7 +341,7 @@ function keyDown.music(key)
BGM.stop()
end
elseif key=="escape"then
scene.back()
SCN.back()
end
end
@@ -344,14 +350,14 @@ function keyDown.custom(key)
if key=="left"then
customSel[sel]=(customSel[sel]-2)%#customRange[customID[sel]]+1
if sel==12 then
curBG=customRange.bg[customSel[12]]
BG.set(customRange.bg[customSel[12]])
elseif sel==13 then
BGM.play(customRange.bgm[customSel[13]])
end
elseif key=="right"then
customSel[sel]=customSel[sel]%#customRange[customID[sel]]+1
if sel==12 then
curBG=customRange.bg[customSel[sel]]
BG.set(customRange.bg[customSel[sel]])
elseif sel==13 then
BGM.play(customRange.bgm[customSel[sel]])
end
@@ -370,7 +376,7 @@ function keyDown.custom(key)
elseif key=="5"then
Widget.custom.set5.code()
elseif key=="escape"then
scene.back()
SCN.back()
end
end
@@ -439,7 +445,7 @@ function keyDown.draw(key)
preField[sy][sx]=pen
end
elseif key=="escape"then
scene.back()
SCN.back()
elseif key=="c"and kb.isDown("lctrl","rctrl")then
copyBoard()
elseif key=="v"and kb.isDown("lctrl","rctrl")then
@@ -455,7 +461,7 @@ function mouseDown.setting_sound(x,y,k)
sceneTemp.jump=10
local t=Timer()-sceneTemp.last
if t>1 then
VOICE((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
VOC.play((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
sceneTemp.last=Timer()
if rnd()<.0626 then
for i=1,#modes do
@@ -467,8 +473,8 @@ function mouseDown.setting_sound(x,y,k)
end
end
end
saveUnlock()
TEXT("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
FILE.saveUnlock()
TEXT.show("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
end
end
end
@@ -484,7 +490,7 @@ function keyDown.setting_key(key)
s.kS=false
SFX.play("finesseError",.5)
else
scene.back()
SCN.back()
end
elseif s.kS then
for l=1,8 do
@@ -531,7 +537,7 @@ function gamepadDown.setting_key(key)
s.jS=false
SFX.play("finesseError",.5)
else
scene.back()
SCN.back()
end
elseif s.jS then
for l=9,16 do
@@ -573,7 +579,7 @@ function gamepadDown.setting_key(key)
end
function mouseDown.setting_touch(x,y,k)
if k==2 then scene.back()end
if k==2 then SCN.back()end
sceneTemp.sel=onVK_org(x,y)or sceneTemp.sel
end
function mouseMove.setting_touch(x,y,dx,dy)
@@ -608,17 +614,17 @@ end
function keyDown.pause(key)
if key=="escape"then
scene.back()
SCN.back()
elseif key=="space"then
resumeGame()
elseif key=="s"then
scene.push()
scene.swapTo("setting_sound")
SCN.push()
SCN.swapTo("setting_sound")
elseif key=="r"then
clearTask("play")
updateStat()
TASK.clear("play")
mergeStat(stat,players[1].stat)
resetGameData()
scene.swapTo("play","none")
SCN.swapTo("play","none")
end
end
@@ -707,7 +713,7 @@ function keyUp.play(key)
end
end
function gamepadDown.play(key)
if key=="back"then scene.back()return end
if key=="back"then SCN.back()return end
local m=keyMap
for p=1,players.human do
for k=1,20 do
@@ -734,6 +740,29 @@ function gamepadUp.play(key)
end
end
end
function touchDown.help(id,x,y)
local S=sceneTemp
if S.pw==0 then
S.pw=1
else
if y<S.y then
S.pw=0
return
end
if S.pw%2==1 and x>S.x or S.pw%2==0 and x<S.x then
S.pw=S.pw+1
if S.pw==26 then
marking=nil
return
end
else
S.pw=0
end
end
S.x,S.y=x,y
end
function wheelMoved.history(x,y)
wheelScroll(y)
end
@@ -743,7 +772,7 @@ function keyDown.history(key)
elseif key=="down"then
sceneTemp[2]=min(sceneTemp[2]+3,#sceneTemp[1]-22)
elseif key=="escape"then
scene.back()
SCN.back()
end
end
-------------------------------------------------------------
@@ -752,7 +781,7 @@ local function widgetPress(W,x,y)
W.code()
W:FX()
SFX.play("button")
VOICE("nya")
VOC.play("nya")
elseif W.type=="switch"then
W.code()
SFX.play("move",.6)
@@ -780,7 +809,7 @@ local function widgetControl_key(i)
if widget_sel then
widget_sel=kb.isDown("lshift")and widget_sel.prev or widget_sel.next or widget_sel
else
widget_sel=select(2,next(Widget[scene.cur]))
widget_sel=select(2,next(Widget[SCN.cur]))
end
elseif i=="space"or i=="return"then
if widget_sel then
@@ -804,7 +833,7 @@ local function widgetControl_gamepad(i)
if widget_sel then
widget_sel=i=="dpup"and widget_sel.prev or widget_sel.next or widget_sel
else
widget_sel=select(2,next(Widget[scene.cur]))
widget_sel=select(2,next(Widget[SCN.cur]))
end
elseif i=="start"then
if widget_sel then
@@ -828,12 +857,12 @@ function love.mousepressed(x,y,k,t,num)
if t then return end
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
if devMode>0 then print(mx,my)end
if scene.swapping then return end
if mouseDown[scene.cur]then
mouseDown[scene.cur](mx,my,k)
if devMode==1 then print(mx,my)end
if SCN.swapping then return end
if mouseDown[SCN.cur]then
mouseDown[SCN.cur](mx,my,k)
elseif k==2 then
scene.back()
SCN.back()
end
if k==1 then
if widget_sel then
@@ -846,10 +875,10 @@ function love.mousemoved(x,y,dx,dy,t)
if t then return end
mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y)
if scene.swapping then return end
if SCN.swapping then return end
dx,dy=dx/scr.k,dy/scr.k
if mouseMove[scene.cur]then
mouseMove[scene.cur](mx,my,dx,dy)
if mouseMove[SCN.cur]then
mouseMove[SCN.cur](mx,my,dx,dy)
end
if ms.isDown(1) then
if widget_sel then
@@ -857,7 +886,7 @@ function love.mousemoved(x,y,dx,dy,t)
end
else
widget_sel=nil
for _,W in next,Widget[scene.cur]do
for _,W in next,Widget[SCN.cur]do
if not(W.hide and W.hide())and W:isAbove(mx,my)then
widget_sel=W
return
@@ -868,22 +897,22 @@ end
function love.mousereleased(x,y,k,t,num)
if t then return end
mx,my=xOy:inverseTransformPoint(x,y)
if t or scene.swapping then return end
if mouseUp[scene.cur]then
mouseUp[scene.cur](mx,my,k)
if t or SCN.swapping then return end
if mouseUp[SCN.cur]then
mouseUp[SCN.cur](mx,my,k)
end
if lastX and(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then
mouseClick[scene.cur](mx,my,k)
if lastX and(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[SCN.cur]then
mouseClick[SCN.cur](mx,my,k)
end
end
function love.wheelmoved(x,y)
if scene.swapping then return end
if wheelMoved[scene.cur]then wheelMoved[scene.cur](x,y)end
if SCN.swapping then return end
if wheelMoved[SCN.cur]then wheelMoved[SCN.cur](x,y)end
end
function love.touchpressed(id,x,y)
mouseShow=false
if scene.swapping then return end
if SCN.swapping then return end
if not touching then
touching=id
love.touchmoved(id,x,y,0,0)
@@ -891,22 +920,22 @@ function love.touchpressed(id,x,y)
touchDist=nil--reset distance
x,y=xOy:inverseTransformPoint(x,y)
lastX,lastY=x,y
if touchDown[scene.cur]then
touchDown[scene.cur](id,x,y)
if touchDown[SCN.cur]then
touchDown[SCN.cur](id,x,y)
end
end
function love.touchmoved(id,x,y,dx,dy)
if scene.swapping then return end
if SCN.swapping then return end
x,y=xOy:inverseTransformPoint(x,y)
if touchMove[scene.cur]then
touchMove[scene.cur](id,x,y,dx/scr.k,dy/scr.k)
if touchMove[SCN.cur]then
touchMove[SCN.cur](id,x,y,dx/scr.k,dy/scr.k)
end
if widget_sel then
if touching then
widgetDrag(widget_sel,x,y,dx,dy)
end
else
for _,W in next,Widget[scene.cur]do
for _,W in next,Widget[SCN.cur]do
if not(W.hide and W.hide())and W:isAbove(x,y)then
widget_sel=W
return
@@ -918,7 +947,7 @@ function love.touchmoved(id,x,y,dx,dy)
end
end
function love.touchreleased(id,x,y)
if scene.swapping then return end
if SCN.swapping then return end
x,y=xOy:inverseTransformPoint(x,y)
if id==touching then
touching=nil
@@ -927,63 +956,76 @@ function love.touchreleased(id,x,y)
end
widget_sel=nil
end
if touchUp[scene.cur]then
touchUp[scene.cur](id,x,y)
if touchUp[SCN.cur]then
touchUp[SCN.cur](id,x,y)
end
if(x-lastX)^2+(y-lastY)^2<26 and touchClick[scene.cur]then
touchClick[scene.cur](x,y,k)
if(x-lastX)^2+(y-lastY)^2<26 and touchClick[SCN.cur]then
touchClick[SCN.cur](x,y,k)
end
end
function love.keypressed(i)
mouseShow=false
if scene.swapping then return end
if i=="f8"then devMode=0
elseif i=="f9"then devMode=1
elseif i=="f10"then devMode=2
elseif i=="f11"then devMode=3
elseif devMode==2 then
if i=="k"then
for i=1,8 do
local P=players.alive[rnd(#players.alive)]
if P~=players[1]then
P.lastRecv=players[1]
P:lose()
if SCN.swapping then return end
if devMode then
if i=="f5"then
print("DEBUG:")
elseif i=="f8"then devMode=nil
elseif i=="f9"then devMode=1
elseif i=="f10"then devMode=2
elseif i=="f11"then devMode=3
elseif i=="f12"then devMode=4
elseif devMode==2 then
if i=="k"then
for i=1,8 do
local P=players.alive[rnd(#players.alive)]
if P~=players[1]then
P.lastRecv=players[1]
P:lose()
end
end
--Test code here
elseif i=="q"then
local W=widget_sel
if W then W:getInfo()end
elseif i=="f3"then
error("Techmino:挂了")
elseif i=="e"then
for k,v in next,_G do
print(k,v)
end
elseif i=="6"then
if kb.isDown("z")and kb.isDown("2")then
marking=nil
end
elseif widget_sel then
local W=widget_sel
if i=="left"then W.x=W.x-10
elseif i=="right"then W.x=W.x+10
elseif i=="up"then W.y=W.y-10
elseif i=="down"then W.y=W.y+10
elseif i==","then W.w=W.w-10
elseif i=="."then W.w=W.w+10
elseif i=="/"then W.h=W.h-10
elseif i=="'"then W.h=W.h+10
elseif i=="["then W.font=W.font-1
elseif i=="]"then W.font=W.font+1
end
end
--Test code here
elseif i=="q"then
local W=widget_sel
if W then W:getInfo()end
elseif i=="f3"then
error("Techmino:挂了")
elseif i=="e"then
for k,v in next,_G do
print(k,v)
end
elseif widget_sel then
local W=widget_sel
if i=="left"then W.x=W.x-10
elseif i=="right"then W.x=W.x+10
elseif i=="up"then W.y=W.y-10
elseif i=="down"then W.y=W.y+10
elseif i==","then W.w=W.w-10
elseif i=="."then W.w=W.w+10
elseif i=="/"then W.h=W.h-10
elseif i=="'"then W.h=W.h+10
elseif i=="["then W.font=W.font-1
elseif i=="]"then W.font=W.font+1
end
end
elseif i=="f8"then
devMode=1
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
else
if keyDown[scene.cur]then keyDown[scene.cur](i)
elseif i=="escape"then scene.back()
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
elseif i=="escape"then SCN.back()
else widgetControl_key(i)
end
end
end
function love.keyreleased(i)
if scene.swapping then return end
if keyUp[scene.cur]then keyUp[scene.cur](i)end
if SCN.swapping then return end
if keyUp[SCN.cur]then keyUp[SCN.cur](i)end
end
function love.joystickadded(JS)
@@ -1007,31 +1049,31 @@ local keyMirror={
}
function love.gamepadpressed(joystick,i)
mouseShow=false
if scene.swapping then return end
if gamepadDown[scene.cur]then gamepadDown[scene.cur](i)
elseif keyDown[scene.cur]then keyDown[scene.cur](keyMirror[i]or i)
elseif i=="back"then scene.back()
if SCN.swapping then return end
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
elseif i=="back"then SCN.back()
else widgetControl_gamepad(i)
end
end
function love.gamepadreleased(joystick,i)
if scene.swapping then return end
if gamepadUp[scene.cur]then gamepadUp[scene.cur](i)
if SCN.swapping then return end
if gamepadUp[SCN.cur]then gamepadUp[SCN.cur](i)
end
end
--[[
function love.joystickpressed(JS,k)
mouseShow=false
if scene.swapping then return end
if gamepadDown[scene.cur]then gamepadDown[scene.cur](i)
elseif keyDown[scene.cur]then keyDown[scene.cur](keyMirror[i]or i)
elseif i=="back"then scene.back()
if SCN.swapping then return end
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
elseif i=="back"then SCN.back()
else widgetControl_gamepad(i)
end
end
function love.joystickreleased(JS,k)
if scene.swapping then return end
if gamepadUp[scene.cur]then gamepadUp[scene.cur](i)
if SCN.swapping then return end
if gamepadUp[SCN.cur]then gamepadUp[SCN.cur](i)
end
end
function love.joystickaxis(JS,axis,val)
@@ -1058,185 +1100,33 @@ function love.resize(w,h)
scr.x,scr.y=(w-h*16/9)*.5,0
end
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
if setting.bgspace then space.new()end
BG.resize(w,h)
end
function love.focus(f)
if scene.cur=="play"and not f and setting.autoPause then pauseGame()end
end
local function love_update(dt)
if setting.bgspace then space.update()end
for i=#sysFX,1,-1 do
local S=sysFX[i]
S[2]=S[2]+1
if S[2]==S[3]then
for i=i,#sysFX do
sysFX[i]=sysFX[i+1]
end
end
end
for i=#texts,1,-1 do
local t=texts[i]
t.c=t.c+t.spd
if t.stop then
if t.c>t.stop then
t.c=t.stop
end
end
if t.c>60 then
rem(texts,i)
end
end
if scene.swapping then
local S=scene.swap
S.time=S.time-1
if S.time==S.mid then
scene.init(S.tar,scene.cur)
scene.cur=S.tar
for _,W in next,Widget[S.tar]do
W:reset()
end--重置控件
widget_sel=nil
collectgarbage()
--此时场景切换
end
if S.time==0 then
scene.swapping=false
end
end
local _=Tmr[scene.cur]
if _ then _(dt)end
for i=#Task,1,-1 do
local T=Task[i]
if T.code(T.P,T.data)then
for i=i,#Task do
Task[i]=Task[i+1]
end
end
end
for i=#voiceQueue,1,-1 do
local Q=voiceQueue[i]
if Q.s==0 then--闲置轨,自动删除多余
if i>3 then
local _=voiceQueue
::L::
_[i]=_[i+1]
if _[i]then i=i+1 goto L end
end
elseif Q.s==1 then--等待转换
Q[1]=getVoice(Q[1])
Q[1]:setVolume(setting.voc*.1)
Q[1]:play()
Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--播放1,准备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--12同时播放
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--最后播放
if not Q[1].isPlaying(Q[1])then
Q[1]=nil
Q.s=0
end
end
end
--更新控件
for _,W in next,Widget[scene.cur]do
W:update()
end
if SCN.cur=="play"and not f and setting.autoPause then pauseGame()end
end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
local devColor={
color.white,
color.lightMagenta,
color.lightGreen,
color.lightBlue,
}
local FPS=love.timer.getFPS
local function love_draw()
gc.discard()--SPEED UPUPUP!
Pnt.BG[setting.bg and curBG or"grey"]()
if setting.bgspace then
space.draw()
end
gc.push("transform")
gc.replaceTransform(xOy)
if Pnt[scene.cur]then Pnt[scene.cur]()end
for k,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())then
W:draw()
end
end--Draw widgets
if mouseShow then
local r=Timer()*.5
local R=int(r)%7+1
local _=skin.libColor[setting.skin[R]]
gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3))
gc.draw(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!
gc.setLineWidth(6)
for i=1,#sysFX do
local S=sysFX[i]
if S[1]==0 then
gc.setColor(1,1,1,1-S[2]/S[3])
local r=(10*S[2]/S[3])^1.2
gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--按钮波纹
elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影
end
end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
gc.pop()
gc.setColor(1,1,1)
if powerInfoCanvas then
gc.draw(powerInfoCanvas,0,0,0,scr.k)
end--Power Info
if scene.swapping then
local _=scene.swap
_.draw(_.time)
end--Scene swapping animation
setFont(15)
gc.setColor(1,1,1)
local _=scr.h-20
gc.print(FPS(),5,_)
if devMode>0 then
gc.setColor(1,1,devMode==2 and .6 or 1)
gc.print("Cache used:"..gcinfo(),5,_-20)
gc.print("Free Row:"..freeRow.getCount(),5,_-40)
gc.print("Mouse:"..mx.." "..my,5,_-60)
gc.print("Voices:"..#voiceQueue,5,_-80)
gc.print("Tasks:"..#Task,5,_-100)
if devMode==3 then
love.timer.sleep(.5)
end
end--DEV info
end
love.draw,love.update=NULL,NULL
love.draw,love.update=nil
function love.run()
local T=love.timer
local sleep=T.sleep
local lastFrame,lastFreshPow=T.getTime()
local STEP,GETΔ,WAIT=T.step,T.getDelta,T.sleep
local lastFrame=T.getTime()
local lastFreshPow=lastFrame
local readyDrawFrame=0
local FCT=0--framedraw counter
local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight())
scene.init("load")--Scene Launch
SCN.init("load")--Scene Launch
marking=true
return function()
--EVENT
PUMP()
for N,a,b,c,d,e in POLL()do
if love[N]then
@@ -1246,22 +1136,87 @@ function love.run()
return 1
end
end
T.step()
love_update(T.getDelta())
--UPDATE
STEP()local dt=GETΔ()
TASK.update()
VOC.update()
BG.update(dt)
sysFX.update(dt)
TEXT.update(texts)
local _=Tmr[SCN.cur]if _ then _(dt)end
if SCN.swapping then SCN.swapUpdate()end
for _,W in next,Widget[SCN.cur]do
W:update()
end--更新控件
--DRAW
if not mini()then
readyDrawFrame=readyDrawFrame+setting.frameMul
if readyDrawFrame>=100 then
readyDrawFrame=readyDrawFrame-100
love_draw()
FCT=FCT+setting.frameMul
if FCT>=100 then
FCT=FCT-100
gc.discard()--SPEED UPUPUP!
BG.draw()
gc.push("transform")
gc.replaceTransform(xOy)
if Pnt[SCN.cur]then Pnt[SCN.cur]()end
for k,W in next,Widget[SCN.cur]do
if not(W.hide and W.hide())then
W:draw()
end
end--Draw widgets
if mouseShow then
local r=Timer()*.5
local R=int(r)%7+1
_=skin.libColor[setting.skin[R]]
gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3))
gc.draw(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!
sysFX.draw()
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
gc.pop()
gc.setColor(1,1,1)
if powerInfoCanvas then
gc.draw(powerInfoCanvas,0,0,0,scr.k)
end--Power Info
if SCN.swapping then
_=SCN.swap
_.draw(_.time)
end--Scene swapping animation
setFont(15)
gc.setColor(1,1,1)
_=scr.h-20
gc.print(FPS(),5,_)
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("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)
end
end--DEV info
gc.present()
end
end
if Timer()-lastFrame<.058 then
sleep(.01)
end
while Timer()-lastFrame<.0159 do
sleep(.001)
end--try easily control 60FPS
--FRAME TIME CTRL
if Timer()-lastFrame<.058 then WAIT(.01)end
while Timer()-lastFrame<.0159 do WAIT(.001)end
--FRESH POWER
lastFrame=Timer()
if Timer()-lastFreshPow>1 then
updatePowerInfo()
@@ -1321,7 +1276,7 @@ function love.errorhandler(msg)
setFont(38)gc.printf(text.errorMsg,100,200,1280-100)
setFont(20)
gc.print(system.."-"..gameVersion,100,660)
gc.print("scene:"..scene.cur,400,660)
gc.print("scene:"..SCN.cur,400,660)
gc.printf(err[1],626,360,1260-626)
gc.print("TRACEBACK",626,426)
for i=4,#err-2 do
@@ -1336,3 +1291,18 @@ function love.errorhandler(msg)
end
-------------------------------------------------------------Reset data relied on setting
changeLanguage(setting.lang)
if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end
if fs.getInfo("unlock.dat")then FILE.loadUnlock()end
if fs.getInfo("data.dat")then FILE.loadData()end
if fs.getInfo("key.dat")then FILE.loadKeyMap()end
if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
if fs.getInfo("setting.dat")then FILE.loadSetting()
else
-- firstRun=true
if system=="Android"or system=="iOS" then
setting.VKSwitch=true
setting.swap=false
setting.vib=2
end
end

View File

@@ -53,14 +53,14 @@ return{
players[1].modeData.event="M7"
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mDraw(drawableText.grade,-81,170)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
mText(drawableText.grade,-81,170)
setFont(55)
mStr(P.modeData.event,-81,110)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{P.modeData.point,P.stat.score}end,
scoreDisp=function(D)return sectionName[int(D[1]*.1)+1].." "..D[2]end,

View File

@@ -22,7 +22,7 @@ return{
freshLimit=15,
pushSpeed=2,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
if P.atkBuffer.sum==0 then
local p=#P.atkBuffer+1
local B,D=P.atkBuffer,P.modeData
@@ -60,8 +60,8 @@ return{
setFont(55)
mStr(P.modeData.event,-81,200)
mStr("24",-81,320)
mDraw(drawableText.wave,-81,260)
mDraw(drawableText.nextWave,-81,380)
mText(drawableText.wave,-81,260)
mText(drawableText.nextWave,-81,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -21,7 +21,7 @@ return{
fall=8,
freshLimit=15,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
if P.atkBuffer.sum<2 then
local p=#P.atkBuffer+1
local B,D=P.atkBuffer,P.modeData
@@ -73,8 +73,8 @@ return{
or P.modeData.event<20 and 25
or 28
,-81,320)
mDraw(drawableText.wave,-81,260)
mDraw(drawableText.nextWave,-81,380)
mText(drawableText.wave,-81,260)
mText(drawableText.nextWave,-81,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -29,11 +29,11 @@ return{
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -31,11 +31,11 @@ return{
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -31,11 +31,11 @@ return{
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -30,11 +30,11 @@ return{
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
@@ -49,8 +49,8 @@ return{
3
else
return
L>=150 and 3 or
L>=100 and 2 or
L>=126 and 3 or
L>=80 and 2 or
L>=40 and 1 or
L>=1 and 0
end

View File

@@ -32,11 +32,11 @@ return{
newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-81,300)
mDraw(drawableText.techrash,-81,420)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_4,-81,340)
mStr(P.stat.clear_S[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -63,8 +63,8 @@ return{
setFont(45)
mStr(P.combo,-81,310)
mStr(P.modeData.point,-81,400)
mDraw(drawableText.combo,-81,358)
mDraw(drawableText.mxcmb,-81,450)
mText(drawableText.combo,-81,358)
mText(drawableText.mxcmb,-81,450)
end,
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,

View File

@@ -61,8 +61,8 @@ return{
setFont(45)
mStr(P.combo,-81,310)
mStr(P.modeData.point,-81,400)
mDraw(drawableText.combo,-81,358)
mDraw(drawableText.mxcmb,-81,450)
mText(drawableText.combo,-81,358)
mText(drawableText.mxcmb,-81,450)
end,
score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end,

View File

@@ -50,7 +50,7 @@ return{
setFont(75)
local r=P.gameEnv.target*.1
mStr(r<11 and 18 or r<22 and r+8 or r==22 and"00"or r==23 and"0a"or format("%x",r*10-220),-81,210)
mDraw(drawableText.speedLV,-81,290)
mText(drawableText.speedLV,-81,290)
setFont(45)
mStr(P.stat.row,-81,320)
mStr(P.gameEnv.target,-81,370)

View File

@@ -54,6 +54,7 @@ return{
P.visTime[y]=freeRow.get(t)
for x=1,10 do P.field[y][x]=preField[y][x]end
end
P.garbageBeneath=preField.h
end
modeEnv.bg=customRange.bg[customSel[12]]
modeEnv.bgm=customRange.bgm[customSel[13]]
@@ -62,7 +63,7 @@ return{
setFont(55)
if P.gameEnv.puzzle or P.gameEnv.target>1e10 then
mStr(P.stat.row,-81,225)
mDraw(drawableText.line,-81,290)
mText(drawableText.line,-81,290)
else
local R=P.gameEnv.target-P.stat.row
mStr(R>=0 and R or 0,-81,240)

View File

@@ -74,7 +74,7 @@ return{
local dx,dy=P.fieldOff.x,P.fieldOff.y
setFont(55)
mStr(P.stat.row,-81,225)
mDraw(drawableText.line,-81,290)
mText(drawableText.line,-81,290)
if P.gameEnv.puzzle and P.modeData.event==0 then
local m=puzzleMark
for y=1,preField.h do for x=1,10 do

View File

@@ -19,10 +19,11 @@ return{
env={
drop=5,lock=60,
fall=6,
next=3,
freshLimit=15,
pushSpeed=2,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
local t=240-2*P.modeData.event
if P.modeData.counter>=t then
@@ -61,8 +62,8 @@ return{
setFont(55)
mStr(P.modeData.event,-81,200)
mStr(P.modeData.point,-81,320)
mDraw(drawableText.wave,-81,260)
mDraw(drawableText.rpm,-81,380)
mText(drawableText.wave,-81,260)
mText(drawableText.rpm,-81,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -19,10 +19,11 @@ return{
env={
drop=30,lock=60,
fall=10,
next=3,
freshLimit=15,
pushSpeed=1,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
local t=360-P.modeData.event*2
if P.modeData.counter>=t then
@@ -61,8 +62,8 @@ return{
setFont(55)
mStr(P.modeData.event,-81,200)
mStr(P.modeData.point,-81,320)
mDraw(drawableText.wave,-81,260)
mDraw(drawableText.rpm,-81,380)
mText(drawableText.wave,-81,260)
mText(drawableText.rpm,-81,380)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -21,11 +21,12 @@ return{
fall=20,
freshLimit=15,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
local D=P.modeData
D.counter=D.counter+1
if D.counter>=max(90,180-D.event)then
P:garbageRise(10,1,rnd(10))
P.stat.recv=P.stat.recv+1
D.counter=0
D.event=D.event+1
end
@@ -39,7 +40,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.row}end,
scoreDisp=function(D)return D[1].." Waves "..D[2].." Lines"end,

View File

@@ -20,11 +20,12 @@ return{
drop=10,lock=30,
freshLimit=15,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
local D=P.modeData
D.counter=D.counter+1
if D.counter>=max(30,80-.3*D.event)then
P:garbageRise(11+D.event%3,1,rnd(10))
P.stat.recv=P.stat.recv+1
D.counter=0
D.event=D.event+1
end
@@ -38,7 +39,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.row}end,
scoreDisp=function(D)return D[1].." Waves "..D[2].." Lines"end,

View File

@@ -10,9 +10,9 @@ return{
"2P",
},
info={
"友尽模式(非联网/局域网)",
"友尽模式(非联网/局域网)",
"End of friendship",
"不是联网也不是局域网",
"不是联网也不是局域网",
"No network\nlocal game only",
},
color=color.white,
env={

View File

@@ -10,9 +10,9 @@ return{
"3P",
},
info={
"友尽模式(非联网/局域网)",
"友尽模式(非联网/局域网)",
"End of friendship",
"不是联网也不是局域网",
"不是联网也不是局域网",
"No network\nlocal game only",
},
color=color.white,
env={

View File

@@ -10,9 +10,9 @@ return{
"4P",
},
info={
"友尽模式(非联网/局域网)",
"友尽模式(非联网/局域网)",
"End of friendship",
"不是联网也不是局域网",
"不是联网也不是局域网",
"No network\nlocal game only",
},
color=color.white,
env={

View File

@@ -28,8 +28,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,260)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,370)
mDraw(drawableText.atk,-81,313)
mDraw(drawableText.eff,-81,425)
mText(drawableText.atk,-81,313)
mText(drawableText.eff,-81,425)
end,
score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return tostring(D[1])end,

View File

@@ -1,11 +1,8 @@
local format,rnd=string.format,math.random
local function check_rise(P)
local L=P.clearedRow
for i=1,#L do
if L[i]<6 then
P:garbageRise(10,1,rnd(10))
P.modeData.point=P.modeData.point+1
end
while P.garbageBeneath<6 do
P:garbageRise(10,1,rnd(10))
P.modeData.point=P.modeData.point+1
end
end
@@ -44,9 +41,9 @@ return{
mStr(P.modeData.point,-81,190)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.line,-81,243)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.line,-81,243)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.modeData.point}end,
scoreDisp=function(D)return D[1].." Lines"end,

View File

@@ -34,7 +34,7 @@ return{
env={
noFly=true,
mindas=7,minarr=1,minsdarr=1,
drop=.5,fall=30,
drop=.5,wait=8,fall=20,
target=50,dropPiece=check,
bg="strap",bgm="race",
},

View File

@@ -33,7 +33,7 @@ return{
env={
noFly=true,
minsdarr=1,
fall=30,
wait=8,fall=20,
target=10,dropPiece=check_LVup,
mindas=7,minarr=1,minsdarr=1,
bg="strap",bgm="way",

View File

@@ -16,7 +16,7 @@ local function score(P)
elseif P.modeData.point>=100*(P.modeData.event+1)then
local s=P.modeData.event+1;P.modeData.event=s--level up!
local E=P.gameEnv
curBG=s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5"
BG.set(s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5")
E.lock=death_lock[s]
E.wait=death_wait[s]
E.fall=death_fall[s]
@@ -78,7 +78,7 @@ return{
getRank=function(P)
local S=P.modeData.point
if S==500 then
local L=P.stat.clear_4
local L=P.stat.clear_S[4]
return
L>=30 and 5 or
L>=25 and 4 or

View File

@@ -15,7 +15,7 @@ local function score(P)
elseif P.modeData.point>=100*(P.modeData.event+1)then
local s=P.modeData.event+1;P.modeData.event=s--level up!
local E=P.gameEnv
curBG=s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4"
BG.set(s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4")
E.lock=rush_lock[s]
E.wait=rush_wait[s]
E.fall=rush_fall[s]
@@ -82,7 +82,7 @@ return{
getRank=function(P)
local S=P.modeData.point
if S==500 then
local L=P.stat.clear_4
local L=P.stat.clear_S[4]
return
L>=30 and 5 or
L>=25 and 4 or

View File

@@ -35,7 +35,7 @@ return{
setFont(75)
mStr(P.stat.pc,-81,350)
mDraw(drawableText.pc,-81,432)
mText(drawableText.pc,-81,432)
gc.setColor(.5,.5,.5)
if frame>179 then

View File

@@ -35,7 +35,7 @@ return{
setFont(75)
mStr(P.stat.pc,-81,350)
mDraw(drawableText.pc,-81,432)
mText(drawableText.pc,-81,432)
gc.setColor(.5,.5,.5)
if frame>179 then

View File

@@ -34,7 +34,7 @@ return{
setFont(75)
mStr(P.stat.pc,-81,350)
mDraw(drawableText.pc,-81,432)
mText(drawableText.pc,-81,432)
gc.setColor(.5,.5,.5)
if frame>179 then

View File

@@ -6,6 +6,7 @@ local pc_fall={18,16,14,12,10,9,8,7,6}
local PCbase=require("parts/PCbase")
local PClist=require("parts/PClist")
local function task_PC(P)
local _
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter==21 then
local t=P.stat.pc%2
@@ -13,7 +14,7 @@ local function task_PC(P)
for i=1,4 do
local r=freeRow.get(0)
for j=1,10 do
local _=PCbase[4*t+i][j]
_=PCbase[4*t+i][j]
r[j]=S[_]or 0
end
ins(P.field,1,r)
@@ -49,7 +50,7 @@ local function newPC(P)
P:getNext(b)
end
P.modeData.counter=P.stat.piece==0 and 20 or 0
newTask(task_PC,P)
TASK.new(task_PC,P)
local s=P.stat.pc*.5
if int(s)==s and s>0 then
P.gameEnv.drop=pc_drop[s]or 10
@@ -100,7 +101,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(75)
mStr(P.stat.pc,-81,330)
mDraw(drawableText.pc,-81,412)
mText(drawableText.pc,-81,412)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,

View File

@@ -3,6 +3,7 @@ local ins=table.insert
local PCbase=require("parts/PCbase")
local PClist=require("parts/PClist")
local function task_PC(P)
local _
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter==21 then
local t=P.stat.pc%2
@@ -10,7 +11,7 @@ local function task_PC(P)
for i=1,4 do
local r=freeRow.get(0)
for j=1,10 do
local _=PCbase[4*t+i][j]
_=PCbase[4*t+i][j]
r[j]=S[_]or 0
end
ins(P.field,1,r)
@@ -45,7 +46,7 @@ local function newPC(P)
P:getNext(b)
end
P.modeData.counter=P.stat.piece==0 and 20 or 0
newTask(task_PC,P)
TASK.new(task_PC,P)
end
end
return{
@@ -83,7 +84,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(75)
mStr(P.stat.pc,-81,330)
mDraw(drawableText.pc,-81,412)
mText(drawableText.pc,-81,412)
end,
score=function(P)return{P.stat.pc,P.stat.time}end,
scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end,

View File

@@ -46,7 +46,7 @@ return{
if P.result=="WIN"then
local T=P.stat.piece
return
T<=20 and 5 or
T<=23 and 5 or
T<=26 and 4 or
T<=40 and 3 or
T<=60 and 2 or

View File

@@ -20,7 +20,7 @@ return{
drop=30,lock=45,
freshLimit=10,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter>=max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then
P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1}
@@ -40,7 +40,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -20,16 +20,17 @@ return{
drop=30,lock=45,
freshLimit=10,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter>=max(60,180-2*P.modeData.event)and P.atkBuffer.sum<15 then
P.atkBuffer[#P.atkBuffer+1]=
local B=P.atkBuffer
if P.modeData.counter>=max(60,180-2*P.modeData.event)and B.sum<15 then
B[#B+1]=
P.modeData.event%3<2 and
{pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1}
or
{pos=rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2}
local R=(P.modeData.event%3<2 and 1 or 3)
P.atkBuffer.sum=P.atkBuffer.sum+R
B.sum=B.sum+R
P.stat.recv=P.stat.recv+R
if P.modeData.event==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end
P.modeData.counter=0
@@ -45,7 +46,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -20,7 +20,7 @@ return{
drop=30,lock=45,
freshLimit=10,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter>=max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then
local t=max(60,90-P.modeData.event)
@@ -41,7 +41,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -20,7 +20,7 @@ return{
drop=30,lock=45,
freshLimit=10,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter>=max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then
local d=P.modeData.event+1
@@ -45,7 +45,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -22,7 +22,7 @@ return{
freshLimit=15,
pushSpeed=2,
task=function(P)
if not(P.control and scene.cur=="play")then return end
if not(P.control and SCN.cur=="play")then return end
P.modeData.counter=P.modeData.counter+1
if P.modeData.counter>=max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then
local t=max(300,480-12*P.modeData.event)
@@ -47,7 +47,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(65)
mStr(P.modeData.event,-81,310)
mDraw(drawableText.wave,-81,375)
mText(drawableText.wave,-81,375)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -36,8 +36,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -39,8 +39,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -39,8 +39,8 @@ return{
setFont(45)
mStr(P.stat.atk,-81,310)
mStr(format("%.2f",P.stat.atk/P.stat.row),-81,420)
mDraw(drawableText.atk,-81,363)
mDraw(drawableText.eff,-81,475)
mText(drawableText.atk,-81,363)
mText(drawableText.eff,-81,475)
end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -83,7 +83,7 @@ return{
setFont(25)
gc.print(powerUp[P.strength],-132,290)
for i=1,P.strength do
gc.draw(badgeIcon,16*i-138,260)
gc.draw(IMG.badgeIcon,16*i-138,260)
end
end,
score=function(P)return{P.modeData.event,P.modeData.point}end,

View File

@@ -38,7 +38,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(75)
mStr(P.modeData.event,-81,330)
mDraw(drawableText.tsd,-81,407)
mText(drawableText.tsd,-81,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,

View File

@@ -39,7 +39,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(75)
mStr(P.modeData.event,-81,330)
mDraw(drawableText.tsd,-81,407)
mText(drawableText.tsd,-81,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,

View File

@@ -39,7 +39,7 @@ return{
mesDisp=function(P,dx,dy)
setFont(75)
mStr(P.modeData.event,-81,330)
mDraw(drawableText.tsd,-81,407)
mText(drawableText.tsd,-81,407)
end,
score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end,

346
paint.lua
View File

@@ -16,6 +16,9 @@ local modeRankColor={
color.lightCyan, --Rank5
color.purple, --Special
}
local rankString={
"C","B","A","S","SS",
}
local miniTitle_rect={
{2,0,5,1},{4,1,1,6},
{9,0,4,1},{9,3,4,1},{9,6,4,1},{8,0,1,7},
@@ -35,7 +38,6 @@ end
FX_attack={}--Attack beam
FX_badge={}--Badge thrown
sysFX={}
local function drawAtkPointer(x,y)
local t=sin(Timer()*20)
gc.setColor(.2,.7+t*.2,1,.6+t*.4)
@@ -61,6 +63,7 @@ end
local function drawVirtualkey()
local V=virtualkey
local a=setting.VKAlpha*.1
local _
if setting.VKIcon then
for i=1,#V do
if V[i].ava then
@@ -68,7 +71,7 @@ local function drawVirtualkey()
gc.setColor(1,1,1,a)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r)--Button outline
local _=V[i].pressTime
_=V[i].pressTime
gc.draw(VKIcon[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--icon
if _>0 then
gc.setColor(1,1,1,a*_*.08)
@@ -84,7 +87,7 @@ local function drawVirtualkey()
gc.setColor(1,1,1,a)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r)
local _=V[i].pressTime
_=V[i].pressTime
if _>0 then
gc.setColor(1,1,1,a*_*.08)
gc.circle("fill",B.x,B.y,B.r*.94)
@@ -95,107 +98,28 @@ local function drawVirtualkey()
end
end
local Pnt={BG={}}
function Pnt.BG.none()
gc.clear(.15,.15,.15)
end
function Pnt.BG.grey()
gc.clear(.3,.3,.3)
end
function Pnt.BG.glow()
local t=(sin(Timer()*.5)+sin(Timer()*.7)+sin(Timer()*.9+1)+sin(Timer()*1.5)+sin(Timer()*2+10))*.1
gc.clear(t,t,t)
end
function Pnt.BG.rgb()
gc.clear(
sin(Timer()*1.2)*.15+.2,
sin(Timer()*1.5)*.15+.2,
sin(Timer()*1.9)*.15+.2
)
end
function Pnt.BG.strap()
gc.setColor(.5,.5,.5)
local x=Timer()%16*-64
::L::
gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end
function Pnt.BG.flink()
local t=.13-Timer()%3%1.7
if t<.2 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
end
function Pnt.BG.game1()
gc.setColor(.5,.5,.5)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Rainbow
function Pnt.BG.game2()
gc.setColor(.5,.26,.26)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Red rainbow
function Pnt.BG.game3()
gc.setColor(.4,.4,.8)
gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Blue rainbow
function Pnt.BG.game4()
gc.setColor(.05,.4,.4)
local x=Timer()%8*-128
::L::
gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end--Fast strap
function Pnt.BG.game5()
local t=2.5-Timer()%20%6%2.5
if t<.3 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
end--Lightning
function Pnt.BG.game6()
local t=1.2-Timer()%10%3%1.2
if t<.3 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
local R=7-int(Timer()*.5)%7
local _=skin.libColor[setting.skin[R]]
gc.setColor(_[1],_[2],_[3],.1)
gc.draw(miniBlock[R],640,360,Timer()%3.1416*6,400,400,scs[R][0][2]-.5,#blocks[R][0]-scs[R][0][1]+.5)
end--Fast lightning&spining tetromino
local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function Pnt.BG.matrix()
gc.scale(scr.k)
gc.clear(.15,.15,.15)
local _=ceil(scr.h/80)
for i=1,ceil(scr.w/80)do
for j=1,_ do
gc.setColor(1,1,1,sin(matrixT[i][j]*Timer())*.1+.1)
gc.rectangle("fill",80*i,80*j,-80,-80)
end
end
gc.scale(1/scr.k)
end
local Pnt={}
function Pnt.load()
local L=sceneTemp
local S=sceneTemp
gc.setLineWidth(4)
gc.setColor(1,1,1,.5)
gc.rectangle("fill",300,330,L[2]/L[3]*680,60,5)
gc.rectangle("fill",300,330,S.cur/S.tar*680,60,5)
gc.setColor(1,1,1)
gc.rectangle("line",300,330,680,60,5)
setFont(35)
gc.print(text.load[L[1]],340,335)
if sceneTemp[1]~=0 then
gc.printf(sceneTemp[2].."/"..sceneTemp[3],795,335,150,"right")
gc.print(text.load[S.phase],340,335)
if S.phase~=0 then
gc.printf(S.cur.."/"..S.tar,795,335,150,"right")
end
setFont(25)
mStr(L[4],640,400)
mStr(S.tip,640,400)
end
function Pnt.intro()
local T=sceneTemp
gc.stencil(stencil_miniTitle,"replace",1)
gc.setStencilTest("equal",1)
gc.setColor(1,1,1,min(sceneTemp,80)*.005)
gc.setColor(1,1,1,min(T,80)*.005)
gc.push("transform")
gc.translate(250,150)
gc.scale(30)
@@ -204,19 +128,24 @@ function Pnt.intro()
gc.setColor(1,1,1,.06)
for i=41,5,-2 do
gc.setLineWidth(i)
gc.line(200+(sceneTemp-80)*25,130,(sceneTemp-80)*25,590)
gc.line(200+(T-80)*25,130,(T-80)*25,590)
end
gc.setStencilTest()
if T>=80 then
gc.setColor(1,1,1,.5+sin((T-95)/30*3.142)*.5)
mText(drawableText.anykey,640,615+sin(Timer()*3)*5)
end
end
function Pnt.main()
gc.setColor(1,1,1)
gc.draw(coloredTitleImage,60,30,nil,1.3)
gc.draw(IMG.coloredTitleImage,60,30,nil,1.3)
setFont(30)
gc.print(gameVersion,70,125)
gc.print(system,610,100)
players[1]:draw()
end
function Pnt.mode()
local _
local cam=mapCam
gc.push("transform")
gc.translate(640,360)
@@ -233,10 +162,8 @@ function Pnt.mode()
gc.setColor(1,1,1,.2)
for _=1,#M.unlock do
local m=M.unlock[_]
if R[m]then
m=MM[m]
gc.line(M.x,M.y,m.x,m.y)
end
m=MM[m]
gc.line(M.x,M.y,m.x,m.y)
end
local S=M.size
@@ -272,6 +199,15 @@ function Pnt.mode()
gc.circle("line",M.x,M.y,S,8)
end
end
_=drawableText[rankString[modeRanks[M.id]]]
if _ then
local dx,dy=6.26*sin(Timer()*1.26+M.id),12.6*sin(Timer()+M.id)
gc.setColor(0,0,0,.5)
mDraw(_,M.x+dx*1.5,M.y+dy*1.5)
gc.setColor(1,1,1,.8)
mDraw(_,M.x+dx,M.y+dy)
end
--[[
if M.icon then
local i=M.icon
local l=i:getWidth()*.5
@@ -284,6 +220,7 @@ function Pnt.mode()
gc.setColor(1,1,1)
gc.draw(i,M.x,M.y,nil,k,nil,l,l)
end
]]
end
end
gc.pop()
@@ -298,10 +235,10 @@ function Pnt.mode()
gc.setColor(1,1,1)
setFont(28)gc.printf(M.info[lang],920,110,360,"center")
if M.slowMark then
gc.draw(ctrlSpeedLimit,1230,50,nil,.4)
gc.draw(IMG.ctrlSpeedLimit,1230,50,nil,.4)
end
if M.score then
mDraw(drawableText.highScore,1100,240)
mText(drawableText.highScore,1100,240)
gc.setColor(.4,.4,.4,.8)
gc.rectangle("fill",940,290,320,280)--Highscore board
local L=M.records
@@ -318,11 +255,11 @@ function Pnt.mode()
setFont(int(26-s*.4))
gc.print(t,955,275+dy+25*i)
setFont(10)
local _=L[i].date
_=L[i].date
if _ then gc.print(_,1155,284+25*i)end
end
else
mDraw(drawableText.noScore,1100,370)
mText(drawableText.noScore,1100,370)
end
end
end
@@ -343,7 +280,7 @@ function Pnt.music()
for i=1,#musicID do
gc.print(musicID[i],50,90+30*i)
end
gc.draw(titleImage,640,310,nil,1.5,nil,206,35)
gc.draw(IMG.titleImage,640,310,nil,1.5,nil,206,35)
if BGM.nowPlay then
setFont(45)
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
@@ -351,7 +288,7 @@ function Pnt.music()
local t=-Timer()%2.3/2
if t<1 then
gc.setColor(1,1,1,t)
gc.draw(coloredTitleImage,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
gc.draw(IMG.coloredTitleImage,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
end
end
end
@@ -413,8 +350,9 @@ function Pnt.draw()
gc.draw(drawableText.question,1040,430)
end
setFont(40)
local _
for i=1,7 do
local _=setting.skin[i]
_=setting.skin[i]
gc.setColor(skin.libColor[_])
mStr(text.block[i],500+65*_,65)
end
@@ -453,12 +391,12 @@ function Pnt.play()
local b=FX_badge[i]
gc.setColor(1,1,1,b.t<10 and b.t*.1 or b.t<50 and 1 or(60-b.t)*.1)
if b.t<10 then
gc.draw(badgeIcon,b[1]-14,b[2]-14)
gc.draw(IMG.badgeIcon,b[1]-14,b[2]-14)
elseif b.t<50 then
local t=((b.t-10)*.025)t=(3-2*t)*t*t
gc.draw(badgeIcon,b[1]*(1-t)+b[3]*t-14,b[2]*(1-t)+b[4]*t-14)
gc.draw(IMG.badgeIcon,b[1]*(1-t)+b[3]*t-14,b[2]*(1-t)+b[4]*t-14)
else
gc.draw(badgeIcon,b[3]-14,b[4]-14)
gc.draw(IMG.badgeIcon,b[3]-14,b[4]-14)
end
end
local P=players[1]
@@ -487,58 +425,111 @@ function Pnt.play()
end
function Pnt.pause()
Pnt.play()
local T=sceneTemp.timer*.02
local t=T
if gameResult then t=t*.6 end
gc.setColor(.15,.15,.15,t)
local S=sceneTemp
local T=S.timer*.02
--Dark BG
local _=T
if gameResult then _=_*.6 end
gc.setColor(.15,.15,.15,_)
gc.push("transform")
gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.pop()
--Pause Info
setFont(25)
if pauseCount>0 then
gc.setColor(1,.4,.4,T)
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%.2f",pauseTime).."s",110,150)
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%.2f",pauseTime).."s",70,100)
end
gc.setColor(1,1,1,T)
for i=1,7 do
gc.print(text.pauseStat[i],95,30*i+310)
gc.print(sceneTemp[i],305,30*i+310)
end
for i=8,14 do
gc.print(text.pauseStat[i],845,30*i+100)
gc.print(sceneTemp[i],1050,30*i+100)
end
--Mode Info
_=drawableText.modeName
gc.draw(_,100,230)
gc.draw(drawableText.levelName,135+_:getWidth(),230)
gc.draw(_,70,180)
gc.draw(drawableText.levelName,90+_:getWidth(),180)
--Result Text
setFont(35)
mDraw(gameResult and drawableText[gameResult]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
mText(gameResult and drawableText[gameResult]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
--Infos
if frame>180 then
_=S.list
setFont(26)
for i=1,8 do
gc.print(text.pauseStat[i],70,210+40*i)
gc.printf(_[i],245,210+40*i,250,"right")
end
end
--Radar Chart
if T>.5 and frame>180 then
T=T*2-1
gc.setLineWidth(2)
gc.push("transform")
gc.translate(1026,400)
gc.scale((3-2*T)*T)
local C=S.color1;C[4]=T;gc.setColor(C)gc.polygon("fill",S.V1)
C=S.color2;C[4]=T;gc.setColor(C)gc.polygon("fill",S.V2)
gc.setColor(1,1,1,T*(.5+.5*sin(Timer()*12.626)))
gc.polygon("line",S.standard)
gc.setColor(1,1,1,T)
gc.line(S.V1)gc.line(S.V2)
gc.pop()
gc.line(1026,400-160,1026,400+160)
gc.line(1026-160,400,1026+160,400)
_=Timer()%6.2832
if _>3.1416 then
_=_-3.1416
setFont(35)
gc.setColor(1,1,1,T*sin(_))
mStr(text.atk,1026,420-230)
mStr(text.spd,1026+180,340)
mStr(text.recv,1026,420+140)
mStr(text.eff,1026-180,340)
else
gc.setColor(1,1,1,T*sin(_))
_=S.radar1
setFont(23)
mStr(_[1],1026,420-215)
mStr(_[2],1026+180,340)
mStr(_[3],1026,420+140)
mStr(_[4],1026-180,340)
end
end
end
function Pnt.setting_game()
gc.setColor(1,1,1)
mDraw(drawableText.setting_game,640,15)
mText(drawableText.setting_game,640,15)
gc.draw(blockSkin[int(Timer()*2)%11+1],720,540,Timer()%6.28319,2,nil,15,15)
end
function Pnt.setting_graphic()
gc.setColor(1,1,1)
mDraw(drawableText.setting_graphic,640,15)
mText(drawableText.setting_graphic,640,15)
end
function Pnt.setting_sound()
gc.setColor(1,1,1,.8)
mDraw(drawableText.setting_sound,640,15)
mText(drawableText.setting_sound,640,15)
local t=Timer()
local _=sceneTemp.jump
local x,y=800,340+10*sin(t*.5)+(_-10)*_*.3
gc.translate(x,y)
gc.draw(miya.ch,0,0)
gc.draw(IMG.miyaCH,0,0)
gc.setColor(1,1,1,.7)
gc.draw(miya.f1,4,47+4*sin(t*.9))
gc.draw(miya.f2,42,107+5*sin(t))
gc.draw(miya.f3,93,126+3*sin(t*.7))
gc.draw(miya.f4,129,98+3*sin(t*.7))
gc.draw(IMG.miyaF1,4,47+4*sin(t*.9))
gc.draw(IMG.miyaF2,42,107+5*sin(t))
gc.draw(IMG.miyaF3,93,126+3*sin(t*.7))
gc.draw(IMG.miyaF4,129,98+3*sin(t*.7))
gc.translate(-x,-y)
end
local function timeConv(t)
return t.."F "..int(t*16.67).."ms"
end
function Pnt.setting_control()
--Testing grid line
gc.setLineWidth(4)
@@ -561,10 +552,10 @@ function Pnt.setting_control()
--Floating number
setFont(30)
local _=setting
mStr(_.das,226+35*_.das,145)
mStr(_.arr,226+35*_.arr,235)
mStr(_.sddas,226+35*_.sddas,325)
mStr(_.sdarr,226+35*_.sdarr,415)
mStr(timeConv(_.das),226+35*_.das,145)
mStr(timeConv(_.arr),226+35*_.arr,235)
mStr(timeConv(_.sddas),226+35*_.sddas,325)
mStr(timeConv(_.sdarr),226+35*_.sdarr,415)
--Testing O mino
_=blockSkin[setting.skin[6]]
@@ -592,11 +583,11 @@ function Pnt.setting_key()
--Selection rect
gc.setColor(1,.3,.3)
mDraw(drawableText.keyboard,340,30)
mDraw(drawableText.keyboard,940,30)
mText(drawableText.keyboard,340,30)
mText(drawableText.keyboard,940,30)
gc.setColor(.3,.3,1)
mDraw(drawableText.joystick,540,30)
mDraw(drawableText.joystick,1140,30)
mText(drawableText.joystick,540,30)
mText(drawableText.joystick,1140,30)
gc.setColor(1,1,1)
setFont(26)
@@ -663,38 +654,73 @@ function Pnt.setting_touch()
end
function Pnt.setting_trackSetting()
gc.setColor(1,1,1)
mDraw(drawableText.VKTchW,140+50*setting.VKTchW,260)
mDraw(drawableText.VKOrgW,140+50*setting.VKTchW+50*setting.VKCurW,320)
mDraw(drawableText.VKCurW,640+50*setting.VKCurW,380)
mText(drawableText.VKTchW,140+50*setting.VKTchW,260)
mText(drawableText.VKOrgW,140+50*setting.VKTchW+50*setting.VKCurW,320)
mText(drawableText.VKCurW,640+50*setting.VKCurW,380)
end
function Pnt.help()
setFont(22)
setFont(20)
gc.setColor(1,1,1)
for i=1,#text.help do
gc.printf(text.help[i],200,30*i-10,1000,"center")
gc.printf(text.help[i],150,30*i-10,1000,"center")
end
setFont(19)
gc.print(text.used,30,330)
gc.draw(titleImage,280,610,.1,1+.05*sin(Timer()*2),nil,206,35)
gc.setLineWidth(5)
gc.rectangle("line",17,17,260,260)
gc.rectangle("line",1077,17,186,186)
gc.draw(payCode,20,20)
gc.draw(groupCode,1080,20)
gc.setColor(1,1,1,sin(Timer()*10)*.5+.5)
setFont(30)
mStr(text.support,150,283)
gc.draw(IMG.titleImage,280,610,.1,1+.05*sin(Timer()*2),nil,206,35)
gc.setLineWidth(3)
gc.rectangle("line",18,18,263,263)
gc.rectangle("line",1012,18,250,250)
gc.draw(IMG.pay1,20,20)
gc.draw(IMG.pay2,1014,20)
setFont(20)
mStr(text.group,1170,210)
mStr(text.group,640,490)
gc.setColor(1,1,1,sin(Timer()*10)*.4+.6)
setFont(30)
gc.print(text.support,150,283+20,sin(Timer()*2.6)*.02,nil,nil,115,20)
gc.print(text.support,1138,270+20,sin(Timer()*2.83)*.02,nil,nil,115,20)
end
function Pnt.stat()
setFont(23)
gc.setColor(1,1,1)
for i=1,16 do
gc.print(text.stat[i],400,30*i+10)
gc.print(sceneTemp[i],720,30*i+10)
local chart=sceneTemp.chart
setFont(24)
local _,__=skin.libColor,setting.skin
local A,B=chart.A1,chart.A2
for x=1,7 do
gc.setColor(_[__[x]])
mStr(text.block[x],80*x,40)
mStr(text.block[x],80*x,280)
for y=1,4 do
mStr(A[x][y],80*x,40+40*y)
mStr(B[x][y],80*x,280+40*y)
end
mStr(chart.Y1[x],80*x,240)
mStr(chart.Y2[x],80*x,480)
end
gc.draw(titleImage,260,570,.2+.07*sin(Timer()*3),nil,nil,206,35)
gc.setColor(1,1,1)
A,B=chart.X1,chart.X2
mStr(text.stat.spin,650,45)
mStr(text.stat.clear,650,285)
for y=1,4 do
mStr(A[y],650,40+40*y)
mStr(B[y],650,280+40*y)
end
setFont(22)
for i=1,11 do
gc.print(sceneTemp.item[i],740,40*i+10)
end
gc.setLineWidth(4)
for x=1,8 do
x=80*x-40
gc.line(x,80,x,240)
gc.line(x,320,x,480)
end
for y=2,6 do
gc.line(40,40*y,600,40*y)
gc.line(40,240+40*y,600,240+40*y)
end
gc.draw(IMG.titleImage,260,615,.2+.04*sin(Timer()*3),nil,nil,206,35)
end
function Pnt.history()
gc.setColor(.2,.2,.2,.7)

240
parts/bg.lua Normal file
View File

@@ -0,0 +1,240 @@
local gc=love.graphics
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local scr=scr
local BGinit,BGresize,BGupdate,BGdraw,BGdiscard={},{},{},{},{}
local BGvars={_G=_G}
function BGdraw.none()
gc.clear(.15,.15,.15)
end
function BGdraw.grey()
gc.clear(.3,.3,.3)
end
function BGinit.glow()
t=0
end
function BGupdate.glow(dt)
t=t+dt
end
function BGdraw.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
function BGinit.rgb()
t=0
end
function BGupdate.rgb(dt)
t=t+dt
end
function BGdraw.rgb()
gc.clear(
sin(t*1.2)*.15+.2,
sin(t*1.5)*.15+.2,
sin(t*1.9)*.15+.2
)
end
function BGinit.strap()
t=0
img=_G.IMG.gameBG2
end
function BGupdate.strap(dt)
t=t+dt
end
function BGdraw.strap()
gc.setColor(.5,.5,.5)
local x=t%16*-64
::L::
gc.draw(img,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end
function BGinit.flink()
t=0
end
function BGupdate.flink(dt)
t=t+dt
end
function BGdraw.flink()
local t=.13-t%3%1.7
if t<.2 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
end
function BGinit.game1()
t=0
img=_G.IMG.gameBG1
end
function BGupdate.game1(dt)
t=t+dt
end
function BGdraw.game1()
gc.setColor(.5,.5,.5)
gc.draw(img,scr.w*.5,scr.h*.5,t*.15,scr.rad*.0625,nil,16,16)
end--Rainbow
function BGinit.game2()
t=0
img=_G.IMG.gameBG1
end
function BGupdate.game2(dt)
t=t+dt
end
function BGdraw.game2()
gc.setColor(.5,.26,.26)
gc.draw(img,scr.w*.5,scr.h*.5,t*.15,scr.rad*.0625,nil,16,16)
end--Red rainbow
function BGinit.game3()
t=0
img=_G.IMG.gameBG1
end
function BGupdate.game3(dt)
t=t+dt
end
function BGdraw.game3()
gc.setColor(.4,.4,.8)
gc.draw(img,scr.w*.5,scr.h*.5,t*.15,scr.rad*.0625,nil,16,16)
end--Blue rainbow
function BGinit.game4()
t=0
img=_G.IMG.gameBG2
end
function BGupdate.game4(dt)
t=t+dt
end
function BGdraw.game4()
gc.setColor(.05,.4,.4)
local x=t%8*-128
::L::
gc.draw(img,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end--Fast strap
function BGinit.game5()
t=0
end
function BGupdate.game5(dt)
t=t+dt
end
function BGdraw.game5()
local t=2.5-t%20%6%2.5
if t<.3 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
end--Lightning
function BGinit.game6()
t=0
colorLib=_G.skin.libColor
colorSet=_G.setting.skin
miniBlock=_G.miniBlock
end
function BGupdate.game6(dt)
t=t+dt
end
local blocks=require("parts/mino")
local scs=require("parts/spinCenters")
function BGdraw.game6()
local t=1.2-t%10%3%1.2
if t<.3 then gc.clear(t,t,t)
else gc.clear(0,0,0)
end
local R=7-int(t*.5)%7
local _=colorLib[colorSet[R]]
gc.setColor(_[1],_[2],_[3],.1)
gc.draw(miniBlock[R],640,360,t%3.1416*6,400,400,scs[R][0][2]-.5,#blocks[R][0]-scs[R][0][1]+.5)
end--Fast lightning&spining tetromino
local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function BGinit.matrix()
t=0
end
function BGupdate.matrix(dt)
t=t+dt
end
function BGdraw.matrix()
gc.scale(scr.k)
gc.clear(.15,.15,.15)
local _=ceil(scr.h/80)
for i=1,ceil(scr.w/80)do
for j=1,_ do
gc.setColor(1,1,1,sin(matrixT[i][j]*t)*.1+.1)
gc.rectangle("fill",80*i,80*j,-80,-80)
end
end
gc.scale(1/scr.k)
end
function BGinit.space()
stars={}
for i=1,2600,5 do
local s=0.75*2^(rnd()*1.5)
stars[i]=s --size
stars[i+1]=rnd(W) --x
stars[i+2]=rnd(H) --y
stars[i+3]=(rnd()-.5)*.01*s --vx
stars[i+4]=(rnd()-.5)*.01*s --vy
end--800 var
end
function BGresize.space(w,h)
W,H=w+100,h+100
end
function BGupdate.space(dt)
for i=1,2600,5 do
stars[i+1]=(stars[i+1]+stars[i+3])%W
stars[i+2]=(stars[i+2]+stars[i+4])%H
end--star moving
end
function BGdraw.space()
gc.clear(.2,.2,.2)
if not stars[1]then return end
gc.translate(-50,-50)
gc.setColor(.8,.8,.8)
for i=1,2600,5 do
local x,y=stars[i+1],stars[i+2]
gc.circle("fill",x,y,stars[i])
end
gc.translate(50,50)
end
function BGdiscard.space()
stars={}
end
for k in next,BGdraw do
if BGinit[k]then setfenv(BGinit[k], BGvars)end
if BGresize[k]then setfenv(BGresize[k], BGvars)end
if BGupdate[k]then setfenv(BGupdate[k], BGvars)end
if BGdraw[k]then setfenv(BGdraw[k], BGvars)end
if BGdiscard[k]then setfenv(BGdiscard[k], BGvars)end
end
local BG={
cur="none",
resize=NULL,
update=NULL,
draw=BGdraw.none,
}
function BG.set(bg)
if bg==BG.cur or not setting.bg then return end
BG.cur=bg
local _=BGdiscard[BG.cur]if _ then _()collectgarbage()end
BG.resize=BGresize[bg]or NULL;BG.resize(scr.w,scr.h)
_=BGinit[bg]if _ then _()end
BG.update=BGupdate[bg]or NULL
BG.draw=BGdraw[bg]
end
return BG

View File

@@ -1,27 +1,13 @@
local rem=table.remove
local BGM={}
BGM.nowPlay=nil
BGM.playing=nil--last loaded source
BGM.playingID=nil--last loaded ID
-- BGM.nowPlay=[str:playing ID]
-- BGM.playing=[src:playing SRC]
BGM.list={
"blank",
"way",
"race",
"newera",
"push",
"reason",
"infinite",
"cruelty",
"final",
"secret7th",
"secret8th",
"rockblock",
"8-bit happiness",
"shining terminal",
"oxygen",
"distortion",
"end",
"blank","way","newera","infinite","reason",
"race","push","secret7th","secret8th",
"rockblock","cruelty","final","8-bit happiness","end",
"shining terminal","oxygen","distortion",
}
function BGM.loadOne(_)
_,BGM.list[_]=BGM.list[_]
@@ -37,20 +23,12 @@ end
function BGM.play(s)
if setting.bgm==0 or not s then return end
if BGM.nowPlay~=s then
if BGM.nowPlay then newTask(Event_task.bgmFadeOut,nil,BGM.nowPlay)end
for i=#Task,1,-1 do
local T=Task[i]
if T.code==Event_task.bgmFadeIn then
T.code=Event_task.bgmFadeOut
elseif T.code==Event_task.bgmFadeOut and T.data==s then
rem(Task,i)
end
end
if s then
BGM.playingID=s
end
BGM.nowPlay=s
newTask(Event_task.bgmFadeIn,nil,s)
if BGM.nowPlay then TASK.new(tickEvent.bgmFadeOut,nil,BGM.nowPlay)end
TASK.changeCode(tickEvent.bgmFadeIn,tickEvent.bgmFadeOut)
TASK.removeTask_data(s)
BGM.nowPlay,BGM.suspend=s
TASK.new(tickEvent.bgmFadeIn,nil,s)
BGM.playing=BGM.list[s]
BGM.playing:play()
end
@@ -60,29 +38,22 @@ function BGM.freshVolume()
local v=setting.bgm*.1
if v>0 then
BGM.playing:setVolume(v)
if not BGM.nowPlay then
if BGM.suspend then
BGM.playing:play()
BGM.nowPlay=BGM.playingID
BGM.nowPlay,BGM.suspend=BGM.suspend
end
else
BGM.playing:pause()
BGM.playing:setVolume(0)
BGM.nowPlay=nil
BGM.playing:pause()
BGM.suspend,BGM.nowPlay=BGM.nowPlay
end
end
end
function BGM.stop()
if BGM.nowPlay then
for i=1,#Task do
local T=Task[i]
if T.code==Event_task.bgmFadeIn and T.data==BGM.nowPlay then
T.code=Event_task.bgmFadeOut
goto L
end
end
BGM.list[BGM.nowPlay]:stop()
::L::
BGM.nowPlay=nil
TASK.new(tickEvent.bgmFadeOut,nil,BGM.nowPlay)
end
TASK.changeCode(tickEvent.bgmFadeIn,tickEvent.bgmFadeOut)
BGM.playing,BGM.nowPlay=nil
end
return BGM

View File

@@ -33,10 +33,12 @@ if setting.lang==1 then
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"按键/点击以全力加载,跳过动画",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"按键/点击以强制满速加载",
"LrL,RlR LLr,RRl RRR,LLL RfR,RRf,rFF FFF",--ZSLJTOI
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
"Techmino 好玩!",
"Techminohaowan",
}
elseif setting.lang==2 then
L={
@@ -72,10 +74,12 @@ elseif setting.lang==2 then
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"按键/点击以全力加载,跳过动画",
"LrL,RlR LLr,RRl RRR/LLL F!!",
"按键/点击以强制满速加载",
"LrL,RlR LLr,RRl RRR,LLL RfR,RRf,rFF FFF",--ZSLJTOI
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
"Techmino 好玩!",
"Techminohaowan",
}
elseif setting.lang==3 then
L={
@@ -112,10 +116,11 @@ elseif setting.lang==3 then
"CLASSIC SEXY RUSSIAN BLOCKS",
"Headphones for better experience",
"少女祈禱中",
"any-key/click to skip loading animation",
"any-key/click to load at fastest speed",
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
"LrL,RlR LLr,RRl RRR/LLL F!!",
"LrL,RlR LLr,RRl RRR,LLL RfR,RRf,rFF FFF",--ZSLJTOI
"Techmino is so fun!",
}
end
return L[math.random(#L)]

40
parts/img.lua Normal file
View File

@@ -0,0 +1,40 @@
local IMG={
titleImage="mess/title.png",
coloredTitleImage="mess/title_colored.png",
dialCircle="mess/dialCircle.png",
dialNeedle="mess/dialNeedle.png",
badgeIcon="mess/badge.png",
spinCenter="mess/spinCenter.png",
ctrlSpeedLimit="mess/ctrlSpeedLimit.png",
speedLimit="mess/speedLimit.png",
pay1="mess/pay1.png",
pay2="mess/pay2.png",
miyaCH="miya/ch.png",
miyaF1="miya/f1.png",
miyaF2="miya/f2.png",
miyaF3="miya/f3.png",
miyaF4="miya/f4.png",
gameBG1="BG/bg1.png",
gameBG2="BG/bg2.png",
}
local list={}
local count=0
for k,v in next,IMG do
count=count+1
list[count]=k
end
function IMG.getCount()
return count
end
function IMG.loadOne(_)
local N=list[_]
IMG[N]=love.graphics.newImage("/image/"..IMG[N])
end
function IMG.loadAll()
for i=1,count do
IMG.loadOne(i)
end
end
return IMG

View File

@@ -43,7 +43,7 @@ local TRS={
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
[21]={{0,0},{-1,0}, {-1,-1},{-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={{0,0},{-1,0}, {-1,-1},{-1,1}, {1,0}, {0,2}, {-1,2} },
[32]={{0,0},{-1,0}, {-1,-1},{-1,1}, {1,0}, {0,-1}, {0,2}, {-1,2} },
[23]={{0,0},{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
[02]={{0,0},{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={{0,0},{-1,0}, {1,0}, {0,1}, {0,-1} },
@@ -55,7 +55,7 @@ local TRS={
[10]={{0,0},{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={{0,0},{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1}, {0,1} },
[30]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
[12]={{0,0},{1,0}, {1,-1}, {1,1}, {-1,0}, {0,2}, {1,2} },
[12]={{0,0},{1,0}, {1,-1}, {1,1}, {-1,0}, {0,-1}, {0,2}, {1,2} },
[21]={{0,0},{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
[32]={{0,0},{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
[23]={{0,0},{1,0}, {1,-1}, {1,1}, {0,-2}, {1,-2}, {1,-1} },

View File

@@ -14,76 +14,76 @@ modes={
{"solo_3", id=13, x=-700, y=-1000, size=35,shape=1,icon="solo", unlock={14,16}},
{"solo_4", id=14, x=-900, y=-1000, size=35,shape=1,icon="solo", unlock={15}},
{"solo_5", id=15, x=-1100, y=-1000, size=35,shape=1,icon="solo", unlock={}},
{"techmino49_easy", id=16, x=-900, y=-1200, size=35,shape=1,icon="", unlock={17,19}},
{"techmino49_hard", id=17, x=-900, y=-1400, size=35,shape=1,icon="", unlock={18}},
{"techmino49_ultimate", id=18, x=-900, y=-1600, size=35,shape=1,icon="", unlock={}},
{"techmino49_easy", id=16, x=-900, y=-1200, size=35,shape=1,icon="royale", unlock={17,19}},
{"techmino49_hard", id=17, x=-900, y=-1400, size=35,shape=1,icon="royale", unlock={18}},
{"techmino49_ultimate", id=18, x=-900, y=-1600, size=35,shape=1,icon="royale", unlock={}},
{"techmino99_easy", id=19, x=-1100, y=-1400, size=35,shape=1,icon="", unlock={20}},
{"techmino99_hard", id=20, x=-1100, y=-1600, size=35,shape=1,icon="", unlock={21}},
{"techmino99_ultimate", id=21, x=-1100, y=-1800, size=35,shape=1,icon="", unlock={}},
{"techmino99_easy", id=19, x=-1100, y=-1400, size=35,shape=1,icon="royale", unlock={20}},
{"techmino99_hard", id=20, x=-1100, y=-1600, size=35,shape=1,icon="royale", unlock={21}},
{"techmino99_ultimate", id=21, x=-1100, y=-1800, size=35,shape=1,icon="royale", unlock={}},
{"round_1", id=22, x=-300, y=-800, size=35,shape=1,icon="round", unlock={23}},
{"round_2", id=23, x=-500, y=-800, size=35,shape=1,icon="round", unlock={24}},
{"round_3", id=24, x=-700, y=-800, size=35,shape=1,icon="round", unlock={25}},
{"round_4", id=25, x=-900, y=-800, size=35,shape=1,icon="round", unlock={26}},
{"round_5", id=26, x=-1100, y=-800, size=35,shape=1,icon="round", unlock={}},
{"master_beginner", id=27, x=0, y=-1000, size=35,shape=1,icon="", unlock={28}},
{"master_adavnce", id=28, x=0, y=-1200, size=35,shape=1,icon="", unlock={29,30}},
{"master_final", id=29, x=0, y=-1400, size=35,shape=1,icon="", unlock={}},
{"GM", id=30, x=150, y=-1500, size=35,shape=1,icon="", unlock={}},
{"master_beginner", id=27, x=0, y=-1000, size=35,shape=1,icon="master", unlock={28}},
{"master_adavnce", id=28, x=0, y=-1200, size=35,shape=1,icon="master", unlock={29,30}},
{"master_final", id=29, x=0, y=-1400, size=40,shape=2,icon="master", unlock={}},
{"GM", id=30, x=150, y=-1500, size=35,shape=1,icon="master", unlock={}},
{"blind_easy", id=31, x=150, y=-700, size=35,shape=1,icon="", unlock={32}},
{"blind_normal", id=32, x=150, y=-800, size=35,shape=1,icon="", unlock={33}},
{"blind_hard", id=33, x=150, y=-900, size=35,shape=1,icon="", unlock={34}},
{"blind_lunatic", id=34, x=150, y=-1000, size=35,shape=1,icon="", unlock={35}},
{"blind_ultimate", id=35, x=150, y=-1100, size=35,shape=1,icon="", unlock={}},
{"blind_easy", id=31, x=150, y=-700, size=35,shape=1,icon="blind", unlock={32}},
{"blind_normal", id=32, x=150, y=-800, size=35,shape=1,icon="blind", unlock={33}},
{"blind_hard", id=33, x=150, y=-900, size=35,shape=1,icon="blind", unlock={34}},
{"blind_lunatic", id=34, x=150, y=-1000, size=35,shape=1,icon="blind", unlock={35}},
{"blind_ultimate", id=35, x=150, y=-1100, size=35,shape=1,icon="blind", unlock={}},
{"classic_fast", id=36, x=-300, y=-1200, size=35,shape=2,icon="classic", unlock={}},
{"classic_fast", id=36, x=-300, y=-1200, size=40,shape=2,icon="classic", unlock={}},
{"survivor_easy", id=37, x=300, y=-600, size=35,shape=1,icon="", unlock={38}},
{"survivor_normal", id=38, x=500, y=-600, size=35,shape=1,icon="", unlock={39,42,44,46}},
{"survivor_hard", id=39, x=700, y=-600, size=35,shape=1,icon="", unlock={40}},
{"survivor_lunatic", id=40, x=900, y=-600, size=35,shape=1,icon="", unlock={41}},
{"survivor_ultimate", id=41, x=1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"attacker_hard", id=42, x=300, y=-800, size=35,shape=1,icon="", unlock={43}},
{"attacker_ultimate", id=43, x=300, y=-1000, size=35,shape=1,icon="", unlock={}},
{"survivor_easy", id=37, x=300, y=-600, size=35,shape=1,icon="survivor",unlock={38}},
{"survivor_normal", id=38, x=500, y=-600, size=35,shape=1,icon="survivor",unlock={39,42,44,46}},
{"survivor_hard", id=39, x=700, y=-600, size=35,shape=1,icon="survivor",unlock={40}},
{"survivor_lunatic", id=40, x=900, y=-600, size=35,shape=1,icon="survivor",unlock={41}},
{"survivor_ultimate", id=41, x=1100, y=-600, size=35,shape=1,icon="survivor",unlock={}},
{"attacker_hard", id=42, x=300, y=-800, size=35,shape=1,icon="attacker",unlock={43}},
{"attacker_ultimate", id=43, x=300, y=-1000, size=35,shape=1,icon="attacker",unlock={}},
{"defender_normal", id=44, x=500, y=-800, size=35,shape=1,icon="", unlock={45}},
{"defender_lunatic", id=45, x=500, y=-1000, size=35,shape=1,icon="", unlock={}},
{"defender_normal", id=44, x=500, y=-800, size=35,shape=1,icon="defender",unlock={45}},
{"defender_lunatic", id=45, x=500, y=-1000, size=35,shape=1,icon="defender",unlock={}},
{"dig_hard", id=46, x=700, y=-800, size=35,shape=1,icon="", unlock={47}},
{"dig_ultimate", id=47, x=700, y=-1000, size=35,shape=1,icon="", unlock={}},
{"dig_hard", id=46, x=700, y=-800, size=35,shape=1,icon="dig", unlock={47}},
{"dig_ultimate", id=47, x=700, y=-1000, size=35,shape=1,icon="dig", unlock={}},
{"bigbang", id=48, x=400, y=-400, size=55,shape=1,icon="", unlock={49,51,56}},
{"c4wtrain_normal", id=49, x=700, y=-400, size=35,shape=1,icon="", unlock={50}},
{"c4wtrain_lunatic", id=50, x=900, y=-400, size=35,shape=1,icon="", unlock={}},
{"bigbang", id=48, x=400, y=-400, size=55,shape=1,icon="bigbang", unlock={49,51,56}},
{"c4wtrain_normal", id=49, x=700, y=-400, size=35,shape=1,icon="c4wtrain",unlock={50}},
{"c4wtrain_lunatic", id=50, x=900, y=-400, size=35,shape=1,icon="c4wtrain",unlock={}},
{"pctrain_normal", id=51, x=700, y=-200, size=35,shape=1,icon="", unlock={52,53}},
{"pctrain_lunatic", id=52, x=900, y=-200, size=35,shape=1,icon="", unlock={}},
{"pcchallenge_normal", id=53, x=800, y=-100, size=35,shape=1,icon="", unlock={54}},
{"pcchallenge_hard", id=54, x=1000, y=-100, size=35,shape=1,icon="", unlock={55}},
{"pcchallenge_lunatic", id=55, x=1200, y=-100, size=35,shape=1,icon="", unlock={}},
{"tech_normal", id=56, x=400, y=-100, size=35,shape=1,icon="", unlock={57,58}},
{"tech_normal+", id=57, x=650, y=150, size=35,shape=1,icon="", unlock={64}},
{"tech_hard", id=58, x=400, y=50, size=35,shape=1,icon="", unlock={59,60}},
{"tech_hard+", id=59, x=250, y=50, size=35,shape=1,icon="", unlock={}},
{"tech_lunatic", id=60, x=400, y=200, size=35,shape=1,icon="", unlock={61,62}},
{"tech_lunatic+", id=61, x=250, y=200, size=35,shape=1,icon="", unlock={}},
{"tech_ultimate", id=62, x=400, y=350, size=35,shape=1,icon="", unlock={63}},
{"tech_ultimate+", id=63, x=250, y=350, size=35,shape=1,icon="", unlock={}},
{"tsd_easy", id=64, x=800, y=200, size=35,shape=1,icon="", unlock={65}},
{"tsd_hard", id=65, x=1000, y=200, size=35,shape=1,icon="", unlock={66}},
{"tsd_ultimate", id=66, x=1200, y=200, size=35,shape=1,icon="", unlock={}},
{"pctrain_normal", id=51, x=700, y=-200, size=35,shape=1,icon="pctrain", unlock={52,53}},
{"pctrain_lunatic", id=52, x=900, y=-200, size=35,shape=1,icon="pctrain", unlock={}},
{"pcchallenge_normal", id=53, x=800, y=-100, size=35,shape=1,icon="pcchallenge",unlock={54}},
{"pcchallenge_hard", id=54, x=1000, y=-100, size=35,shape=1,icon="pcchallenge",unlock={55}},
{"pcchallenge_lunatic", id=55, x=1200, y=-100, size=35,shape=1,icon="pcchallenge",unlock={}},
{"tech_normal", id=56, x=400, y=-100, size=35,shape=1,icon="tech", unlock={57,58}},
{"tech_normal+", id=57, x=650, y=150, size=35,shape=1,icon="tech", unlock={64}},
{"tech_hard", id=58, x=400, y=50, size=35,shape=1,icon="tech", unlock={59,60}},
{"tech_hard+", id=59, x=250, y=50, size=35,shape=1,icon="tech", unlock={}},
{"tech_lunatic", id=60, x=400, y=200, size=35,shape=1,icon="tech", unlock={61,62}},
{"tech_lunatic+", id=61, x=250, y=200, size=35,shape=1,icon="tech", unlock={}},
{"tech_ultimate", id=62, x=400, y=350, size=35,shape=1,icon="tech", unlock={63}},
{"tech_ultimate+", id=63, x=250, y=350, size=35,shape=1,icon="tech", unlock={}},
{"tsd_easy", id=64, x=800, y=200, size=35,shape=1,icon="tsd", unlock={65}},
{"tsd_hard", id=65, x=1000, y=200, size=35,shape=1,icon="tsd", unlock={66}},
{"tsd_ultimate", id=66, x=1200, y=200, size=35,shape=1,icon="tsd", unlock={}},
{"zen", id=67, x=-900, y=-600, size=35,shape=1,icon="zen", unlock={68,69,70}},
{"ultra", id=68, x=-1100, y=-400, size=35,shape=1,icon="", unlock={}},
{"infinite", id=69, x=-900, y=-400, size=35,shape=1,icon="", unlock={}},
{"infinite_dig", id=70, x=-1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"ultra", id=68, x=-1100, y=-400, size=35,shape=1,icon="ultra", unlock={}},
{"infinite", id=69, x=-900, y=-400, size=35,shape=1,icon="infinite",unlock={}},
{"infinite_dig", id=70, x=-1100, y=-600, size=35,shape=1,icon="infinite_dig",unlock={}},
{"custom_clear", id=71, x=200, y=-350, size=45,shape=3,icon="custom", unlock={}},
{"custom_puzzle", id=72, x=200, y=-200, size=45,shape=3,icon="puzzle", unlock={}},
{"hotseat_2P", id=73, x=-300, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_3P", id=74, x=-450, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_4P", id=75, x=-600, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_2P", id=73, x=-300, y=200, size=45,shape=3,icon="hotseat", unlock={}},
{"hotseat_3P", id=74, x=-450, y=200, size=45,shape=3,icon="hotseat", unlock={}},
{"hotseat_4P", id=75, x=-600, y=200, size=45,shape=3,icon="hotseat", unlock={}},
}
modeRanks={}
for i=1,#modes do

View File

@@ -38,7 +38,7 @@ function SFX.play(s,v,pos)
while S[n]:isPlaying()do
n=n+1
if not S[n]then
S[n]=S[n-1]:clone()
S[n]=S[1]:clone()
S[n]:seek(0)
break
end

View File

@@ -1,2 +1,5 @@
gc=love.graphics
shader_glow=gc.newShader("shader/glow.cs")
local gc=love.graphics
return{
-- glow=gc.newShader("shader/glow.cs"),
alpha=gc.newShader("shader/alpha.cs"),
}

View File

@@ -42,6 +42,7 @@ skin.libColor={
color.darkGreen,
}
function skin.load()
local _
gc.push()
gc.origin()
gc.setDefaultFilter("nearest","nearest")
@@ -70,7 +71,7 @@ function skin.load()
gc.setLineWidth(3)
for i=1,11 do
puzzleMark[i]=C(30,30)
local _=skin.libColor[i]
_=skin.libColor[i]
gc.setColor(_[1],_[2],_[3],.6)
gc.rectangle("line",5,5,20,20)
gc.rectangle("line",10,10,10,10)
@@ -80,7 +81,7 @@ function skin.load()
gc.setColor(skin.libColor[i])
gc.rectangle("line",7,7,16,16)
end
local _=C(30,30)
_=C(30,30)
gc.setColor(1,1,1)
gc.line(5,5,25,25)
gc.line(5,25,25,5)
@@ -97,14 +98,14 @@ function skin.prevSet()--prev skin_set
setting.skinSet=_
skin.change(_)
_=list[_]
TEXT(_,1100,100,int(300/#_)+5,"fly")
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end
function skin.nextSet()--next skin_set
local _=setting.skinSet%L+1
setting.skinSet=_
skin.change(_)
_=list[_]
TEXT(_,1100,100,int(300/#_)+5,"fly")
TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end
function skin.prev(i)--prev skin for [i]
local _=setting.skin

View File

@@ -1,70 +0,0 @@
local gc=love.graphics
local sin,cos,rnd,min=math.sin,math.cos,math.random,math.min
local W,H,R--w,h+=100,r=real Radius
local stars={}
local planet={}
local function newPlanet()
local a=rnd()*3.142
local r=(H+W)*(2+rnd())*.05
planet.r=r
planet.x=W*.5+cos(a)*(R+r)
planet.y=H*.5+sin(a)*(R+r)
planet.vx=-cos(a+rnd()-.5)*.0626
planet.vy=-sin(a+rnd()-.5)*.0626
planet.R=.7+rnd()*.22
planet.G=planet.R+rnd()*.16-.1
planet.B=.7+rnd()*.2
end
local space={}--LIB
function space.resize(w,h)
R=((w*.5)^2+(h*.5)^2)^.5
W,H=w+100,h+100
end
function space.new()
if not W then space.resize(scr.w,scr.h)end
newPlanet()
for i=1,2600,5 do
local s=0.75*2^(rnd()*1.5)
stars[i]=s --size
stars[i+1]=rnd(W) --x
stars[i+2]=rnd(H) --y
stars[i+3]=(rnd()-.5)*.01*s --vx
stars[i+4]=(rnd()-.5)*.01*s --vy
end--800 stars
end
function space.update(dt)
local x,y=planet.x,planet.y
planet.x=planet.x+planet.vx
planet.y=planet.y+planet.vy
if((planet.x-W*.5)^2+(planet.y-H*.5)^2)^.5>R+planet.r then
newPlanet()
end
for i=1,2600,5 do
stars[i+1]=(stars[i+1]+stars[i+3])%W
stars[i+2]=(stars[i+2]+stars[i+4])%H
end--stars moving
end
function space.draw()
if not stars[1]then return end
gc.translate(-50,-50)
gc.setLineWidth(7)
gc.setColor(planet.R,planet.G,planet.B,.026)
gc.circle("line",planet.x,planet.y,planet.r+1)
gc.setColor(planet.R,.6,planet.B,.0626)
gc.circle("fill",planet.x,planet.y,planet.r)
gc.setColor(.9,.9,.9)
for i=1,2600,5 do
local x,y=stars[i+1],stars[i+2]
gc.circle("fill",x,y,stars[i])
end
gc.translate(50,50)
end
function space.discard()
stars={}
planet={}
collectgarbage()
end
return space

42
parts/sysFX.lua Normal file
View File

@@ -0,0 +1,42 @@
local gc=love.graphics
local setColor=gc.setColor
local setWidth=gc.setLineWidth
local rect=gc.rectangle
local fx={}
local FXdraw={}
function FXdraw.ripple(S)
setWidth(6)
setColor(1,1,1,1-S.t)
local r=(10*S.t)^1.2
rect("line",S[1]-r,S[2]-r,S[3]+2*r,S[4]+2*r)
end
function FXdraw.shade(S)
setColor(S[1],S[2],S[3],1-S.t)
rect("fill",S[4],S[5],S[6],S[7],2)
end
local sysFX={}
function sysFX.update(dt)
for i=#fx,1,-1 do
local S=fx[i]
S.t=S.t+dt*S.rate
if S.t>=1 then
for i=i,#fx do
fx[i]=fx[i+1]
end
end
end
end
function sysFX.draw()
for i=1,#fx do
fx[i]:draw()
end
end
--0=ripple,x,y,w,h
--1=shade,r,g,b,x,y,w,h
function sysFX.new(type,duration,...)
fx[#fx+1]={draw=FXdraw[type],t=0,rate=1/duration,...}
end
return sysFX

View File

@@ -1,71 +1,68 @@
local min=math.min
local mini=love.window.isMinimized
local task={}
function task.finish(P)
if scene.cur~="play"then return true end
P.endCounter=P.endCounter+1
if P.endCounter>120 then pauseGame()end
end
function task.lose(P)
P.endCounter=P.endCounter+1
if P.endCounter>80 then
for i=1,#P.field do
for j=1,10 do
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
end
if P.endCounter==120 then
for _=#P.field,1,-1 do
freeRow.discard(P.field[_])
freeRow.discard(P.visTime[_])
P.field[_],P.visTime[_]=nil
end
if #players==1 and scene=="play"then
pauseGame()
end
return true
end
end
end
function task.throwBadge(A,data)
data[2]=data[2]-1
if data[2]%4==0 then
local S,R=data[1],data[1].lastRecv
local x1,y1,x2,y2
if S.small then
x1,y1=S.centerX,S.centerY
else
x1,y1=S.x+308*S.size,S.y+450*S.size
end
if R.small then
x2,y2=R.centerX,R.centerY
else
x2,y2=R.x+66*R.size,R.y+344*R.size
end
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
--generate badge object
local rem=table.remove
if not A.ai and data[2]%8==0 then
SFX.play("collect")
local tasks={}
local TASK={}
function TASK.getCount()
return #tasks
end
function TASK.update()
for i=#tasks,1,-1 do
local T=tasks[i]
if T.code(T.P,T.data)then
for i=i,#tasks do
tasks[i]=tasks[i+1]
end
end
end
end
function TASK.new(code,P,data)
tasks[#tasks+1]={
code=code,
P=P,
data=data,
}
end
function TASK.changeCode(c1,c2)
for i=#tasks,1,-1 do
if tasks[i].code==c1 then
tasks[i].code=c2
end
end
if data[2]<=0 then return true end
end
function task.bgmFadeOut(_,id)
local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm*.1
src:setVolume(v>0 and v or 0)
if v<=0 then
src:stop()
return true
function TASK.removeTask_code(code)
for i=#tasks,1,-1 do
if tasks[i].code==code then
rem(tasks,i)
end
end
end
function task.bgmFadeIn(_,id)
local src=BGM.list[id]
local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1)
src:setVolume(v)
if v>=setting.bgm*.1 then return true end
function TASK.removeTask_data(data)
for i=#tasks,1,-1 do
if tasks[i].data==data then
rem(tasks,i)
end
end
end
return task
function TASK.clear(opt)
if opt=="all"then
local i=#tasks
while i>0 do
tasks[i]=nil
i=i-1
end
elseif opt=="play"then
for i=#tasks,1,-1 do
if tasks[i].P then
rem(tasks,i)
end
end
else--Player table
for i=#tasks,1,-1 do
if tasks[i].P==opt then
rem(tasks,i)
end
end
end
end
return TASK

View File

@@ -33,6 +33,8 @@ function textFX.spin(t)
gc.translate(t.x,t.y)
if t.c<.3 then
gc.rotate((.3-t.c)^2*4)
elseif t.c>.8 then
gc.rotate((t.c-.8)^2*-4)
end
mStr(t.text,0,-t.font*.7)
gc.pop()
@@ -60,7 +62,14 @@ function textFX.beat(t)
mStr(t.text,0,-t.font*.7)
gc.pop()
end
function getTEXT(text,x,y,font,style,spd,stop)
function textFX.mark(t)
local _,_,_,T=gc.getColor()
gc.setColor(1,1,1,T*.06626)
mStr(t.text,t.x,t.y-t.font*.7)
end
local TEXT={}
function TEXT.getText(text,x,y,font,style,spd,stop)
return{
c=0,
text=text,
@@ -72,7 +81,7 @@ function getTEXT(text,x,y,font,style,spd,stop)
draw=textFX[style]or error("unavailable type:"..style),
}
end--another version of TEXT()
function TEXT(text,x,y,font,style,spd,stop)
function TEXT.show(text,x,y,font,style,spd,stop)
texts[#texts+1]={
c=0, --timer
text=text, --string
@@ -84,7 +93,7 @@ function TEXT(text,x,y,font,style,spd,stop)
draw=textFX[style]or error("unavailable type:"..style), --draw method
}
end
function updateText(list)
function TEXT.update(list)
for i=#list,1,-1 do
local t=list[i]
t.c=t.c+t.spd
@@ -98,7 +107,7 @@ function updateText(list)
end
end
end
function drawTexts(list)
function TEXT.draw(list)
for i=1,#list do
local t=list[i]
local p=t.c
@@ -107,3 +116,4 @@ function drawTexts(list)
t:draw()
end
end
return TEXT

71
parts/tickEvent.lua Normal file
View File

@@ -0,0 +1,71 @@
local min=math.min
local mini=love.window.isMinimized
local tickEvent={}
function tickEvent.finish(P)
if SCN.cur~="play"then return true end
P.endCounter=P.endCounter+1
if P.endCounter>120 then pauseGame()end
end
function tickEvent.lose(P)
P.endCounter=P.endCounter+1
if P.endCounter>80 then
for i=1,#P.field do
for j=1,10 do
if P.visTime[i][j]>0 then
P.visTime[i][j]=P.visTime[i][j]-1
end
end
end
if P.endCounter==120 then
for _=#P.field,1,-1 do
freeRow.discard(P.field[_])
freeRow.discard(P.visTime[_])
P.field[_],P.visTime[_]=nil
end
if #players==1 and SCN.cur=="play"then
pauseGame()
end
return true
end
end
end
function tickEvent.throwBadge(A,data)
data[2]=data[2]-1
if data[2]%4==0 then
local S,R=data[1],data[1].lastRecv
local x1,y1,x2,y2
if S.small then
x1,y1=S.centerX,S.centerY
else
x1,y1=S.x+308*S.size,S.y+450*S.size
end
if R.small then
x2,y2=R.centerX,R.centerY
else
x2,y2=R.x+66*R.size,R.y+344*R.size
end
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
--generate badge object
if not A.ai and data[2]%8==0 then
SFX.play("collect")
end
end
if data[2]<=0 then return true end
end
function tickEvent.bgmFadeOut(_,id)
local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm*.1
src:setVolume(v>0 and v or 0)
if v<=0 then
src:stop()
return true
end
end
function tickEvent.bgmFadeIn(_,id)
local src=BGM.list[id]
local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1)
src:setVolume(v)
if v>=setting.bgm*.1 then return true end
end
return tickEvent

View File

@@ -1,12 +1,15 @@
local rnd=math.random
local rem=table.remove
local voiceQueue={free=0}
local VOC={}
function getVoice(str)
local function getVoice(str)
local L=voiceBank[str]
local n=1
while L[n]:isPlaying()do
n=n+1
if not L[n]then
L[n]=L[n-1]:clone()
L[n]=L[1]:clone()
L[n]:seek(0)
break
end
@@ -14,7 +17,7 @@ function getVoice(str)
return L[n]
--load voice with string
end
function getFreeVoiceChannel()
function VOC.getFreeChannel()
local i=#voiceQueue
for i=1,i do
if #voiceQueue[i]==0 then return i end
@@ -22,7 +25,44 @@ function getFreeVoiceChannel()
voiceQueue[i+1]={s=0}
return i+1
end
function VOICE(s,chn)
function VOC.getCount()
return #voiceQueue
end
function VOC.update()
for i=#voiceQueue,1,-1 do
local Q=voiceQueue[i]
if Q.s==0 then--闲置轨,自动删除多余
if i>3 then
rem(voiceQueue,i)
end
elseif Q.s==1 then--等待转换
Q[1]=getVoice(Q[1])
Q[1]:setVolume(setting.voc*.1)
Q[1]:play()
Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--播放1,准备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--12同时播放
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--最后播放
if not Q[1].isPlaying(Q[1])then
Q[1]=nil
Q.s=0
end
end
end
end
function VOC.play(s,chn)
if setting.voc>0 then
if chn then
local L=voiceQueue[chn]
@@ -31,8 +71,9 @@ function VOICE(s,chn)
L.s=1
--添加到queue[chn]
else
voiceQueue[getFreeVoiceChannel()]={s=1,voiceList[s][rnd(#voiceList[s])]}
voiceQueue[VOC.getFreeChannel()]={s=1,voiceList[s][rnd(#voiceList[s])]}
--自动创建空轨/播放
end
end
end
return VOC

View File

@@ -1,35 +1,5 @@
local gc=love.graphics
local rem=table.remove
local format=string.format
Task={}
function newTask(code,P,data)
Task[#Task+1]={
code=code,
P=P,
data=data,
}
end
function clearTask(opt)
if opt=="all"then
local i=#Task
while i>0 do
Task[i]=nil
i=i-1
end
elseif opt=="play"then
for i=#Task,1,-1 do
if Task[i].P then
rem(Task,i)
end
end
else--Player table
for i=#Task,1,-1 do
if Task[i].P==opt then
rem(Task,i)
end
end
end
end
local button={
type="button",
@@ -53,8 +23,7 @@ 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
end
function button:FX()
sysFX[#sysFX+1]={0,0,10,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV}
--0[ripple],timer,duration,x,y,w,h
sysFX.new("ripple",.16,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV)
end
function button:update()
if widget_sel==self then

File diff suppressed because it is too large Load Diff

251
scene.lua
View File

@@ -1,5 +1,5 @@
local int,max,format=math.floor,math.max,string.format
local scene={
local int,log,max,format=math.floor,math.log,math.max,string.format
local SCN={
cur="load",--Current scene
swapping=false,--ifSwapping
swap={
@@ -15,19 +15,28 @@ local sceneInit={
quit=love.event.quit,
load=function()
sceneTemp={
1,--Loading mode
1,--Loading counter
#voiceName,--Loading bar lenth(current)
require("parts/getTip"),--tip
phase=1,--Loading stage
cur=1,--Counter
tar=#voiceName,--Loading bar lenth(current)
tip=require("parts/getTip"),
list={
#voiceName,
#BGM.list,
#SFX.list,
IMG.getCount(),
#modes,
1,
},
skip=false,--if skipping
}
end,
intro=function()
BG.set("space")
sceneTemp=0--animation timer
BGM.play("blank")
end,
main=function()
curBG="none"
BG.set("space")
BGM.play("blank")
destroyPlayers()
modeEnv={}
@@ -48,7 +57,7 @@ local sceneInit={
end
end,
mode=function(org)
curBG="none"
BG.set("space")
BGM.play("blank")
destroyPlayers()
local cam=mapCam
@@ -62,11 +71,11 @@ local sceneInit={
custom=function()
sceneTemp=1--option select
destroyPlayers()
curBG=customRange.bg[customSel[12]]
BG.set(customRange.bg[customSel[12]])
BGM.play(customRange.bgm[customSel[13]])
end,
draw=function()
curBG="none"
BG.set("space")
sceneTemp={
sure=0,
pen=1,
@@ -81,37 +90,102 @@ local sceneInit={
resetGameData()
needResetGameData=nil
end
curBG=modeEnv.bg
BG.set(modeEnv.bg)
end,
pause=function(org)
local S=players[1].stat
sceneTemp={
timer=org=="play"and 0 or 50,
toTime(S.time),
S.key.."/"..S.rotate.."/"..S.hold,
S.piece.." "..(int(S.piece/S.time*100)*.01).."PPS",
format("%d %.2fLPM",S.row,S.row/S.time*60),
format("%d %.2fAPM",S.atk,S.atk/S.time*60),
format("%d %.2fSPM",S.send,S.send/S.time*60),
format("%d(%d-%d)",S.pend,S.recv,S.recv-S.pend),
S.clear_1.."/"..S.clear_2.."/"..S.clear_3.."/"..S.clear_4,
"["..S.spin_0.."]/"..S.spin_1.."/"..S.spin_2.."/"..S.spin_3,
S.b2b.."[+"..S.b3b.."]",
S.pc.."["..S.c.."]",
format("%.3f",S.atk/S.row),
S.extraPiece,
format("%.2f%%",100*max(1-S.extraRate/S.piece,0)),
list={
toTime(S.time),
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-%d)",S.pend,S.recv,S.recv-S.pend),
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)),
},
--从上开始,顺时针90°
radar1={
S.piece/2.5/S.time*60, --L'PM
S.atk/S.time*60, --APM
S.recv/S.time*60, --RPM
S.atk/S.row, --APL
},--外层表观数据
radar2={
S.dig/S.time*60, --DigPM
S.digatk/S.time*60, --APM(dig)
S.pend/S.time*60, --PendPM
S.digatk/S.dig, --APL(dig)
},--内层挖掘相关数据
V1={1/100,1/60,1/70,1/2},
V2={1/100,1/60,1/70,1/2},
timing=org=="play",
}
local _=sceneTemp
local A,B=_.radar1,_.radar2
local C,D=_.V1,_.V2
for i=1,4 do
if A[i]~=A[i]then A[i]=0 end
if B[i]~=B[i]then B[i]=0 end
C[i]=C[i]*A[i]if C[i]>1.26 then C[i]=1.26+((C[i]-1.26)+1)^.5-1 end
D[i]=D[i]*B[i]if D[i]>1.26 then D[i]=1.26+((D[i]-1.26)+1)^.5-1 end
end--normalize V1/V2
A[1]=format("%.1fAPM",A[1])
A[2]=format("%.1fL'PM",A[2])
A[3]=format("%.1fRPM",A[3])
A[4]=format("%.1fAPL",A[4])
local s
if C[1]<.5 and C[2]<.5 and C[3]<.5 and C[4]<.5 and D[1]<.5 and D[2]<.5 and D[3]<.5 and D[4]<.5 then
_.color1={.4,.9,.5}
_.color2={.7,.5,.3}
s=1.26
--Vegetable
elseif C[1]>1 or C[2]>1 or C[3]>1 or C[4]>1 or D[1]>1 or D[2]>1 or D[3]>1 or D[4]>1 then
_.color1={1,.3,.3}
_.color2={.4,.2,0}
s=.8
--Diao
else
_.color1={.4,.7,.9}
_.color2={.6,.3,.26}
s=1
--NORMAL
end
sceneTemp.scale=s
s=s*126
_.standard={
0,-s,
s,0,
0,s,
-s,0,
}
sceneTemp.V1={
0, -C[1]*s,
C[2]*s,0,
0, C[3]*s,
-C[4]*s,0,
0, -C[1]*s
}
sceneTemp.V2={
0, -D[1]*s,
D[2]*s,0,
0, D[3]*s,
-D[4]*s,0,
0, -D[1]*s
}
end,
setting_game=function()
curBG="none"
BG.set("space")
end,
setting_graphic=function()
curBG="none"
BG.set("space")
end,
setting_sound=function()
sceneTemp={last=0,jump=0}--last sound time,animation count(10→0)
curBG="none"
BG.set("space")
end,
setting_control=function()
sceneTemp={
@@ -121,7 +195,7 @@ local sceneInit={
dir=1,
wait=30,
}
curBG="strap"
BG.set("strap")
end,
setting_key=function()
sceneTemp={
@@ -131,7 +205,7 @@ local sceneInit={
}
end,
setting_touch=function()
curBG="game2"
BG.set("game2")
sceneTemp={
default=1,
snap=1,
@@ -139,34 +213,42 @@ local sceneInit={
}
end,
setting_touchSwitch=function()
curBG="matrix"
BG.set("matrix")
end,
help=function()
curBG="none"
sceneTemp={
pw=0,
}
BG.set("space")
end,
stat=function()
local S=stat
sceneTemp={
S.run,
S.game,
toTime(S.time),
S.key,
S.rotate,
S.hold,
S.piece,
S.row,
S.atk.."("..S.send..")",
format("%d(%d-%d)",S.pend,S.recv,S.recv-S.pend),
format("%d/%d/%d/%d",S.clear_1,S.clear_2,S.clear_3,S.clear_4),
format("[%d]/%d/%d/%d",S.spin_0,S.spin_1,S.spin_2,S.spin_3),
S.b2b.."[+"..S.b3b.."]",
S.pc.."["..S.c.."]",
format("%.2f",S.atk/S.row),
format("%d[%.3f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
chart={
A1=S.spin,A2=S.clear,
X1=S.spin_S,X2=S.clear_S,
Y1=S.spin_B,Y2=S.clear_B,
},
item={
S.run,
S.game,
toTime(S.time),
S.key.." "..S.rotate.." "..S.hold,
S.piece.." "..S.row.." "..int(S.atk),
S.recv.." "..(S.recv-S.pend).." "..S.pend,
S.dig.." "..int(S.digatk),
format("%.2f %.2f",S.atk/S.row,S.digatk/S.dig),
format("%d/%.3f%%",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
S.b2b.." "..S.b3b,
S.pc.." "..S.hpc,
}
}
for i=1,11 do
sceneTemp.item[i]=text.stat[i].."\t"..sceneTemp.item[i]
end
end,
history=function()
curBG="strap"
BG.set("strap")
sceneTemp={require("updateLog"),1}--scroll pos
end,
quit=function()
@@ -198,33 +280,50 @@ local backFunc={
load=love.event.quit,
pause=function()
love.keyboard.setKeyRepeat(true)
updateStat()
clearTask("play")
mergeStat(stat,players[1].stat)
TASK.clear("play")
end,
setting_touch= function()saveVK()end,
setting_key= function()saveKeyMap()end,
setting_game= function()saveSetting()end,
setting_graphic=function()saveSetting()end,
setting_sound= function()saveSetting()end,
setting_touch= function()FILE.saveVK()end,
setting_key= function()FILE.saveKeyMap()end,
setting_game= function()FILE.saveSetting()end,
setting_graphic=function()FILE.saveSetting()end,
setting_sound= function()FILE.saveSetting()end,
}
function scene.init(s,org)
if sceneInit[s]then sceneInit[s](org)end
end
function scene.push(tar,style)
if not scene.swapping then
local m=#scene.seq
scene.seq[m+1]=tar or scene.cur
scene.seq[m+2]=style or"fade"
function SCN.swapUpdate()
local S=SCN.swap
S.time=S.time-1
if S.time==S.mid then
SCN.init(S.tar,SCN.cur)
SCN.cur=S.tar
for _,W in next,Widget[S.tar]do
W:reset()
end--重置控件
widget_sel=nil
collectgarbage()
--此时场景切换
end
if S.time==0 then
SCN.swapping=false
end
end
function scene.pop()
local _=scene.seq
function SCN.init(s,org)
if sceneInit[s]then sceneInit[s](org)end
end
function SCN.push(tar,style)
if not SCN.swapping then
local m=#SCN.seq
SCN.seq[m+1]=tar or SCN.cur
SCN.seq[m+2]=style or"fade"
end
end
function SCN.pop()
local _=SCN.seq
_[#_-1]=nil
end
function scene.swapTo(tar,style)
local S=scene.swap
if not scene.swapping and tar~=scene.cur then
scene.swapping=true
function SCN.swapTo(tar,style)
local S=SCN.swap
if not SCN.swapping and tar~=SCN.cur then
SCN.swapping=true
if not style then style="fade"end
S.tar=tar
S.style=style
@@ -235,14 +334,14 @@ function scene.swapTo(tar,style)
widget_sel=nil
end
end
function scene.back()
if backFunc[scene.cur] then backFunc[scene.cur]()end
function SCN.back()
if backFunc[SCN.cur] then backFunc[SCN.cur]()end
--func when scene end
local m=#scene.seq
local m=#SCN.seq
if m>0 then
scene.swapTo(scene.seq[m-1],scene.seq[m])
scene.seq[m],scene.seq[m-1]=nil
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
SCN.seq[m],SCN.seq[m-1]=nil
--Poll&Back to preScene
end
end
return scene
return SCN

5
shader/alpha.cs Normal file
View File

@@ -0,0 +1,5 @@
extern float a;
vec4 effect(vec4 color, Image text,vec2 pos,vec2 scr_pos){
if(Texel(text,pos)[3]==0.)discard;
return vec4(1.,1.,1.,a);
}

View File

@@ -65,10 +65,18 @@ drawableText={
mxcmb=T(20,"Max Combo"),
pc=T(20,"Perfect Clear"),
ko=T(25,"KO"),
C=T(100,"C"),
B=T(100,"B"),
A=T(100,"A"),
S=T(100,"S"),
SS=T(80,"SS"),
modeName=T(30),levelName=T(30),
next=T(40),hold=T(40),
anykey=T(40),
next=T(40),hold=T(40),
win=T(120),finish=T(120),
lose=T(120),pause=T(120),

118
timer.lua
View File

@@ -7,82 +7,56 @@ local ins,rem=table.insert,table.remove
local Tmr={}
function Tmr.load()
local t=Timer()
local L=sceneTemp
local S=sceneTemp
::R::
--L={stage,curPos,curLen}
if L[1]==1 then
local N=voiceName[L[2]]
if S.phase==1 then
local N=voiceName[S.cur]
for i=1,#voiceList[N]do
local V=voiceList[N][i]
voiceBank[V]={love.audio.newSource("VOICE/"..V..".ogg","static")}
end
L[2]=L[2]+1
if L[2]>L[3]then
L[1],L[2],L[3]=2,1,#BGM.list
end
elseif L[1]==2 then
BGM.loadOne(L[2])
L[2]=L[2]+1
if L[2]>L[3]then
L[1],L[2],L[3]=3,1,#SFX.list
end
elseif L[1]==3 then
SFX.loadOne(L[2])
L[2]=L[2]+1
if L[2]>L[3]then
L[1],L[2],L[3]=4,1,#modes
end
elseif L[1]==4 then
local m=modes[L[2]]
modes[L[2]]=require("modes/"..m[1])
local M=modes[L[2]]
elseif S.phase==2 then
BGM.loadOne(S.cur)
elseif S.phase==3 then
SFX.loadOne(S.cur)
elseif S.phase==4 then
IMG.loadOne(S.cur)
elseif S.phase==5 then
local m=modes[S.cur]
modes[S.cur]=require("modes/"..m[1])
local M=modes[S.cur]
M.saveFileName,M.id=m[1],m.id
M.x,M.y,M.size,M.shape=m.x,m.y,m.size,m.shape
M.unlock=m.unlock
M.records=loadRecord(m[1])or M.score and{}
M.records=FILE.loadRecord(m[1])or M.score and{}
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("image/modeIcon/custom.png")
L[2]=L[2]+1
if L[2]>L[3]then
L[1],L[2],L[3]=5,1,1
end
elseif L[1]==5 then
elseif S.phase==6 then
--------------------------Loading some other things here?
local N=gc.newImage
titleImage=N("/image/mess/title.png")
coloredTitleImage=N("/image/mess/title_colored.png")
dialCircle=N("/image/mess/dialCircle.png")
dialNeedle=N("/image/mess/dialNeedle.png")
badgeIcon=N("/image/mess/badge.png")
spinCenter=N("/image/mess/spinCenter.png")
ctrlSpeedLimit=N("/image/mess/ctrlSpeedLimit.png")
speedLimit=N("/image/mess/speedLimit.png")
background1=N("/image/BG/bg1.png")
background2=N("/image/BG/bg2.png")
groupCode=N("/image/mess/groupCode.png")
payCode=N("/image/mess/payCode.png")
miya={
ch=N("/image/miya/ch.png"),
f1=N("/image/miya/f1.png"),
f2=N("/image/miya/f2.png"),
f3=N("/image/miya/f3.png"),
f4=N("/image/miya/f4.png"),
}
skin.load()
stat.run=stat.run+1
--------------------------
L[1],L[2],L[3]=0,1,1
SFX.play("welcome",.2)
else
L[2]=L[2]+1
L[3]=L[2]
if L[2]>50 then
stat.run=stat.run+1
scene.swapTo("intro","none")
S.cur=S.cur+1
S.tar=S.cur
if S.cur>62.6 then
SCN.swapTo("intro","none")
end
return
end
S.cur=S.cur+1
if S.cur>S.tar then
S.phase=S.phase+1
S.cur=1
S.tar=S.list[S.phase]
if not S.tar then
S.phase=0
S.tar=1
end
end
if L.skip and not scene.swapping then goto R end
if S.skip and not SCN.swapping then goto R end
end
function Tmr.intro()
sceneTemp=sceneTemp+1
@@ -114,7 +88,7 @@ function Tmr.mode(dt)
local cam=mapCam
local x,y,k=cam.x,cam.y,cam.k
local F
if not scene.swapping then
if not SCN.swapping then
if kb.isDown("up", "w")then y=y-10*k;F=true end
if kb.isDown("down","s")then y=y+10*k;F=true end
if kb.isDown("left","a")then x=x-10*k;F=true end
@@ -168,7 +142,7 @@ function Tmr.mode(dt)
cam.x1=cam.x1*.85+x*.15
cam.y1=cam.y1*.85+y*.15
cam.k1=cam.k1*.85+k*.15
local _=scene.swap.tar
local _=SCN.swap.tar
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then
if cam.sel then
@@ -220,8 +194,9 @@ function Tmr.play(dt)
rem(FX_badge,i)
end
end
local _
for i=1,#virtualkey do
local _=virtualkey[i]
_=virtualkey[i]
if _.pressTime>0 then
_.pressTime=_.pressTime-1
end
@@ -235,14 +210,8 @@ function Tmr.play(dt)
end
for p=1,#players do
local P=players[p]
if P.keyPressing[1]then
if P.moving>0 then P.moving=0 end
if -P.moving<=P.gameEnv.das then
P.moving=P.moving-1
end
elseif P.keyPressing[2]then
if P.moving<0 then P.moving=0 end
if P.moving<=P.gameEnv.das then
if P.movDir~=0 then
if P.moving<P.gameEnv.das then
P.moving=P.moving+1
end
else
@@ -254,8 +223,8 @@ function Tmr.play(dt)
elseif players[1].keyPressing[10]then
restartCount=restartCount+1
if restartCount>20 then
clearTask("play")
updateStat()
TASK.clear("play")
mergeStat(stat,players[1].stat)
resetGameData()
return
end
@@ -266,7 +235,12 @@ function Tmr.play(dt)
local P=players[p]
P:update(dt)
end
if modeEnv.royaleMode and frame%120==0 then freshMostDangerous()end
if frame%120==0 then
if modeEnv.royaleMode then freshMostDangerous()end
if marking and rnd()<.2 then
TEXT.show("游戏作者:MrZ_26\n出现此水印则为非法录屏上传",rnd(162,scr.w-162),rnd(126,scr.h-200),40,"mark",.626)
end--mark 2s each 10s
end
end
function Tmr.pause(dt)
if not gameResult then

View File

@@ -19,9 +19,12 @@ end
function mStr(s,x,y)
gc.printf(s,x-320,y,640,"center")
end
function mDraw(s,x,y)
function mText(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y)
end
function mDraw(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y-s:getHeight()*.5)
end
function destroyPlayers()
for i=#players,1,-1 do
local P=players[i]
@@ -48,6 +51,7 @@ end
--Single-usage funcs
local langID={"chi","chi_full","eng"}
local drawableTextLoad={
"anykey",
"next","hold",
"win","finish","lose","pause",
"custom",
@@ -108,6 +112,7 @@ end
function copyBoard()
local str=""
local H=0
local _
for y=20,1,-1 do
for x=1,10 do
if preField[y][x]~=0 then
@@ -121,13 +126,13 @@ function copyBoard()
local S=""
local L=preField[y]
for x=1,10 do
local _=L[x]+1
_=L[x]+1
S=S..char(_)
end
str=str..S
end
love.system.setClipboardText("Techmino sketchpad:"..data.encode("string","base64",data.compress("string","deflate",str)))
TEXT(text.copySuccess,350,360,40,"appear",.5)
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
end
function pasteBoard()
local str=love.system.getClipboardText()
@@ -168,14 +173,17 @@ function pasteBoard()
end
goto END
::ERROR::
TEXT(text.dataCorrupted,350,360,35,"flicker",.5)
TEXT.show(text.dataCorrupted,350,360,35,"flicker",.5)
::END::
end
function updateStat()
local S=players[1].stat
for k,v in next,S do
stat[k]=stat[k]+S[k]
function mergeStat(stat,Δ)
for k,v in next,Δ do
if type(v)=="table"then
mergeStat(stat[k],v)
else
stat[k]=stat[k]+v
end
end
end
function randomTarget(P)
@@ -218,7 +226,7 @@ end
function royaleLevelup()
gameStage=gameStage+1
local spd
TEXT(text.royale_remain(#players.alive),640,200,40,"beat",.3)
TEXT.show(text.royale_remain(#players.alive),640,200,40,"beat",.3)
if gameStage==2 then
spd=30
elseif gameStage==3 then
@@ -254,7 +262,7 @@ function royaleLevelup()
end
end
function pauseGame()
if not scene.swapping then
if not SCN.swapping then
restartCount=0--Avoid strange darkness
if not gameResult then
pauseCount=pauseCount+1
@@ -267,11 +275,11 @@ function pauseGame()
end
end
end
scene.swapTo("pause","none")
SCN.swapTo("pause","none")
end
end
function resumeGame()
scene.swapTo("play","none")
SCN.swapTo("play","none")
end
function loadGame(M)
--rec={}
@@ -282,7 +290,7 @@ function loadGame(M)
drawableText.modeName:set(M.name[lang])
drawableText.levelName:set(M.level[lang])
needResetGameData=true
scene.swapTo("play","fade_togame")
SCN.swapTo("play","fade_togame")
SFX.play("enter")
end
function resetPartGameData()
@@ -298,7 +306,7 @@ function resetPartGameData()
end
if modeEnv.task then
for i=1,#players do
newTask(modeEnv.task,players[i])
TASK.new(modeEnv.task,players[i])
end
end
if modeEnv.royaleMode then
@@ -306,7 +314,7 @@ function resetPartGameData()
players[i]:changeAtk(randomTarget(players[i]))
end
end
curBG=modeEnv.bg
BG.set(modeEnv.bg)
BGM.play(modeEnv.bgm)
if modeEnv.royaleMode then
for i=1,#players do
@@ -330,10 +338,10 @@ function resetGameData()
curMode.load()--bg/bgm need redefine in custom,so up here
if modeEnv.task then
for i=1,#players do
newTask(modeEnv.task,players[i])
TASK.new(modeEnv.task,players[i])
end
end
curBG=modeEnv.bg
BG.set(modeEnv.bg)
BGM.play(modeEnv.bgm)
texts={}

View File

@@ -1,30 +1,49 @@
local S=[=[
"Patron"(rmb10+)(ordered by first char):
"Patron"(time ordered,may not accurate):
[rmb100+]:
那没事了(T6300)
弥佑瑶
Alan
[rmb10+]:
八零哥
dtg
Fireboos
gggf127
加油啊,钉钉动了的大哥哥(T3228)
金巧
乐↗乐↘
立斐
仁参
Sasoric
sfqr
时雪
ThTsOd
夏小亚
心痕
蕴空之灵
yyangdid
gggf127
dtg
ThTsOd
Fireboos
金巧
10元
?[D*a]
立斐
时雪
yyangdid
sfqr
心痕
Sasoric
夏小亚
加油啊,钉钉动了的大哥哥(T3228)
仁参
乐↗乐↘
喜欢c4w的ztcjoin
面包
蠢熏
潘一栗
Lied
星街书婉
込余
祝西
829
e m*12
我永远爱白银诺艾尔(鹏
PCX
D*a(don't know name)
Thanks!
Future outlook:
New mode:
useful game Abbr. test
game Abbr. test
finesse exam(3next,1pt/mino,drop to score)
round-based dig
Infinite battle
@@ -34,18 +53,53 @@ Future outlook:
Square
Shifting field(left/right)
Other:
no recording-upload
warning FX
key pressing SFX
bag sep-line switch
game recording
(powerinfo switch)
powerinfo switch
new virtualWidgets like joysticks
custom sequence
splashing block
more FXs & 3d features & animations
Encrypt source code(compile to byte code)
new AI:task-Z
new AI: task-Z
CC smarter(think of garbage buffer)
0.8.16:Fantastic Global Update
new:
new statistic page with:
Radar chart which shows some important info. of player's performance
count each clear/spin for each piece(old data will be splited averagely)
linux version!
welcome vocal by MrZ
rank label on mode icon(C→B→A→S→SS)
new J/L-spin: R→2/L→2(0,-1)
new O-spin-J/L method!
new tele-ospin method!
support out frame of skins with transparent pixels
DAS system remade, no bugs any more!(probably)
Initial hold/rotate/move switch!
display ms in control setting
super secret option
changed:
cannot initial hold in a row any more
new randomizer for drought2
half-clear judging method changed
new background system(well, it doesn't look much different but space BG)
better sequence randomizer
now can loading at full speed with Dblclick/space/enter
add alipay paycode to help page
code:
first shader applied for white frame of falling block
many many module packed, easy to manage
bgm module changed, probably no bug
4 devMode now
fixed:
error when set to max 0 next
AI sequence initializing error when face setting changed
DAS error
0.8.15:Bug Fixed
new:
can switch line-clear text now
@@ -53,6 +107,7 @@ Future outlook:
give every update a name!
changed:
animation time of lock effect little changed
bone block of skin: ball changed
AI change target more slowly
Author.dignity-=1
fixed:
@@ -60,7 +115,6 @@ Future outlook:
AI will kill itself when spawn dir. of mino changed
error when reach 400 in 20G(Lunatic)
error block color in modes with starting field
cannot play pctrain mode
0.8.14:Cool FX
new:
@@ -75,11 +129,11 @@ Future outlook:
error garbage line color
error in finesse checking
some times error when touch screen
touch/press release with no press,then error
touch/press release with no press, then error
0.8.13:O-spin Update++
new:
a independent page to set DAS/ARR,with an animation for preview
a independent page to set DAS/ARR, with an animation for preview
changed:
new virtualkey animation
freer drawing mode(Incompatible with old ver.)
@@ -93,15 +147,15 @@ Future outlook:
0.8.12:Bountful Update
new:
layout setting:skin system with customizable block color/direction
layout setting: skin system with customizable block color/direction
more information when pause
block has more color(7→11)
skin:smooth(MrZ),contrast(MrZ),steel(kulumi),ball(shaw)
skin: smooth(MrZ), contrast(MrZ), steel(kulumi), ball(shaw)
changed:
BGM secret7's Inst. changed
more stable space background
stat format changed when pause/stat menu
opaque background in pause when playing,transparent after game
opaque background in pause when playing, transparent after game
canceled invalid game
easier to unlock custom mode
some text changed
@@ -110,7 +164,7 @@ Future outlook:
merge event.lua to player.lua
new skin image format
same format for all file
better virtualkey-scanning opportunity,bit faster when many AI
better virtualkey-scanning opportunity, bit faster when many AI
some player-method name changed
fixed:
an error of pause button
@@ -125,7 +179,8 @@ Future outlook:
better rule of checking invalid game
can setting when pause
opaque background when pause
//many code optimized(moduled)
code:
many code optimized(moduled)
fixed:
receive attack when paused in survivor mode
error when pasteboard has block_13
@@ -145,14 +200,14 @@ Future outlook:
0.8.9:System Detail Update
invalid game when pause too much
quick play re-added
new BGM:Oxygen(c4w&pc training)
new BGM: Oxygen(c4w&pc training)
space background little changed
0.8.8+:Bug-Fix Update
fixed many fatal bugs
0.8.8:Space BG Update
background now is cool space with "planets" and "stars",not boring falling tetrominos!
background now is cool space with "planets" and "stars", not boring falling tetrominos!
records with date
adjustable waiting time before start
ajustable maxnext count
@@ -163,7 +218,7 @@ Future outlook:
no black side in any screen size
an unlock-all easter egg
cannot press invisible func key
fixed:some mode error
fixed: some mode error
add many fatal bugs
0.8.7:Game Detail Update
@@ -172,29 +227,29 @@ Future outlook:
speed of marathon mode changed
shorter clipboard string(when air above)
attack system/score system little changed
fixed:rank system,some mode error when enter(again!)
fixed: rank system, some mode error when enter(again!)
0.8.6:System Detail Update
gamepad can adjust key
add SFX when enter game
map GUI little adjusted
event system little changed(no ctrl when scene swapping)
fixed:rank system,some mode error when enter
fixed:rank system, some mode error when enter
0.8.5-:Exploration Update
mode map!Brandly new GUI for mode selecting
mode unlock system,not that scary for noob
mode unlock system, not that scary for noob
every mode has rank calculating method(may some mistakes/inappropriate number)
save 10 best recoreds for each mode
can save/share custom map now
new mode:Big Bang
new mode: Big Bang
button appearance changed
better widget performence
remove Qplay
many bug fixed
0.8.4:Miya Update+
vocal more natural(important,may cause new bug)
vocal more natural(important, may cause new bug)
a bit better performence on mobile devices
fatal bug fixed
@@ -245,7 +300,7 @@ Future outlook:
fixed a problem in finesse calculating
0.7.30:Virtualkey Update
auto-tracking virtual key,adjustable parameters!
auto-tracking virtual key, adjustable parameters!
can switch on/off virtuakeys
add 7 more key
better finesse rate calculating
@@ -271,16 +326,16 @@ Future outlook:
0.7.25:Demo Update
demo play at main menu
ALMOST reconstructed WHOLE PLAYER SYSTEM,NEED TEST
ALMOST reconstructed WHOLE PLAYER SYSTEM, NEED TEST
many bug fixed
0.7.23/24:Feast of Hearing
REMAKE ALL BGM!
more settings with brand new GUI!
new mode:Master-Final
new modes:attacker & defender(not survivor!)
new mode: Master-Final
new modes: attacker & defender(not survivor!)
add restart button when pause
Code Clear added,face it bravely!(Windows only)
Code Clear added, face it bravely!(Windows only)
change falling animation
new GUI details
louder sound
@@ -319,7 +374,7 @@ Future outlook:
0.7.19:Voice Update
voice system added(voice by Miya)
support macOS!
new mode:C4W training
new mode: C4W training
rendering of royale mode optimized again
add "free cell" in draw mode
add 2 new block skins
@@ -372,14 +427,14 @@ Future outlook:
bugs fixed(AI control error)
0.7.13:
Chinese game name:方块研究所
Chinese game name: 方块研究所
SUPER COOL instant moving effect
new b2b bar style & animation
new transition animation
change difficulty of master mode
adjust delay algorithm(probably cause controlfeel changing,please reset your DAS setting)
adjust delay algorithm(probably cause controlfeel changing, please reset your DAS setting)
code reconstructed
bugs fixed(error when seq=his,size of custom oppo)
bugs fixed(error when seq=his, size of custom oppo)
debug key change to F8
0.7.12:Total Update
@@ -393,11 +448,11 @@ Future outlook:
a bit change of rotate system
grid switch
swap target by combo key/press
some Chinese translaton edited
some Chinese translaton editted
[reconstruct event system]
0.7.11:Total Update
some Chinese translaton edited
some Chinese translaton editted
add bone block in 2 hardest marathon(new block-fresh system)
play sound when get badges in royale mode
change b2b indicator display method
@@ -454,7 +509,7 @@ Future outlook:
change sequence of TSD-only mode to bag7
0.7.5:Total Update
reduce difficuly of PC training mode,and add more patterns
reduce difficuly of PC training mode, and add more patterns
reduce difficuly of death mode
add PC challenge mode
swapping attack mode for royale mode(AI always use 'Random')
@@ -475,7 +530,7 @@ Future outlook:
add infinite target in custom
fix TSD-only mode result+1 when finishing with a wrong clear
change sequence generator of TSD-only mode
GUI position edited
GUI position editted
Fix Screen flow
smarter AI
@@ -483,7 +538,7 @@ Future outlook:
add PC training mode
add TSD-only mode
remove non-sense s/z spin double
GUI position edited
GUI position editted
grid BG changed
smarter AI
]=]

View File

@@ -79,115 +79,69 @@ local customSet={
{3,20,1,1,7,1,1,3,8,3,1,7,8},
{25,11,8,11,4,1,2,1,8,3,1,4,9},
}
local function useDefaultSet(n)
for i=1,#customSet[n]do
customSel[i]=customSet[n][i]
--λFuncs for widgets,delete at file end
function defSet(n)
return function()
for i=1,#customSet[n]do
customSel[i]=customSet[n][i]
end
BG.set(customRange.bg[customSel[12]])
BGM.play(customRange.bgm[customSel[13]])
end
curBG=customRange.bg[customSel[12]]
BGM.play(customRange.bgm[customSel[13]])
end
function SETval(k) return function()return setting[k] end end
function SETsto(k) return function(i)setting[k]=i end end
function SETrev(k) return function()setting[k]=not setting[k] end end
function pressKey(k)return function()love.keypressed(k) end end
function setPen(i) return function()sceneTemp.pen=i end end
function prevSkin(n)return function()skin.prev(n) end end
function nextSkin(n)return function()skin.next(n) end end
function nextDir(n) return function()skin.rotate(n) end end
function VKAdisp(n) return function()return VK_org[n].ava end end
function VKAcode(n) return function()VK_org[n].ava=not VK_org[n].ava end end
local function DAScheck()
if setting.arr>setting.das then
setting.das=setting.arr
Widget.setting_game.dasU:FX()
SFX.play("blip_1",.4)
end
end
local function ARRcheck()
if setting.arr>setting.das then
setting.arr=setting.das
Widget.setting_game.arrD:FX()
SFX.play("blip_1",.4)
end
end
--λFuncs for widgets
local function SETval(k)
return function()
return setting[k]
end
end
local function SETsto(k)
return function(i)setting[k]=i end
end
local function SETrev(k)
return function()
setting[k]=not setting[k]
end
end
local function pressKey(k)
return function()
love.keypressed(k)
end
end
local function setPen(i)
return function()
sceneTemp.pen=i
end
end
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 prevSkin(n)
return function()skin.prev(n)end
end
local function nextSkin(n)
return function()skin.next(n)end
end
local function nextDir(n)
return function()
skin.rotate(n)
end
end
local C=color
local Widget={
load={},intro={},quit={},
main={
play= newButton(150,280,200,160,C.lightRed, 55,function()scene.push()scene.swapTo("mode")end, nil,"setting"),
setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"),
music= newButton(590,280,200,160,C.lightPurple, 32,function()scene.push()scene.swapTo("music")end, nil,"help"),
help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"),
stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"qplay"),
qplay= newButton(590,460,200,160,C.lightOrange, 43,function()scene.push()loadGame(stat.lastPlay)end, nil,"lang"),
play= newButton(150,280,200,160,C.lightRed, 55,function()SCN.push()SCN.swapTo("mode")end, nil,"setting"),
setting=newButton(370,280,200,160,C.lightBlue, 45,function()SCN.push()SCN.swapTo("setting_game")end, nil,"music"),
music= newButton(590,280,200,160,C.lightPurple, 32,function()SCN.push()SCN.swapTo("music")end, nil,"help"),
help= newButton(150,460,200,160,C.lightYellow, 50,function()SCN.push()SCN.swapTo("help")end, nil,"stat"),
stat= newButton(370,460,200,160,C.lightCyan, 43,function()SCN.push()SCN.swapTo("stat")end, nil,"qplay"),
qplay= newButton(590,460,200,160,C.lightOrange, 43,function()SCN.push()loadGame(stat.lastPlay)end, nil,"lang"),
lang= newButton(150,610,160,100,C.lightGreen, 45,function()
setting.lang=setting.lang%#langName+1
changeLanguage(setting.lang)
TEXT(text.lang,370,610,50,"appear",1.6)
TEXT.show(text.lang,370,610,50,"appear",1.6)
end,nil,"quit"),
quit= newButton(590,610,160,100,C.lightGrey, 45,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"),
quit= newButton(590,610,160,100,C.lightGrey, 45,function()VOC.play("bye")SCN.swapTo("quit","slowFade")end,nil,"play"),
},
mode={
draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()scene.push()scene.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
custom=newButton(1100, 540,220,90,C.lightGreen, 40,function()scene.push()scene.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
start= newButton(1040, 655,180,80,C.lightGrey, 40,function()scene.push()loadGame(mapCam.sel)end,function()return not mapCam.sel end),
back= newButton(1200, 655,120,80,C.white, 40,scene.back),
--function()scene.push()scene.swapTo("custom")end
draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()SCN.push()SCN.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
custom=newButton(1100, 540,220,90,C.lightGreen, 40,function()SCN.push()SCN.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
start= newButton(1040, 655,180,80,C.lightGrey, 40,function()if mapCam.sel then SCN.push()loadGame(mapCam.sel)end end,function()return not mapCam.sel end),
back= newButton(1200, 655,120,80,C.white, 40,SCN.back),
--function()SCN.push()SCN.swapTo("custom")end
},
music={
bgm= newSlider(760, 80,400,10,35,function()BGM.freshVolume()end,SETval("bgm"),SETsto("bgm")),
up= newButton(1100, 200,120,120,C.white,55,pressKey("up")),
play= newButton(1100, 340,120,120,C.white,35,pressKey("space"),function()return setting.bgm==0 end),
down= newButton(1100, 480,120,120,C.white,55,pressKey("down")),
back= newButton(640, 630,230,90, C.white,40,scene.back),
back= newButton(640, 630,230,90, C.white,40,SCN.back),
},
custom={
up= newButton(1000, 360,100,100,C.white, 45,function()sceneTemp=(sceneTemp-2)%#customID+1 end),
down= newButton(1000, 600,100,100,C.white, 45,function()sceneTemp=sceneTemp%#customID+1 end),
left= newButton(880, 480,100,100,C.white, 45,pressKey("left")),
right= newButton(1120, 480,100,100,C.white, 45,pressKey("right")),
set1= newButton(640, 160,240,75, C.lightYellow, 35,function()useDefaultSet(1)end),
set2= newButton(640, 250,240,75, C.lightYellow, 35,function()useDefaultSet(2)end),
set3= newButton(640, 340,240,75, C.lightYellow, 35,function()useDefaultSet(3)end),
set4= newButton(640, 430,240,75, C.lightYellow, 35,function()useDefaultSet(4)end),
set5= newButton(640, 520,240,75, C.lightYellow, 35,function()useDefaultSet(5)end),
back= newButton(640, 630,180,60, C.white, 35,scene.back),
set1= newButton(640, 160,240,75, C.lightYellow, 35,defSet(1)),
set2= newButton(640, 250,240,75, C.lightYellow, 35,defSet(2)),
set3= newButton(640, 340,240,75, C.lightYellow, 35,defSet(3)),
set4= newButton(640, 430,240,75, C.lightYellow, 35,defSet(4)),
set5= newButton(640, 520,240,75, C.lightYellow, 35,defSet(5)),
back= newButton(640, 630,180,60, C.white, 35,SCN.back),
},
draw={
b1= newButton(500+65*1, 150,58,58,C.red, 30,setPen(1)),--B1
@@ -215,7 +169,7 @@ local Widget={
demo= newSwitch(755, 640,30,function()return sceneTemp.demo end,function()sceneTemp.demo=not sceneTemp.demo end),
copy= newButton(920, 640,120,120,C.lightRed, 35,copyBoard),
paste= newButton(1060, 640,120,120,C.lightBlue, 35,pasteBoard),
back= newButton(1200, 640,120,120,C.white, 35,scene.back),
back= newButton(1200, 640,120,120,C.white, 35,SCN.back),
},
play={
pause= newButton(1235,45,80,80,C.white,25,pauseGame),
@@ -223,40 +177,40 @@ local Widget={
pause={
resume= newButton(640,290,240,100,C.white,30,resumeGame),
restart=newButton(640,445,240,100,C.white,33,function()
clearTask("play")
updateStat()
TASK.clear("play")
mergeStat(stat,players[1].stat)
resetGameData()
scene.swapTo("play","none")
SCN.swapTo("play","none")
end),
setting=newButton(1130,70,180,90,C.lightBlue,35,function()
scene.push()scene.swapTo("setting_sound")
SCN.push()SCN.swapTo("setting_sound")
end),
quit= newButton(640,600,240,100,C.white,35,scene.back),
quit= newButton(640,600,240,100,C.white,35,SCN.back),
},
setting_game={
graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sound"),
sound= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"ctrl"),
ctrl= newButton(290,220,320,80,C.lightYellow,35,function()scene.push()scene.swapTo("setting_control")end, nil,"key"),
key= newButton(640,220,320,80,C.lightGreen,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"),
touch= newButton(990,220,320,80,C.lightBlue,35,function()scene.push()scene.swapTo("setting_touch")end, nil,"reTime"),
graphic=newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_graphic")end, nil,"sound"),
sound= newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_sound")end, nil,"ctrl"),
ctrl= newButton(290,220,320,80,C.lightYellow,35,function()SCN.push()SCN.swapTo("setting_control")end, nil,"key"),
key= newButton(640,220,320,80,C.lightGreen,35,function()SCN.push()SCN.swapTo("setting_key")end, nil,"touch"),
touch= newButton(990,220,320,80,C.lightBlue,35,function()SCN.push()SCN.swapTo("setting_touch")end, nil,"reTime"),
reTime= newSlider(350,340,300,10,30,nil, SETval("reTime"), SETsto("reTime"), nil,"maxNext"),
maxNext=newSlider(350,440,300,6,30,nil, SETval("maxNext"), SETsto("maxNext"), nil,"autoPause"),
autoPause=newSwitch(350,540,20, SETval("autoPause"), SETrev("autoPause"), nil,"layout"),
layout= newButton(590,540,140,70,C.white,35,function()
scene.push()
scene.swapTo("setting_skin")
SCN.push()
SCN.swapTo("setting_skin")
end,nil,"quickR"),
quickR= newSwitch(1050,340,35, SETval("quickR"), SETrev("quickR"), nil,"swap"),
swap= newSwitch(1050,440,19, SETval("swap"), SETrev("swap"), nil,"fine"),
fine= newSwitch(1050,540,20, SETval("fine"), SETrev("fine"), nil,"back"),
back= newButton(1140,650,200,80,C.white,40,scene.back, nil,"graphic"),
back= newButton(1140,650,200,80,C.white,40,SCN.back, nil,"graphic"),
},
setting_graphic={
sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"),
game= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"ghost"),
sound= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_sound")end, nil,"game"),
game= newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"ghost"),
ghost= newSwitch(310,180,35, SETval("ghost"), SETrev("ghost"), nil,"center"),
center= newSwitch(580,180,35, SETval("center"), SETrev("center"), nil,"smooth"),
smooth= newSwitch(310,260,25, SETval("smooth"), SETrev("smooth"), nil,"grid"),
smooth= newSwitch(310,260,25, SETval("smooth"), SETrev("smooth"), nil,"grid"),
grid= newSwitch(580,260,30, SETval("grid"), SETrev("grid"), nil,"lockFX"),
lockFX= newSlider(310,340,373,3,35,nil, SETval("lockFX"), SETsto("lockFX"), nil,"dropFX"),
dropFX= newSlider(310,410,373,5,35,nil, SETval("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
@@ -269,40 +223,41 @@ local Widget={
love.window.setFullscreen(setting.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end,nil,"bg"),
bg= newSwitch(990,330,35,SETval("bg"),SETrev("bg"),nil,"bgspace"),
bgspace=newSwitch(990,410,35,SETval("bgspace"),function()
setting.bgspace=not setting.bgspace
if setting.bgspace then
space.new()
else
space.discard()
end
end,nil,"back"),
back= newButton(1140,650,200,80,C.white,40,scene.back,nil,"sound"),
bg= newSwitch(990,330,35,SETval("bg"),function()
BG.set("none")
setting.bg=not setting.bg
BG.set("space")
end,nil,"back"),
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"sound"),
},
setting_sound={
game= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sfx"),
sfx= newSlider(180,250,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"bgm"),
bgm= newSlider(750,250,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"),
vib= newSlider(180,440,400,5 ,28,function()VIB(1)end, SETval("vib"), SETsto("vib"), nil,"voc"),
voc= newSlider(750,440,400,10,32,function()VOICE("nya")end, SETval("voc"), SETsto("voc"), nil,"stereo"),
game= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_graphic")end, nil,"sfx"),
sfx= newSlider(180,250,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"bgm"),
bgm= newSlider(750,250,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"),
vib= newSlider(180,440,400,5 ,28,function()VIB(1)end, SETval("vib"), SETsto("vib"), nil,"voc"),
voc= newSlider(750,440,400,10,32,function()VOC.play("nya")end, SETval("voc"), SETsto("voc"), nil,"stereo"),
stereo= newSlider(180,630,400,10,35,function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, SETval("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"),
back= newButton(1140,650,200,80,C.white,40,scene.back,nil,"game"),
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"game"),
},
setting_control={
das= newSlider(226,200,910, 26, 30,nil,SETval("das"), SETsto("das"), nil,"arr"),
arr= newSlider(226,290,525, 15, 30,nil,SETval("arr"), SETsto("arr"), nil,"sddas"),
sddas= newSlider(226,380,350, 10, 30,nil,SETval("sddas"), SETsto("sddas"),nil,"sdarr"),
sdarr= newSlider(226,470,140, 4, 30,nil,SETval("sdarr"), SETsto("sdarr"),nil,"reset"),
sdarr= newSlider(226,470,140, 4, 30,nil,SETval("sdarr"), SETsto("sdarr"),nil,"ihs"),
ihs= newSwitch(1100,290,30, SETval("ihs"), SETrev("ihs"),nil,"irs"),
irs= newSwitch(1100,380,30, SETval("irs"), SETrev("irs"),nil,"ihs"),
ims= newSwitch(1100,470,30, SETval("ims"), SETrev("ims"),nil,"reset"),
reset= newButton(160,580,200, 100,C.lightRed,40,function()
setting.das,setting.arr=10,2
setting.sddas,setting.sdarr=0,2
local _=setting
_.das,_.arr=10,2
_.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false
end,nil,"back"),
back= newButton(1140,650,200,80,C.white,40,scene.back,nil,"das"),
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"das"),
},
setting_key={
back=newButton(1140,650,200,80,C.white,45,scene.back),
back=newButton(1140,650,200,80,C.white,45,SCN.back),
},
setting_skin={
prev= newButton(700,100,140,100,C.white,50,function()skin.prevSet()end),
@@ -333,7 +288,7 @@ local Widget={
skinR= newButton(200,640,220,80,C.lightPurple,35,function()setting.skin={1,5,2,8,10,3,7}SFX.play("rotate")end),
faceR= newButton(480,640,220,80,C.lightRed,35,function()setting.face={0,0,0,0,0,0,0}SFX.play("hold")end),
back= newButton(1140,650,200,80,C.white,40,scene.back),
back= newButton(1140,650,200,80,C.white,40,SCN.back),
},
setting_touch={
default=newButton(520,80,170,80,C.white,35,function()
@@ -356,10 +311,10 @@ local Widget={
sceneTemp.snap=sceneTemp.snap%6+1
end),
option= newButton(520,180,170,80,C.white,40,function()
scene.push()
scene.swapTo("setting_touchSwitch")
SCN.push()
SCN.swapTo("setting_touchSwitch")
end),
back= newButton(760,180,170,80,C.white,40,scene.back),
back= newButton(760,180,170,80,C.white,40,SCN.back),
size= newSlider(450,265,460,14,40,nil,function()
return VK_org[sceneTemp.sel].r/10-1
end,
@@ -397,33 +352,34 @@ local Widget={
track= newSwitch(1170,300,35,SETval("VKTrack"),SETrev("VKTrack")),
icon= newSwitch(850,300,40,SETval("VKIcon"),SETrev("VKIcon")),
tkset= newButton(1120,400,240,80,C.white,32,function()
scene.push()
scene.swapTo("setting_trackSetting")
SCN.push()
SCN.swapTo("setting_trackSetting")
end,function()return not setting.VKTrack end),
alpha= newSlider(840,490,400,10,40,nil,SETval("VKAlpha"),SETsto("VKAlpha")),
back= newButton(1100,600,240,80,C.white,45,scene.back),
back= newButton(1100,600,240,80,C.white,45,SCN.back),
},
setting_trackSetting={
VKDodge=newSwitch(400,200, 35,SETval("VKDodge"),SETrev("VKDodge")),
VKTchW= newSlider(140,310,1000,10,35,nil,SETval("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end),
VKCurW= newSlider(140,370,1000,10,35,nil,SETval("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end),
back= newButton(1080,600,240,80,C.white,45,scene.back),
back= newButton(1080,600,240,80,C.white,45,SCN.back),
},
help={
his= newButton(1050,500,250,80,C.white,35,function()scene.push()scene.swapTo("history")end,nil,"back"),
qq= newButton(1050,600,250,80,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"),
back= newButton(640, 600,200,80,C.white,40,scene.back,nil,"qq"),
his= newButton(1050,500,250,80,C.white,35,function()SCN.push()SCN.swapTo("history")end,nil,"back"),
qq= newButton(1050,600,250,80,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,function()return mobile end,"his"),
back= newButton(640, 600,200,80,C.white,40,SCN.back,nil,"qq"),
},
history={
prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sceneTemp[2]==1 end),
next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp[2]==#sceneTemp[1]-22 end),
back= newButton(1155,600,180,90,C.white,40,scene.back),
back= newButton(1155,600,180,90,C.white,40,SCN.back),
},
stat={
path= newButton(980,620,250,80,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
back= newButton(640,620,200,80,C.white,40,scene.back,nil,"path"),
back= newButton(640,620,200,80,C.white,40,SCN.back,nil,"path"),
},
}
defSet,SETval,SETsto,SETrev,pressKey,setPen,prevSkin,nextSkin,nextDir,VKAdisp,VKAcode=nil
for _,L in next,Widget do
for _,W in next,L do
if W.next then