Compare commits

..

5 Commits

Author SHA1 Message Date
MrZ_26
12c047416c 0.7.33+α 2020-02-04 19:38:04 +08:00
MrZ_26
fd5fac4e8a 0.7.32α 2020-02-04 19:37:53 +08:00
MrZ_26
1641440886 0.7.31+α 2020-02-04 19:37:41 +08:00
MrZ_26
c14124d00c 0.7.30α 2020-02-04 19:37:25 +08:00
MrZ_26
f261906f1a 0.7.28+α 2020-02-04 19:37:06 +08:00
49 changed files with 2435 additions and 1734 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
SFX/error.ogg Normal file

Binary file not shown.

BIN
SFX/error_long.ogg Normal file

Binary file not shown.

31
ai.lua
View File

@@ -110,7 +110,8 @@ local FCL={
FCL[2]=FCL[1] FCL[2]=FCL[1]
FCL[4]=FCL[3] FCL[4]=FCL[3]
FCL[5]=FCL[3] FCL[5]=FCL[3]
local clearScore={[0]=0,0,2,4,12} local LclearScore={[0]=0,-200,-140,-100,200}
local HclearScore={[0]=0,50,80,100,500}
local function ifoverlapAI(f,bk,x,y) local function ifoverlapAI(f,bk,x,y)
if y<1 then return true end if y<1 then return true end
if y>#f then return end if y>#f then return end
@@ -119,9 +120,8 @@ local function ifoverlapAI(f,bk,x,y)
end end end end
end end
local function resetField(f0,f,start) local function resetField(f0,f,start)
::L::if f[start]then while f[start]do
removeRow(f,start) removeRow(f,start)
goto L
end end
for i=start,#f0 do for i=start,#f0 do
f[i]=getNewRow(0) f[i]=getNewRow(0)
@@ -148,9 +148,8 @@ local function getScore(field,cb,cy)
if #field==0 then return 1e99 end--PC best if #field==0 then return 1e99 end--PC best
for x=1,10 do for x=1,10 do
local h=#field local h=#field
::L::if field[h][x]==0 and h>1 then while field[h][x]==0 and h>1 do
h=h-1 h=h-1
goto L
end end
height[x]=h height[x]=h
if x>3 and x<8 and h>highest then highest=h end if x>3 and x<8 and h>highest then highest=h end
@@ -163,6 +162,7 @@ local function getScore(field,cb,cy)
end end
end end
end end
local sdh=0
local h1,mh1=0,0 local h1,mh1=0,0
for x=1,9 do for x=1,9 do
local dh=abs(height[x]-height[x+1]) local dh=abs(height[x]-height[x+1])
@@ -172,17 +172,25 @@ local function getScore(field,cb,cy)
else else
h1=0 h1=0
end end
sdh=sdh+min(dh^1.6,20)
end end
freeRow[#freeRow+1]=height freeRow[#freeRow+1]=height
freeRow.L=freeRow.L+1 freeRow.L=freeRow.L+1
score= score=
#field*20 -#field*10
-cy*35 -cy*35
-#cb*25 -#cb*25
+clearScore[clear]*(8+#field) +(#field>10 and
-hole*50 HclearScore[clear]
if #field>6 then score=score-highest*5 end -hole*70
if mh1>3 then score=score-40-mh1*30 end -sdh
or
LclearScore[clear]
-hole*100
-sdh*3
)
if #field>6 then score=score-highest*5+20 end
if mh1>3 then score=score-20-mh1*30 end
return score return score
end end
------------------------------------------------- -------------------------------------------------
@@ -204,9 +212,8 @@ AI_think={
local cb=blocks[bn][dir] local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos for cx=1,11-#cb[1]do--each pos
local cy=#Tfield+1 local cy=#Tfield+1
::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then while not ifoverlapAI(Tfield,cb,cx,cy-1)do
cy=cy-1 cy=cy-1
goto L
end--move to bottom end--move to bottom
for i=1,#cb do for i=1,#cb do
local y=cy+i-1 local y=cy+i-1

View File

@@ -70,7 +70,7 @@ function button:draw()
end end
end end
function button:getInfo() function button:getInfo()
print(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x,self.y,self.w,self.h,self.font)) print(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font))
end end
local switch={type="switch"} local switch={type="switch"}
@@ -108,7 +108,6 @@ function switch:draw()
--frame --frame
local t=self.text local t=self.text
if t then if t then
if type(t)=="function"then t=t()end
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(self.font) setFont(self.font)
gc.printf(t,x-412,y+20-self.font*.7,400,"right") gc.printf(t,x-412,y+20-self.font*.7,400,"right")

View File

@@ -1,4 +1,5 @@
gameVersion="Alpha V0.7.27+" math.randomseed(os.time())
gameVersion="Alpha V0.7.33+"
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Save directory name t.identity="Techmino"--Save directory name
t.version="11.1" t.version="11.1"
@@ -9,7 +10,12 @@ function love.conf(t)
t.audio.mixwithsystem=true--Switch on to keep sysBGM t.audio.mixwithsystem=true--Switch on to keep sysBGM
local W=t.window local W=t.window
W.title=math.random()>.01 and "Techmino "..gameVersion or"MrZ NB!" if math.random()>.26 then
W.title="Techmino "..gameVersion
else
math.randomseed(tonumber(os.date("%Y%j")))
W.title="Your lucky number today:"..math.random(100,626)
end
W.icon="/image/icon.png" W.icon="/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360 W.minwidth,W.minheight=640,360
@@ -17,7 +23,7 @@ function love.conf(t)
W.resizable=1 W.resizable=1
W.fullscreentype="desktop"--"exclusive" W.fullscreentype="desktop"--"exclusive"
W.fullscreen=X W.fullscreen=X
W.vsync=X--0→∞fps W.vsync=0--0→∞fps
W.msaa=X--The number of samples to use with multi-sampled antialiasing (number) W.msaa=X--The number of samples to use with multi-sampled antialiasing (number)
W.depth=X--Bits per sample in the depth buffer W.depth=X--Bits per sample in the depth buffer
W.stencil=1--The number of bits per sample in the stencil buffer W.stencil=1--The number of bits per sample in the stencil buffer

File diff suppressed because it is too large Load Diff

97
default_data.lua Normal file
View File

@@ -0,0 +1,97 @@
setting={
das=10,arr=2,
sddas=0,sdarr=2,
quickR=true,swap=true,
fine=false,
--game
ghost=true,center=true,
smo=true,grid=false,
dropFX=3,
shakeFX=3,
atkFX=3,
frameMul=100,
--
fullscreen=false,
bg=true,
bgblock=true,
lang=1,
skin=1,
--graphic
sfx=10,bgm=7,
vib=3,voc=0,
stereo=6,
--sound
keyMap={
{"left","right","x","z","c","up","down","space","tab","r"},
{},{},{},{},{},{},{},
--keyboard
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder"},
{},{},{},{},{},{},{},
--joystick
},
VKSwitch=true,
VKTrack=true,--If tracked
VKDodge=false,--If repel
VKTchW=3,--Touch Weight
VKCurW=4,--CurPos Weight
VKIcon=true,
VKAlpha=3,
--control
}
local L=setting.keyMap
for i=1,#L do
for j=1,20 do
if not L[i][j]then
L[i][j]=""
end
end
end
stat={
run=0,game=0,time=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,
b2b=0,b3b=0,pc=0,score=0,
}
--Things related to virtualkey
function restoreVirtualKey()
for i=1,#VK_org do
local B,O=virtualkey[i],VK_org[i]
B.ava=O.ava
B.x=O.x
B.y=O.y
B.r=O.r
end
end
local O,_=true,false
VK_org={--Original set,for restore VK' position
{ava=O,x=80, y=720-200, r=80},--moveLeft
{ava=O,x=320, y=720-200, r=80},--moveRight
{ava=O,x=1280-80, y=720-200, r=80},--rotRight
{ava=O,x=1280-200, y=720-80, r=80},--rotLeft
{ava=O,x=1280-200, y=720-320, r=80},--rotFlip
{ava=O,x=200, y=720-320, r=80},--hardDrop
{ava=O,x=200, y=720-80, r=80},--softDrop
{ava=O,x=1280-320, y=720-200, r=80},--hold
{ava=O,x=1280-80, y=280, r=80},--func
{ava=O,x=80, y=280, r=80},--restart
{ava=_,x=100, y=50, r=80},--insLeft
{ava=_,x=200, y=50, r=80},--insRight
{ava=_,x=300, y=50, r=80},--insDown
{ava=_,x=400, y=50, r=80},--down1
{ava=_,x=500, y=50, r=80},--down4
{ava=_,x=600, y=50, r=80},--down10
{ava=_,x=700, y=50, r=80},--dropLeft
{ava=_,x=800, y=50, r=80},--dropRight
{ava=_,x=900, y=50, r=80},--addToLeft
{ava=_,x=1000, y=50, r=80},--addToRight
}
virtualkey={}
for i=1,#VK_org do
virtualkey[i]={}
end

View File

@@ -1,31 +1,89 @@
攻击系统: 游戏方法:
消1/2/3/4攻击0/1/2/4 控制系统提供的一个个方块,每填满场地的一行就会将其消除,根据消除方式会给对手攻击(如果有对手的话)
spin1/2/3攻击2/4/6,若mini则减半 完成当前游戏模式中的目标或者是活到最后即算胜利.
b2b增加1~2(tetris)/1~3(spin)攻击
b3b满b2b效果+1额外抵挡 旋转系统:
PC其它攻击与6~8(本局内递增)取高+2额外抵挡 使用Techmino专属旋转系统,细节不赘述
连击0,0,1,1,2,2,3,3,4,4,3……
spin判定:
结合了不可移动判定和三角判定,是否为mini也与这二者有关,细节不赘述
攻击系统:
消1/2/3/4攻击0/1/2/4
spin1/2/3攻击2/4/6,若mini则减半
b2b:增加1~2(tetris)/1~3(spin)攻击
b3b:满b2b效果+1额外抵挡
PC:其它攻击与6~8(本局内递增)取高+2额外抵挡
连击:0,0,1,1,2,2,3,3,4,4,3……
back to back(B2B)点数说明:
B2B点数的范围在0~1200
在40及以上特殊消除时B2B,在1000以上特殊消除时B3B,1200封顶
消四+100
空spin加20,不超过1000
spin1~3+50/100/180 (mini*.5)
普通消除-250
1000以上空放一块-40(不减到低于1000)
攻击延迟:
消2/3的攻击生效最快,消四其次,spin攻击生效较慢,高连击生效最慢
b2b或者b3b增加攻击力的同时也会减缓一点生效速度,mini大幅减缓生效速度
抵消逻辑:
发动攻击时,若缓冲条有攻击则先用额外抵挡再用攻击力1:1抵消最先受到的攻击
没有用上的额外抵挡会被丢弃,最后剩下的攻击力会发送给对手
抵消逻辑:发动攻击时,若缓冲条有攻击则先用额外抵挡再用攻击力抵消受到的攻击,多余的攻击力会发送给对手,没有用上的额外抵挡会被丢弃。 模式说明:
竞速:
用你最快的速度消除40行(据难度而定)吧!
攻击延迟消2/3的攻击生效最快消四其次spin攻击生效较慢高连击生效最慢b2b或者b3b增加攻击力的同时也会减缓一点生效时间mini大幅增加生效时间。 马拉松:
根据总消行数,速度会逐渐加快,消除两百行吧!(easy和hard就是normal开始和结束的速度,消除200行不加速)
大师:
back to back点数说明取值范围0~1200 马拉松进化版,如果觉得马拉松太简单了久玩这个吧,每一个难度都是一层境界,L难度和U难度攒到500点数通关,final难度为上级者专属游戏模式,不建议游玩.
在40及以上特殊消除时b2b,在1000以上特殊消除时b3b,1200封顶 经典:
消四+100 使用低速控制设置在高速下落时尽可能消除更多的行,没有通关目标.(到90有"彩蛋")
空spin加20不超过1000 禅:
spin1~3+50/100/180 (mini*.5) 闲得无聊,只是想单纯地打打块地时候可以玩此模式,无重力消除200行.
普通消除-250 无尽:
1000以上空放一块-40(不减到低于1000) 无尽模式,边上会显示玩家的消行数和攻击效率,适合科研(术语).
单挑:
和一个电脑玩家单挑,带加号的和最后一个模式是超强机器人(仅限Windows平台),试试你能稳定打败多难的对手吧!
吃鸡模式: 回合制:
许多玩家同时进行一局游戏其它的是AI不是真人坚持到最后的玩家胜利。随着玩家数量的减少方块下落/垃圾生效速度/垃圾升起速度都会增加。淘汰其它玩家后可以获得一个徽章和该玩家持有的徽章,增强自己的攻击力。 玩法同单挑模式,只不过只有当一个人放下一个方块后另一个人才能放下一块.
玩家可选四个攻击模式: 仅TSD:
1.随机每次攻击后10%随机锁定一个玩家 这个模式中,玩家必须用TSD(T spin double)的方式消除,否则直接判负,你能连续打出多少个TSD呢?
2.最多徽章:攻击后或者锁定玩家死亡时锁定徽章最多的玩家 隐形:
3.最高:攻击后或者锁定玩家死亡时锁定场地最高的玩家(每秒刷新) 根据不同难度,场地内(甚至当前方块)会隐形,看看你能活多久吧!(GM难度为类似TGM3的GM Roll,用于上级者练习)
4.反击攻击所有锁定自己的玩家AOE若无则伏击随机玩家 挖掘:
每隔一定时间,系统会向场地的低端添加一行垃圾行,间隔会随着波数增加而越来越短,你能顶住几波呢?
生存:
每隔一定时间,系统会向玩家的垃圾缓冲槽中添加垃圾行,释放速度和间隔会随着波数增加而越来越短,玩家可以将其抵消也可以让其释放,尽可能活更久的时间.
防守:
系统会向玩家的垃圾缓冲槽中添加难消除的垃圾行,释放速度和间隔会随着波数增加而越来越短,玩家要尽量抵消他们来让自己存活更久.
进攻:
当玩家的攻击缓冲槽空时,系统会向玩家的垃圾缓冲槽中添加大量的垃圾行(高难度下后期甚至会远超过20),释放速度和间隔都会随着波数增加而越来越短,垃圾上涨速度也会提升.赶紧在其释放之前将攻击抵消到不会一下致命的量!
科研:
玩家只被允许做特殊消除(spin/全消/消四),在带+的难度中不允许消四,U难度下玩家甚至只被允许每一个方块都使用最简操作控制,任何违反规则的行为都会判负.
C4W练习:(或者说是4w练习)
系统直接提供给玩家"留4列"的场地,玩家可以自由练习4w消除,该技巧在某些时候实战很有用.(需要学会spin,否则意义不是很大)
全清训练:
系统会连续给玩家提供"标准开局PC套路"的场地和四个方块(不允许使用hold),玩家需要一直完成PC,否则判负.
全清挑战:
在消除一百行的限制内,你能全清几次?
49人混战:
许多玩家同时进行一局游戏其它的是AI,不是真人).随着玩家数量的减少,方块下落/垃圾生效速度/垃圾升起速度都会增加.淘汰其它玩家后可以获得一个徽章和该玩家持有的徽章,增强自己的攻击力.
玩家可选四个攻击模式:
1.随机:每次攻击后10%随机挑选一个玩家锁定
2.最多徽章:攻击后或者锁定玩家死亡时锁定徽章最多的玩家
3.最高:攻击后或者锁定玩家死亡时锁定场地最高的玩家(每秒刷新)
4.反击:攻击所有锁定自己的玩家AOE,若无则伏击随机玩家
坚持到最后的玩家就是胜利者.
99人混战:
同49人混战,只是增加到了99名玩家,难度系数也有调整,对设备的要求也较高.
干旱:
系统提供的方块序列变得奇怪了!你能消除100行不死吗,或者,多快?
多人:
使用键盘或者多个手柄(也许?)
自定义:
玩家可以自由调整下落速度等等几乎大多数设置(不包括上述各种游戏模式的特殊效果),也可以画一个场地去消除或者是作为提示模板来玩方块拼图.在拼图模式下,按功能键切换是否显示提示模板.其中打"X"的格子不允许有方块,空的格子可以是任何状态,玩家能获得的七种普通方块必须完全符合,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利.

BIN
font.ttf

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 40 KiB

BIN
image/virtualkey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

View File

@@ -1,4 +1,13 @@
local BK="返回" local BK="返回"
local actName={
"左移:","右移:",
"顺时针旋转:","逆时针旋转:","180°旋转:",
"硬降:","软降:",
"暂存:","功能键:",
"重新开始:",
"左瞬移:","右瞬移:","软降到底:","软降一格:","软降四格:","软降十格:",
"落在最左:","落在最右:","列在最左:","列在最右:",
}
return{ return{
atkModeName={"随机","徽章","击杀","反击"}, atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end, royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
@@ -67,8 +76,11 @@ return{
setting_sound="声音设置", setting_sound="声音设置",
musicRoom="音乐室", musicRoom="音乐室",
nowPlaying="正在播放:", nowPlaying="正在播放:",
VKTchW="触摸点权重",
VKOrgW="原始点权重",
VKCurW="当前点权重",
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"}, actName=actName,
modeName={ modeName={
[0]="自定义", [0]="自定义",
"竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形", "竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形",
@@ -128,7 +140,10 @@ return{
"使用love2d引擎制作", "使用love2d引擎制作",
"有疑问?先看设置有没有你想要的", "有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~", "有建议的话可以把信息反馈给作者~",
"不要按F8",
"秘密代码:626",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机获得最佳体验",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
}, },
stat={ stat={
@@ -149,6 +164,8 @@ return{
"B2B数:", "B2B数:",
"PC数:", "PC数:",
"效率:", "效率:",
"多余操作:",
"最简操作率:",
}, },
help={ help={
"好像也没啥好帮助的吧?就当是关于了", "好像也没啥好帮助的吧?就当是关于了",
@@ -176,7 +193,7 @@ return{
warning="禁 止 私 自 传 播", warning="禁 止 私 自 传 播",
WidgetText={ WidgetText={
main={ main={
lang="", lang="-Lang",
qplay="快速开始", qplay="快速开始",
play="开始", play="开始",
setting="设置", setting="设置",
@@ -209,11 +226,11 @@ return{
start1="消除开始", start1="消除开始",
start2="拼图开始", start2="拼图开始",
draw="画图(D)", draw="画图(D)",
set1="40行", set1="40行(1)",
set2="1v1", set2="1v1(2)",
set3="无尽", set3="无尽(3)",
set4="隐形", set4="隐形(4)",
set5="极限", set5="极限(5)",
back=BK, back=BK,
}, },
draw={ draw={
@@ -240,6 +257,7 @@ return{
pause={ pause={
resume= "继续", resume= "继续",
restart="重新开始", restart="重新开始",
setting="设置",
quit= "退出", quit= "退出",
}, },
setting_game={ setting_game={
@@ -251,7 +269,8 @@ return{
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
quickR="快速重新开始", quickR="快速重新开始",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
ctrl="控制设置", fine="极简操作提示音",
ctrl="键位设置",
touch="触屏设置", touch="触屏设置",
back=BK, back=BK,
}, },
@@ -279,18 +298,36 @@ return{
bgm="音乐", bgm="音乐",
vib="震动", vib="震动",
voc="语音", voc="语音",
stereo="双声道",
back=BK, back=BK,
}, },
setting_control={ setting_key={
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end, hide="显示虚拟按键",
track="按键自动跟踪",
tkset="跟踪设置",
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.VKAlpha.."0%"end,
icon="图标", icon="图标",
size="大小", size="大小",
toggle="开关",
back=BK,
},
setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
b5= actName[5],b6=actName[6],b7=actName[7],b8=actName[8],
b9= actName[9],b10=actName[10],b11=actName[11],b12=actName[12],
b13=actName[13],b14=actName[14],b15=actName[15],b16=actName[16],
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="标准",
pro="专业",
back=BK,
},
setting_trackSetting={
VKDodge="自动避让",
back=BK, back=BK,
}, },
help={ help={

View File

@@ -1,4 +1,13 @@
local BK="返回" local BK="返回"
local actName={
"左移:","右移:",
"顺时针旋转:","逆时针旋转:","180°旋转:",
"硬降:","软降:",
"暂存:","功能键:",
"重新开始:",
"左瞬移:","右瞬移:","软降到底:","软降一格:","软降四格:","软降十格:",
"落在最左:","落在最右:","列在最左:","列在最右:",
}
return{ return{
atkModeName={"随机","徽章","击杀","反击"}, atkModeName={"随机","徽章","击杀","反击"},
royale_remain=function(n)return"剩余 "..n.." 名玩家"end, royale_remain=function(n)return"剩余 "..n.." 名玩家"end,
@@ -67,8 +76,11 @@ return{
setting_sound="声音设置", setting_sound="声音设置",
musicRoom="音乐室", musicRoom="音乐室",
nowPlaying="正在播放:", nowPlaying="正在播放:",
VKTchW="触摸点权重",
VKOrgW="原始点权重",
VKCurW="当前点权重",
actName={"左移:","右移:","顺时针旋转:","逆时针旋转:","180°旋转","硬降:","软降:","暂存:","功能键:","重新开始:","左瞬移:","右瞬移:","软降到底:"}, actName=actName,
modeName={ modeName={
[0]="自定义", [0]="自定义",
"竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形", "竞速","马拉松","大师","经典","","无尽","单挑","回合制","仅TSD","隐形",
@@ -128,7 +140,10 @@ return{
"使用love2d引擎制作", "使用love2d引擎制作",
"有疑问?先看设置有没有你想要的", "有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~", "有建议的话可以把信息反馈给作者~",
"不要按F8",
"秘密代码:626",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机获得最佳体验",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
}, },
stat={ stat={
@@ -149,6 +164,8 @@ return{
"满贯数:", "满贯数:",
"全清数:", "全清数:",
"效率:", "效率:",
"多余操作:",
"最简操作率:",
}, },
help={ help={
"好像也没啥好帮助的吧?就当是关于了", "好像也没啥好帮助的吧?就当是关于了",
@@ -176,7 +193,7 @@ return{
warning="禁 止 私 自 传 播", warning="禁 止 私 自 传 播",
WidgetText={ WidgetText={
main={ main={
lang="中文", lang="-Lang",
qplay="快速开始", qplay="快速开始",
play="开始", play="开始",
setting="设置", setting="设置",
@@ -209,11 +226,11 @@ return{
start1="消除开始", start1="消除开始",
start2="拼图开始", start2="拼图开始",
draw="画图(D)", draw="画图(D)",
set1="40行", set1="40行(1)",
set2="1v1", set2="1v1(2)",
set3="无尽", set3="无尽(3)",
set4="隐形", set4="隐形(4)",
set5="极限", set5="极限(5)",
back=BK, back=BK,
}, },
draw={ draw={
@@ -240,6 +257,7 @@ return{
pause={ pause={
resume= "继续", resume= "继续",
restart="重新开始", restart="重新开始",
setting="设置",
quit= "退出", quit= "退出",
}, },
@@ -252,7 +270,8 @@ return{
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
quickR="快速重新开始", quickR="快速重新开始",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
ctrl="控制设置", fine="极简操作提示音",
ctrl="键位设置",
touch="触屏设置", touch="触屏设置",
back=BK, back=BK,
}, },
@@ -280,18 +299,36 @@ return{
bgm="音乐", bgm="音乐",
vib="震动", vib="震动",
voc="语音", voc="语音",
stereo="双声道",
back=BK, back=BK,
}, },
setting_control={ setting_key={
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide=function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end, hide="显示虚拟按键",
track="按键自动跟踪",
tkset="跟踪设置",
default="默认组合", default="默认组合",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.VKAlpha.."0%"end,
icon="图标", icon="图标",
size="大小", size="大小",
toggle="开关",
back=BK,
},
setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
b5= actName[5],b6=actName[6],b7=actName[7],b8=actName[8],
b9= actName[9],b10=actName[10],b11=actName[11],b12=actName[12],
b13=actName[13],b14=actName[14],b15=actName[15],b16=actName[16],
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="标准",
pro="专业",
back=BK,
},
setting_trackSetting={
VKDodge="自动避让",
back=BK, back=BK,
}, },
help={ help={
@@ -309,4 +346,4 @@ return{
back=BK, back=BK,
}, },
}, },
}--部分译文 }

View File

@@ -1,4 +1,11 @@
local BK="Back" local BK="Back"
local actName={
"Move Left:","Move Right:",
"Rotate Right:","Rotate Left:","Rotate Flip:",
"Hard Drop:","Soft Drop:","Hold:","Function:","Restart:",
"Instant Left:","Instant Right:","Ins Down:","Down 1:","Down 4:","Down 10:",
"Left Drop:","Right Drop:","Left INS:","Right INS:",
}
return{ return{
atkModeName={"Random","Badges","K.O.s","Counters"}, atkModeName={"Random","Badges","K.O.s","Counters"},
royale_remain=function(n)return n.." Players Remain"end, royale_remain=function(n)return n.." Players Remain"end,
@@ -67,8 +74,11 @@ return{
setting_sound="Sound setting", setting_sound="Sound setting",
musicRoom="Music Room", musicRoom="Music Room",
nowPlaying="Now Playing:", nowPlaying="Now Playing:",
VKTchW="Touch weight",
VKOrgW="Origion weight",
VKCurW="CurPos weight",
actName={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip:","Hard Drop:","Soft Drop:","Hold:","Function:","Restart:","Instant Left:","Instant Right:","Ins Down:"}, actName=actName,
modeName={ modeName={
[0]="Custom", [0]="Custom",
"Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","Round","TSD-only","Blind", "Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","Round","TSD-only","Blind",
@@ -128,8 +138,11 @@ return{
"Powered by love2d", "Powered by love2d",
"Find out what's in the setting!", "Find out what's in the setting!",
"Any suggestions to author!", "Any suggestions to author!",
"Techmino=Technique+tetromino", "DO NOT PRESS F8",
"Secret code:626",
"Techmino=Technique+Tetromino",
"CLASSIC SEXY RUSSIAN BLOCKS", "CLASSIC SEXY RUSSIAN BLOCKS",
"Headphones for better experience",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
}, },
stat={ stat={
@@ -150,6 +163,8 @@ return{
"B2B:", "B2B:",
"PC:", "PC:",
"Efficiency:", "Efficiency:",
"Finesse error:",
"Finesse rate:",
}, },
help={ help={
"I don't think you need \"help\".", "I don't think you need \"help\".",
@@ -177,7 +192,7 @@ Lib used:
warning="DO NOT DISTRIBUTE", warning="DO NOT DISTRIBUTE",
WidgetText={ WidgetText={
main={ main={
lang="English", lang="文-Lang",
qplay="Qplay", qplay="Qplay",
play="Play", play="Play",
setting="Settings", setting="Settings",
@@ -210,11 +225,11 @@ Lib used:
start1="Clear Start", start1="Clear Start",
start2="Puzzle Start", start2="Puzzle Start",
draw="Draw(D)", draw="Draw(D)",
set1="40L", set1="40L(1)",
set2="1v1", set2="1v1(2)",
set3="infinite", set3="infinite(3)",
set4="blind", set4="blind(4)",
set5="master", set5="master(5)",
back=BK, back=BK,
}, },
draw={ draw={
@@ -241,6 +256,7 @@ Lib used:
pause={ pause={
resume="Resume", resume="Resume",
restart="Restart", restart="Restart",
setting="Setting",
quit="Quit", quit="Quit",
}, },
setting_game={ setting_game={
@@ -252,7 +268,8 @@ Lib used:
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
quickR="Quick restart", quickR="Quick restart",
swap="Combo key to change ATK mode", swap="Combo key to change ATK mode",
ctrl="Control Setting", fine="Finesse error SFX",
ctrl="Key Setting",
touch="Touch Setting", touch="Touch Setting",
back=BK, back=BK,
}, },
@@ -280,18 +297,36 @@ Lib used:
bgm="BGM", bgm="BGM",
vib="VIB", vib="VIB",
voc="VOC", voc="VOC",
stereo="Stereo",
back=BK, back=BK,
}, },
setting_control={ setting_key={
back=BK, back=BK,
}, },
setting_touch={ setting_touch={
hide=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end, hide="Show Virtual Key",
track="Auto track",
tkset="Track setting",
default="Defaults", default="Defaults",
snap=function()return text.snapLevelName[snapLevel]end, snap=function()return text.snapLevelName[snapLevel]end,
alpha=function()return setting.virtualkeyAlpha.."0%"end, alpha=function()return setting.VKAlpha.."0%"end,
icon="Icon", icon="Icon",
size="Size", size="Size",
toggle="Toggle",
back=BK,
},
setting_touchSwitch={
b1= actName[1],b2=actName[2],b3=actName[3],b4=actName[4],
b5= actName[5],b6=actName[6],b7=actName[7],b8=actName[8],
b9= actName[9],b10=actName[10],b11=actName[11],b12=actName[12],
b13=actName[13],b14=actName[14],b15=actName[15],b16=actName[16],
b17=actName[17],b18=actName[18],b19=actName[19],b20=actName[20],
norm="Normal",
pro="Professioanl",
back=BK,
},
setting_trackSetting={
VKDodge="Auto Dodge",
back=BK, back=BK,
}, },
help={ help={

471
list.lua
View File

@@ -1,6 +1,13 @@
local mobile=system=="Android"or system=="iOS" local mobile=system=="Android"or system=="iOS"
actName={
actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","func","restart","insLeft","insRight","insDown"} "moveLeft","moveRight",
"rotRight","rotLeft","rotFlip",
"hardDrop","softDrop",
"hold","func",
"restart",
"insLeft","insRight","insDown","down1","down4","down10",
"dropLeft","dropRight","addLeft","addRight",--Super contorl system
}
color={ color={
red={1,0,0}, red={1,0,0},
green={0,1,0}, green={0,1,0},
@@ -50,6 +57,8 @@ blockColor={
} }
sfx={ sfx={
"welcome", "welcome",
"error","error_long",
--Stereo sfxs(cannot set position)
"button","swipe", "button","swipe",
"ready","start","win","fail","collect", "ready","start","win","fail","collect",
"move","rotate","rotatekick","hold", "move","rotate","rotatekick","hold",
@@ -61,6 +70,7 @@ sfx={
"spin_0","spin_1","spin_2","spin_3", "spin_0","spin_1","spin_2","spin_3",
"emit","blip_1","blip_2", "emit","blip_1","blip_2",
"perfectclear", "perfectclear",
--Mono sfxs
} }
bgm={ bgm={
"blank", "blank",
@@ -156,7 +166,7 @@ customRange={
RCPB={10,33,200,33,105,5,105,60} RCPB={10,33,200,33,105,5,105,60}
snapLevelValue={1,10,20,40,60,80} snapLevelValue={1,10,20,40,60,80}
up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
modeID={ modeID={
[0]="custom", [0]="custom",
"sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind", "sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind",
@@ -170,7 +180,7 @@ modeLevel={
classic={"CTWC"}, classic={"CTWC"},
zen={"NORMAL"}, zen={"NORMAL"},
infinite={"NORMAL","EXTRA"}, infinite={"NORMAL","EXTRA"},
solo={"EASY","EASY+","NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE"}, solo={"EASY","EASY+","NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE","ULTIMATE+"},
round={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, round={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
tsd={"NORMAL","HARD"}, tsd={"NORMAL","HARD"},
blind={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"}, blind={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"},
@@ -178,7 +188,7 @@ modeLevel={
survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, survivor={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
defender={"NORMAL","LUNATIC"}, defender={"NORMAL","LUNATIC"},
attacker={"HARD","ULTIMATE"}, attacker={"HARD","ULTIMATE"},
tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+",}, tech={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE","ULTIMATE+",},
c4wtrain={"NORMAL","LUNATIC"}, c4wtrain={"NORMAL","LUNATIC"},
pctrain={"NORMAL","EXTRA"}, pctrain={"NORMAL","EXTRA"},
pcchallenge={"NORMAL","HARD","LUNATIC"}, pcchallenge={"NORMAL","HARD","LUNATIC"},
@@ -203,65 +213,76 @@ for i=1,7 do blocks[i+7]=blocks[i]end
local virtualkeySet={ local virtualkeySet={
{ {
{80,720-200,6400,80},--moveLeft {1, 80, 720-200, 80},--moveLeft
{320,720-200,6400,80},--moveRight {2, 320, 720-200, 80},--moveRight
{1280-80,720-200,6400,80},--rotRight {3, 1280-80, 720-200, 80},--rotRight
{1280-200,720-80,6400,80},--rotLeft {4, 1280-200, 720-80, 80},--rotLeft
{1280-200,720-320,6400,80},--rotFlip {5, 1280-200, 720-320, 80},--rotFlip
{200,720-320,6400,80},--hardDrop {6, 200, 720-320, 80},--hardDrop
{200,720-80,6400,80},--softDrop {7, 200, 720-80, 80},--softDrop
{1280-320,720-200,6400,80},--hold {8, 1280-320, 720-200, 80},--hold
{1280-80,280,6400,80},--func {9, 1280-80, 280, 80},--func
{80,280,6400,80},--restart {10,80, 280, 80},--restart
},--Farter's set 3 },--Farter's set,thanks
{ {
{1280-320,720-200,6400,80},--moveLeft {1, 1280-320, 720-200, 80},--moveLeft
{1280-80,720-200,6400,80},--moveRight {2, 1280-80, 720-200, 80},--moveRight
{200,720-80,6400,80},--rotRight {3, 200, 720-80, 80},--rotRight
{80,720-200,6400,80},--rotLeft {4, 80, 720-200, 80},--rotLeft
{200,720-320,6400,80},--rotFlip {5, 200, 720-320, 80},--rotFlip
{1280-200,720-320,6400,80},--hardDrop {6, 1280-200, 720-320, 80},--hardDrop
{1280-200,720-80,6400,80},--softDrop {7, 1280-200, 720-80, 80},--softDrop
{320,720-200,6400,80},--hold {8, 320, 720-200, 80},--hold
{80,280,6400,80},--func {9, 80, 280, 80},--func
{1280-80,280,6400,80},--restart {10,1280-80, 280, 80},--restart
},--Mirrored farter's set 3
},--Mirrored farter's set,sknaht
{ {
{80,720-80,6400,80},--moveLeft {1, 80, 720-80, 80},--moveLeft
{240,720-80,6400,80},--moveRight {2, 240, 720-80, 80},--moveRight
{1280-240,720-80,6400,80},--rotRight {3, 1280-240, 720-80, 80},--rotRight
{1280-400,720-80,6400,80},--rotLeft {4, 1280-400, 720-80, 80},--rotLeft
{1280-240,720-240,6400,80},--rotFlip {5, 1280-240, 720-240, 80},--rotFlip
{1280-80,720-80,6400,80},--hardDrop {6, 1280-80, 720-80, 80},--hardDrop
{1280-80,720-240,6400,80},--softDrop {7, 1280-80, 720-240, 80},--softDrop
{1280-80,720-400,6400,80},--hold {8, 1280-80, 720-400, 80},--hold
{80,360,6400,80},--func {9, 80, 360, 80},--func
{80,80,6400,80},--restart {10,80, 80, 80},--restart
},--Author's set },--Author's set,not recommend
{ {
{1280-400,720-80,6400,80},--moveLeft {1, 1280-400, 720-80, 80},--moveLeft
{1280-80,720-80,6400,80},--moveRight {2, 1280-80, 720-80, 80},--moveRight
{240,720-80,6400,80},--rotRight {3, 240, 720-80, 80},--rotRight
{80,720-80,6400,80},--rotLeft {4, 80, 720-80, 80},--rotLeft
{240,720-240,6400,80},--rotFlip {5, 240, 720-240, 80},--rotFlip
{1280-240,720-240,6400,80},--hardDrop {6, 1280-240, 720-240, 80},--hardDrop
{1280-240,720-80,6400,80},--softDrop {7, 1280-240, 720-80, 80},--softDrop
{1280-80,720-240,6400,80},--hold {8, 1280-80, 720-240, 80},--hold
{80,720-240,6400,80},--func {9, 80, 720-240, 80},--func
{80,320,6400,80},--restart {10,80, 320, 80},--restart
},--Keyboard set },--Keyboard set
{ {
{1200-370,40,1600,40},--moveLeft {10,70, 50,27},--restart
{1200-280,40,1600,40},--moveRight {9, 130, 50,27},--func
{1200-530,40,1600,40},--rotRight {4, 190, 50,27},--rotLeft
{1200-610,40,1600,40},--rotLeft {3, 250, 50,27},--rotRight
{1200-450,40,1600,40},--rotFlip {5, 310, 50,27},--rotFlip
{1200-50,40,1600,40},--hardDrop {1, 370, 50,27},--moveLeft
{1200-130,40,1600,40},--softDrop {2, 430, 50,27},--moveRight
{1200-210,40,1600,40},--hold {8, 490, 50,27},--hold
{1200-690,40,1600,40},--func {7, 550, 50,27},--softDrop1
{1200-770,40,1600,40},--restart {6, 610, 50,27},--hardDrop
},--PC key feedback {11,670, 50,27},--insLeft
{12,730, 50,27},--insRight
{13,790, 50,27},--insDown
{14,850, 50,27},--down1
{15,910, 50,27},--down4
{16,970, 50,27},--down10
{17,1030, 50,27},--dropLeft
{18,1090, 50,27},--dropRight
{19,1150, 50,27},--addLeft
{20,1210, 50,27},--addRight
},--PC key feedback(top&in a row)
} }
local customSet={ local customSet={
{20,20,1,1,7,1,1,1,3,4,1,2,3}, {20,20,1,1,7,1,1,1,3,4,1,2,3},
@@ -277,89 +298,129 @@ local function useDefaultSet(n)
curBG=customRange.bg[customSel[12]] curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]]) BGM(customRange.bgm[customSel[13]])
end end
--λFuncs for widgets
local function SETdisp(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()
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 C=color
Widget={ Widget={
load={},intro={},quit={}, load={},intro={},quit={},
main={ main={
play= newButton(150,280,200,160,color.red, 60,function()gotoScene("mode")end, nil,"setting"), play= newButton(150,280,200,160,C.red, 60,function()scene.push()scene.swapTo("mode")end, nil,"setting"),
setting=newButton(370,280,200,160,color.lightBlue, 50,function()gotoScene("setting_game")end, nil,"music"), setting=newButton(370,280,200,160,C.lightBlue, 50,function()scene.push()scene.swapTo("setting_game")end, nil,"music"),
music= newButton(590,280,200,160,color.lightPurple,37,function()gotoScene("music")end, nil,"help"), music= newButton(590,280,200,160,C.lightPurple,37,function()scene.push()scene.swapTo("music")end, nil,"help"),
help= newButton(150,460,200,160,color.yellow, 55,function()gotoScene("help")end, nil,"stat"), help= newButton(150,460,200,160,C.yellow, 55,function()scene.push()scene.swapTo("help")end, nil,"stat"),
stat= newButton(370,460,200,160,color.cyan, 48,function()gotoScene("stat")end, nil,"qplay"), stat= newButton(370,460,200,160,C.cyan, 48,function()scene.push()scene.swapTo("stat")end, nil,"qplay"),
qplay= newButton(540,415,100,70,color.lightGreen, 28,function()loadGame(modeSel,levelSel)end, nil,"lang"), qplay= newButton(540,415,100,70,C.lightGreen, 28,function()scene.push()loadGame(modeSel,levelSel)end, nil,"lang"),
lang= newButton(590,505,200,70,color.lightRed, 50,function() lang= newButton(590,505,200,70,C.lightRed, 50,function()
setting.lang=setting.lang%#langName+1 setting.lang=setting.lang%#langName+1
swapLanguage(setting.lang) swapLanguage(setting.lang)
end,nil,"quit"), end,nil,"quit"),
quit= newButton(370,620,280,100,color.lightGrey, 60,function()gotoScene("quit")end, nil,"play"), quit= newButton(370,620,280,100,C.lightGrey, 60,function()scene.swapTo("quit")end, nil,"play"),
}, },
mode={ mode={
up= newButton(1000,210,200,140,color.white, 80,function()love.keypressed("up")end,function()return modeSel==1 end), up= newButton(1000, 210,200,140,C.white, 80,pressKey("up"), function()return modeSel==1 end),
down= newButton(1000,430,200,140,color.white, 80,function()love.keypressed("down")end,function()return modeSel==#modeID end), down= newButton(1000, 430,200,140,C.white, 80,pressKey("down"), function()return modeSel==#modeID end),
left= newButton(190, 160,100,80, color.white,40,function()love.keypressed("left")end,function()return levelSel==1 end), left= newButton(190, 160,100,80, C.white, 40,pressKey("left"), function()return levelSel==1 end),
right= newButton(350, 160,100,80, color.white,40,function()love.keypressed("right")end,function()return levelSel==#modeLevel[modeID[modeSel]]end), right= newButton(350, 160,100,80, C.white, 40,pressKey("right"), function()return levelSel==#modeLevel[modeID[modeSel]]end),
start= newButton(1000,600,250,100,color.green, 50,function()loadGame(modeSel,levelSel)end), start= newButton(1000, 600,250,100,C.green, 50,function()scene.push()loadGame(modeSel,levelSel)end),
custom= newButton(275, 420,200,90, color.yellow,40,function()gotoScene("custom")end), custom= newButton(275, 420,200,90, C.yellow, 40,function()scene.push()scene.swapTo("custom")end),
back= newButton(640, 630,230,90, color.white,45,back), back= newButton(640, 630,230,90, C.white, 45,scene.back),
}, },
music={ music={
bgm= newSlider(760,80,400,8,40,nil,function()return setting.bgm end,function(i)setting.bgm=i;BGM(bgmPlaying)end), bgm= newSlider(760, 80,400,10,40,nil,SETdisp("bgm"),function(i)setting.bgm=i;BGM(bgmPlaying)end),
up= newButton(1100,200,120,120,color.white,60,function()love.keypressed("up")end), up= newButton(1100, 200,120,120,C.white,60,pressKey("up")),
play= newButton(1100,340,120,120,color.white,40,function()love.keypressed("space")end,function()return setting.bgm==0 end), play= newButton(1100, 340,120,120,C.white,40,pressKey("space"),function()return setting.bgm==0 end),
down= newButton(1100,480,120,120,color.white,60,function()love.keypressed("down")end), down= newButton(1100, 480,120,120,C.white,60,pressKey("down")),
back= newButton(640, 630,230,90, color.white,45,back), back= newButton(640, 630,230,90, C.white,45,scene.back),
}, },
custom={ custom={
up= newButton(1000,220,100,100,color.white, 50,function()sel=(sel-2)%#customID+1 end), up= newButton(1000, 220,100,100,C.white, 50,function()sel=(sel-2)%#customID+1 end),
down= newButton(1000,460,100,100,color.white, 50,function()sel=sel%#customID+1 end), down= newButton(1000, 460,100,100,C.white, 50,function()sel=sel%#customID+1 end),
left= newButton(880, 340,100,100,color.white, 50,function()love.keypressed("left")end), left= newButton(880, 340,100,100,C.white, 50,pressKey("left")),
right= newButton(1120,340,100,100,color.white, 50,function()love.keypressed("right")end), right= newButton(1120, 340,100,100,C.white, 50,pressKey("right")),
start1= newButton(880, 580,220,70, color.green, 40,function()loadGame(0,1)end), start1= newButton(880, 580,220,70, C.green, 40,function()scene.push()loadGame(0,1)end),
start2= newButton(1120,580,220,70, color.lightPurple, 40,function()loadGame(0,2)end), start2= newButton(1120, 580,220,70, C.lightPurple, 40,function()scene.push()loadGame(0,2)end),
draw= newButton(1000,90, 190,85, color.cyan, 40,function()gotoScene("draw")end), draw= newButton(1000, 90, 190,85, C.cyan, 40,function()scene.push()scene.swapTo("draw")end),
set1= newButton(640, 160,240,75, color.lightRed, 40,function()useDefaultSet(1)end), set1= newButton(640, 160,240,75, C.lightRed, 40,function()useDefaultSet(1)end),
set2= newButton(640, 250,240,75, color.lightRed, 40,function()useDefaultSet(2)end), set2= newButton(640, 250,240,75, C.lightRed, 40,function()useDefaultSet(2)end),
set3= newButton(640, 340,240,75, color.lightRed, 40,function()useDefaultSet(3)end), set3= newButton(640, 340,240,75, C.lightRed, 40,function()useDefaultSet(3)end),
set4= newButton(640, 430,240,75, color.lightRed, 40,function()useDefaultSet(4)end), set4= newButton(640, 430,240,75, C.lightRed, 40,function()useDefaultSet(4)end),
set5= newButton(640, 520,240,75, color.lightRed, 40,function()useDefaultSet(5)end), set5= newButton(640, 520,240,75, C.lightRed, 40,function()useDefaultSet(5)end),
back= newButton(640, 630,180,60, color.white, 40,back), back= newButton(640, 630,180,60, C.white, 40,scene.back),
}, },
draw={ draw={
any= newButton(700, 80, 120,120,color.lightGrey, 45,function()pen=0 end), block1= newButton(920, 80, 120,120,C.red, 65,setPen(1)),
block1= newButton(840, 80, 120,120,color.red, 65,function()pen=1 end), block2= newButton(1060, 80, 120,120,C.green, 65,setPen(2)),
block2= newButton(980, 80, 120,120,color.green, 65,function()pen=2 end), block3= newButton(1200, 80, 120,120,C.orange, 65,setPen(3)),
block3= newButton(1120,80, 120,120,color.orange, 65,function()pen=3 end), block4= newButton(920, 220,120,120,C.blue, 65,setPen(4)),
block4= newButton(840, 220,120,120,color.blue, 65,function()pen=4 end), block5= newButton(1060, 220,120,120,C.magenta, 65,setPen(5)),
block5= newButton(980, 220,120,120,color.magenta, 65,function()pen=5 end), block6= newButton(1200, 220,120,120,C.yellow, 65,setPen(6)),
block6= newButton(1120,220,120,120,color.yellow, 65,function()pen=6 end), block7= newButton(920, 360,120,120,C.cyan, 65,setPen(7)),
block7= newButton(840, 360,120,120,color.cyan, 65,function()pen=7 end), gb1= newButton(1060, 360,120,120,C.darkGrey, 65,setPen(9)),
gb1= newButton(980, 360,120,120,color.darkGrey, 65,function()pen=9 end), gb2= newButton(1200, 360,120,120,C.grey, 65,setPen(10)),
gb2= newButton(1120,360,120,120,color.grey, 65,function()pen=10 end), gb3= newButton(920, 500,120,120,C.darkPurple, 65,setPen(11)),
gb3= newButton(840, 500,120,120,color.darkPurple, 65,function()pen=11 end), gb4= newButton(1060, 500,120,120,C.darkRed, 65,setPen(12)),
gb4= newButton(980, 500,120,120,color.darkRed, 65,function()pen=12 end), gb5= newButton(1200, 500,120,120,C.darkGreen, 65,setPen(13)),
gb5= newButton(1120,500,120,120,color.darkGreen, 65,function()pen=13 end), clear= newButton(780, 80, 120,120,C.white, 45,pressKey("delete")),
space= newButton(840, 640,120,120,color.grey, 70,function()pen=-1 end), any= newButton(780, 220,120,120,C.lightGrey, 45,setPen(0)),
clear= newButton(1120,640,120,120,color.white, 45,function()love.keypressed("delete")end), space= newButton(780, 360,120,120,C.grey, 70,setPen(-1)),
back= newButton(1235,45, 80, 80, color.white, 35,back), back= newButton(1200, 640,120,120,C.white, 40,scene.back),
}, },
play={ play={
pause= newButton(1235,45,80,80,color.white,30,pauseGame), pause= newButton(1235,45,80,80,C.white,30,pauseGame),
}, },
pause={ pause={
resume= newButton(640,290,240,100,color.white,50,resumeGame), resume= newButton(640,290,240,100,C.white,50,resumeGame),
restart=newButton(640,445,240,100,color.white,50,function() restart=newButton(640,445,240,100,C.white,50,function()
clearTask("play") clearTask("play")
updateStat() updateStat()
resetGameData() resetGameData()
gotoScene("play","none") scene.swapTo("play","none")
end), end),
quit= newButton(640,600,240,100,color.white,50,back), setting=newButton(1150,80,200,100,C.yellow,45,function()
scene.push()
scene.swapTo("setting_sound")
end),
quit= newButton(640,600,240,100,C.white,50,scene.back),
}, },
setting_game={ setting_game={
graphic=newButton(200,80,240,80,color.lightGreen,40,function()gotoScene("setting_graphic")end, nil,"sound"), graphic=newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_graphic")end, nil,"sound"),
sound= newButton(1080,80,240,80,color.lightGreen,40,function()gotoScene("setting_sound")end, nil,"dasD"), sound= newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_sound")end, nil,"dasD"),
dasD= newButton(180,230,50,50,color.white,40,function()setting.das=(setting.das-1)%31 end,nil,"dasU"), dasD= newButton(180,230,50,50,C.white,40,function()setting.das=(setting.das-1)%31 end, nil,"dasU"),
dasU= newButton(400,230,50,50,color.white,40,function()setting.das=(setting.das+1)%31 end,nil,"arrD"), dasU= newButton(400,230,50,50,C.white,40,function()setting.das=(setting.das+1)%31 end, nil,"arrD"),
arrD= newButton(500,230,50,50,color.white,40,function() arrD= newButton(500,230,50,50,C.white,40,function()
setting.arr=(setting.arr-1)%16 setting.arr=(setting.arr-1)%16
if setting.arr>setting.das then if setting.arr>setting.das then
setting.das=setting.arr setting.das=setting.arr
@@ -367,7 +428,7 @@ Widget={
SFX("blip_1",.4) SFX("blip_1",.4)
end end
end,nil,"arrU"), end,nil,"arrU"),
arrU= newButton(720,230,50,50,color.white,40,function() arrU= newButton(720,230,50,50,C.white,40,function()
setting.arr=(setting.arr+1)%16 setting.arr=(setting.arr+1)%16
if setting.arr>setting.das then if setting.arr>setting.das then
setting.das=setting.arr setting.das=setting.arr
@@ -375,105 +436,149 @@ Widget={
SFX("blip_1",.4) SFX("blip_1",.4)
end end
end,nil,"sddasD"), end,nil,"sddasD"),
sddasD= newButton(180,340,50,50,color.white,40,function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"), sddasD= newButton(180,340,50,50,C.white,40, function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"),
sddasU= newButton(400,340,50,50,color.white,40,function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"), sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"),
sdarrD= newButton(500,340,50,50,color.white,40,function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"), sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"),
sdarrU= newButton(720,340,50,50,color.white,40,function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"), sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"),
quickR= newSwitch(560,440,40,function()return setting.quickR end,function()setting.quickR=not setting.quickR end, nil,"swap"), quickR= newSwitch(560,430,40,SETdisp("quickR"), SETrev("quickR"), nil,"swap"),
swap= newSwitch(560,530,25,function()return setting.swap end,function()setting.swap=not setting.swap end, nil,"ctrl"), swap= newSwitch(560,510,25,SETdisp("swap"), SETrev("swap"), nil,"fine"),
ctrl= newButton(1020,230,320,80,color.white,40,function()gotoScene("setting_control")end, nil,"touch"), fine= newSwitch(560,590,25,SETdisp("fine"), SETrev("fine"), nil,"ctrl"),
touch= newButton(1020,340,320,80,color.white,40,function()gotoScene("setting_touch")end, nil,"back"), ctrl= newButton(1020,230,320,80,C.white,40,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"),
back= newButton(1160,600,160,160,color.white,55,back,nil,"graphic"), touch= newButton(1020,340,320,80,C.white,40,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"),
back= newButton(1160,600,160,160,C.white,55,scene.back,nil,"graphic"),
}, },
setting_graphic={ setting_graphic={
sound= newButton(200,80,240,80,color.lightGreen,40,function()gotoScene("setting_sound")end, nil,"game"), sound= newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_sound")end, nil,"game"),
game= newButton(1080,80,240,80,color.lightGreen,40,function()gotoScene("setting_game")end, nil,"ghost"), game= newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_game")end, nil,"ghost"),
ghost= newSwitch(310,180,40,function()return setting.ghost end, function()setting.ghost= not setting.ghost end, nil,"center"), ghost= newSwitch(310,180,40,SETdisp("ghost"), SETdisp("ghost"), nil,"center"),
center= newSwitch(580,180,40,function()return setting.center end, function()setting.center= not setting.center end, nil,"smo"), center= newSwitch(580,180,40,SETdisp("center"), SETdisp("center"), nil,"smo"),
smo= newSwitch(310,260,25,function()return setting.smo end, function()setting.smo= not setting.smo end, nil,"grid"), smo= newSwitch(310,260,25,SETdisp("smo"), SETdisp("smo"), nil,"grid"),
grid= newSwitch(580,260,40,function()return setting.grid end, function()setting.grid= not setting.grid end, nil,"dropFX"), grid= newSwitch(580,260,40,SETdisp("grid"), SETdisp("grid"), nil,"dropFX"),
dropFX= newSlider(310,350,373,3,40,nil,function()return setting.dropFX end, function(i)setting.dropFX=i end, nil,"shakeFX"), dropFX= newSlider(310,350,373,3,40,nil,SETdisp("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
shakeFX=newSlider(310,430,373,3,40,nil,function()return setting.shakeFX end, function(i)setting.shakeFX=i end, nil,"atkFX"), shakeFX=newSlider(310,430,373,3,40,nil,SETdisp("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
atkFX= newSlider(310,510,373,3,40,nil,function()return setting.atkFX end, function(i)setting.atkFX=i end, nil,"frame"), atkFX= newSlider(310,510,373,3,40,nil,SETdisp("atkFX"), SETsto("atkFX"), nil,"frame"),
frame= newSlider(310,590,373,10,40,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"), frame= newSlider(310,590,373,10,40,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"),
fullscreen=newSwitch(990,180,40,function()return setting.fullscreen end,function() fullscreen=newSwitch(990,180,40,SETdisp("fullscreen"),function()
setting.fullscreen=not setting.fullscreen setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then if not setting.fullscreen then
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end end
end,nil,"bg"), end,nil,"bg"),
bg= newSwitch(990,250,40,function()return setting.bg end,function()setting.bg=not setting.bg end, nil,"bgblock"), bg= newSwitch(990,250,40,SETdisp("bg"),SETrev("bg"),nil,"bgblock"),
bgblock=newSwitch(990,330,40,function()return setting.bgblock end,function() bgblock=newSwitch(990,330,40,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end
setting.bgblock=not setting.bgblock--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end skin= newButton(860,470,120,60,C.white,40,function()
end,nil,"skin"),
skin= newButton(860,470,120,60,color.white,40,function()
setting.skin=setting.skin%8+1 setting.skin=setting.skin%8+1
changeBlockSkin(setting.skin) changeBlockSkin(setting.skin)
end,nil,"back"), end,nil,"back"),
back= newButton(1160,600,160,160,color.white,55,back,nil,"sound"), back= newButton(1160,600,160,160,C.white,55,scene.back,nil,"sound"),
}, },
setting_sound={ setting_sound={
game= newButton(200,80,240,80,color.lightGreen,40,function()gotoScene("setting_game")end, nil,"graphic"), game= newButton(200,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,color.lightGreen,40,function()gotoScene("setting_graphic")end, nil,"sfx"), graphic=newButton(1080,80,240,80,C.lightGreen,40,function()scene.swapTo("setting_graphic")end, nil,"sfx"),
sfx=newSlider(180,250,400,8,40,function()SFX("blip_1")end, function()return setting.sfx end,function(i)setting.sfx=i end,nil,"bgm"), sfx= newSlider(180,250,400,10,40,function()SFX("blip_1")end, SETdisp("sfx"), SETsto("sfx"), nil,"bgm"),
bgm=newSlider(750,250,400,8,40,function()BGM(bgmPlaying or"blank")end, function()return setting.bgm end,function(i)setting.bgm=i end,nil,"vib"), bgm= newSlider(750,250,400,10,40,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"), SETsto("bgm"), nil,"vib"),
vib=newSlider(180,440,400,5,40,function()VIB(1)end, function()return setting.vib end,function(i)setting.vib=i end,nil,"voc"), vib= newSlider(180,440,400,5,40, function()VIB(1)end, SETdisp("vib"), SETsto("vib"), nil,"voc"),
voc=newSlider(750,440,400,8,40,function()VOICE("nya")end, function()return setting.voc end,function(i)setting.voc=i end,nil,"back"), voc= newSlider(750,440,400,10,40,function()VOICE("nya")end, SETdisp("voc"), SETsto("voc"), nil,"stereo"),
back=newButton(1160,600,160,160,color.white,55,back,nil,"game"), stereo= newSlider(180,630,400,10,40,function()SFX("move",1,-1)SFX("lock",1,1)end, SETdisp("stereo"), SETsto("stereo"),nil,"back"),
back=newButton(1160,600,160,160,C.white,55,scene.back,nil,"game"),
}, },
setting_control={ setting_key={
back=newButton(840,630,180,60,color.white,40,back), back=newButton(1140,650,200,80,C.white,50,scene.back),
}, },
setting_touch={ setting_touch={
hide= newButton(640,210,500,80,color.white,45,function() hide= newSwitch(810,140,45,SETdisp("VKSwitch"),SETrev("VKSwitch")),
setting.virtualkeySwitch=not setting.virtualkeySwitch track= newSwitch(810,220,45,SETdisp("VKTrack"),SETrev("VKTrack")),
end), tkset= newButton(450,220,170,80,C.white,30,function()
default=newButton(450,310,170,80,color.white,40,function() scene.push()
for K=1,#virtualkey do scene.swapTo("setting_trackSetting")
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K] end,function()return not setting.VKTrack end),
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4] default=newButton(450,320,170,80,C.white,40,function()
end--Default virtualkey local D=virtualkeySet[defaultSel]
for i=1,#VK_org do
VK_org[i].ava=false
end
for n=1,#D do
local T=D[n]
if T[1]then
local B=VK_org[n]
B.ava=true
B.x,B.y,B.r=T[2],T[3],T[4]
end
end--Replace keys
defaultSel=defaultSel%5+1 defaultSel=defaultSel%5+1
end), end),
snap= newButton(640,310,170,80,color.white,40,function() snap= newButton(640,320,170,80,C.white,40,function()
snapLevel=snapLevel%6+1 snapLevel=snapLevel%6+1
end), end),
alpha= newButton(830,310,170,80,color.white,45,function() --VK=T,70,50,27/T,130,50,27/T,190,50,27/T,250,50,27/T,310,50,27/T,370,50,27/T,430,50,27/T,490,50,27/T,550,50,27/T,610,50,27/T,670,50,27/T,730,50,27/T,790,50,27/T,850,50,27/T,910,50,27/T,970,50,27/T,739,789,897/T,1090,50,27/T,1150,50,27/T,1210,50,27
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%11 alpha= newButton(830,320,170,80,C.white,45,function()
setting.VKAlpha=(setting.VKAlpha+1)%11
--Adjust virtualkey alpha --Adjust virtualkey alpha
end), end),
icon= newButton(450,410,170,80,color.white,45,function() icon= newButton(495,420,260,80,C.white,45,SETrev("VKIcon")),
setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon --Switch virtualkey icon
end), size= newButton(785,420,260,80,C.white,45,function()
size= newButton(830,410,170,80,color.white,45,function()
if sel then if sel then
local b=virtualkey[sel] local B=VK_org[sel]
b[4]=b[4]+10 B.r=B.r+10
if b[4]==150 then b[4]=40 end if B.r>=150 then B.r=B.r-110 end
b[3]=b[4]^2
end end
end), end),
back= newButton(640,410,170,80,color.white,45,back), toggle= newButton(495,520,260,80,C.white,45,function()
scene.push()
scene.swapTo("setting_touchSwitch")
end),
back= newButton(785,520,260,80,C.white,45,scene.back),
},
setting_touchSwitch={
b1= newSwitch(300,80, 40,VKAdisp(1),VKAcode(1)),
b2= newSwitch(300,140, 40,VKAdisp(2),VKAcode(2)),
b3= newSwitch(300,200, 40,VKAdisp(3),VKAcode(3)),
b4= newSwitch(300,260, 40,VKAdisp(4),VKAcode(4)),
b5= newSwitch(300,320, 40,VKAdisp(5),VKAcode(5)),
b6= newSwitch(300,380, 40,VKAdisp(6),VKAcode(6)),
b7= newSwitch(300,440, 40,VKAdisp(7),VKAcode(7)),
b8= newSwitch(300,500, 40,VKAdisp(8),VKAcode(8)),
b9= newSwitch(300,560, 40,VKAdisp(9),VKAcode(9)),
b10= newSwitch(300,620, 40,VKAdisp(10),VKAcode(10)),
b11= newSwitch(760,80, 40,VKAdisp(11),VKAcode(11)),
b12= newSwitch(760,140, 40,VKAdisp(12),VKAcode(12)),
b13= newSwitch(760,200, 40,VKAdisp(13),VKAcode(13)),
b14= newSwitch(760,260, 40,VKAdisp(14),VKAcode(14)),
b15= newSwitch(760,320, 40,VKAdisp(15),VKAcode(15)),
b16= newSwitch(760,380, 40,VKAdisp(16),VKAcode(16)),
b17= newSwitch(760,440, 40,VKAdisp(17),VKAcode(17)),
b18= newSwitch(760,500, 40,VKAdisp(18),VKAcode(18)),
b19= newSwitch(760,560, 40,VKAdisp(19),VKAcode(19)),
b20= newSwitch(760,620, 40,VKAdisp(20),VKAcode(20)),
norm= newButton(1080,150,240,80,C.white,50,function()for i=1,20 do VK_org[i].ava=i<11 end end),
pro= newButton(1080,300,240,80,C.white,40,function()for i=1,20 do VK_org[i].ava=true end end),
back= newButton(1080,600,240,80,C.white,50,scene.back),
},
setting_trackSetting={
VKDodge= newSwitch(400,200, 40,SETdisp("VKDodge"),SETrev("VKDodge")),
VKTchW= newSlider(140,310,1000,10,40,nil,SETdisp("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end),
VKCurW= newSlider(140,370,1000,10,40,nil,SETdisp("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end),
back= newButton(1080,600,240,80,C.white,50,scene.back),
}, },
help={ help={
his= newButton(1050,520,230,60,color.white,40,function()gotoScene("history")end,nil,"back"), his= newButton(1050,520,230,60,C.white,40,function()scene.push()scene.swapTo("history")end,nil,"back"),
qq= newButton(1050,600,230,60,color.white,40,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"), qq= newButton(1050,600,230,60,C.white,40,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"),
back= newButton(640, 600,180,60,color.white,40,back,nil,"qq"), back= newButton(640, 600,180,60,C.white,40,scene.back,nil,"qq"),
}, },
history={ history={
prev= newButton(1155,170,180,180,color.white,70,function()love.keypressed("up")end,function()return sel==1 end), prev= newButton(1155,170,180,180,C.white,70,pressKey("up"),function()return sel==1 end),
next= newButton(1155,400,180,180,color.white,70,function()love.keypressed("down")end,function()return sel==#updateLog-22 end), next= newButton(1155,400,180,180,C.white,70,pressKey("down"),function()return sel==#updateLog-22 end),
back= newButton(1155,600,180,90,color.white,40,back), back= newButton(1155,600,180,90,C.white,40,scene.back),
}, },
stat={ stat={
path= newButton(980,590,250,60,color.white,30,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"), path= newButton(980,620,250,60,C.white,30,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
back= newButton(640,590,180,60,color.white,40,back,nil,"path"), back= newButton(640,620,180,60,C.white,40,scene.back,nil,"path"),
}, },
} }
for S,L in next,Widget do for _,L in next,Widget do
for N,W in next,L do for _,W in next,L do
if W.next then if W.next then
W.next,L[W.next].prev=L[W.next],W W.next,L[W.next].prev=L[W.next],W
end end

539
main.lua
View File

@@ -1,7 +1,7 @@
--[[ --[[
第一次搞这么大的工程~参考价值不是很大 第一次搞这么大的工程~参考价值不是很大
如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话当然欢迎! 如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话当然欢迎!
(顺便,无授权直接盗代码的先死个妈) (顺便,无授权直接盗代码的先死个妈)
]] ]]
local love=love local love=love
local ms,kb,tc=love.mouse,love.keyboard,love.touch local ms,kb,tc=love.mouse,love.keyboard,love.touch
@@ -14,21 +14,26 @@ NULL=function()end
system=sys.getOS() system=sys.getOS()
local xOy=love.math.newTransform() local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false local mx,my,mouseShow=-20,-20,false
local touching--1st touching ID local touching--第一触摸ID
modeSel,levelSel=1,3--Initialize mode selection local devMode=0
modeSel,levelSel=1,3--初始模式选择
players={alive={},human=0} players={alive={},human=0}
scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1} scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1}
local scr=scr local scr=scr
scene=""
curBG="none" curBG="none"
bgmPlaying=nil bgmPlaying=nil
voiceQueue={free=0} voiceQueue={free=0}
local devMode=0 virtualkeyDown,virtualkeyPressTime={},{}
for i=1,20 do
virtualkeyDown[i]=X
virtualkeyPressTime[i]=0
end
kb.setKeyRepeat(true) kb.setKeyRepeat(true)
kb.setTextInput(false) kb.setTextInput(false)
ms.setVisible(false) ms.setVisible(false)
--Application Vars
------------------------------------------------------------- -------------------------------------------------------------
local Fonts={} local Fonts={}
function setFont(s) function setFont(s)
@@ -50,94 +55,9 @@ for i=1,10 do preField[i]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}end
for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end
--Game system Vars --Game system Vars
setting={
das=10,arr=2,
sddas=0,sdarr=2,
quickR=true,swap=true,
--game
ghost=true,center=true,
smo=true,grid=false,
dropFX=3,
shakeFX=3,
atkFX=3,
frameMul=100,
--
fullscreen=false,
bg=true,
bgblock=true,
lang=1,
skin=1,
--graphic
sfx=8,bgm=6,
vib=3,voc=0,
--sound
keyMap={
{"left","right","x","z","c","up","down","space","tab","r","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},--keyboard
{"dpleft","dpright","a","b","y","dpup","dpdown","rightshoulder","x","leftshoulder","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},
{"","","","","","","","","","","","",""},--joystick
},
virtualkey={
{80,720-80,6400,80}, --moveLeft
{240,720-80,6400,80}, --moveRight
{1280-240,720-80,6400,80}, --rotRight
{1280-400,720-80,6400,80}, --rotLeft
{1280-240,720-240,6400,80}, --rotFlip
{1280-80,720-80,6400,80}, --hardDrop
{1280-80,720-240,6400,80}, --softDrop
{1280-80,720-400,6400,80}, --hold
{80,80,6400,80}, --restart
},
virtualkeyAlpha=3,
virtualkeyIcon=true,
virtualkeySwitch=false,
--control
}
stat={
run=0,game=0,time=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,
b2b=0,b3b=0,pc=0,score=0,
}
virtualkey={
{80,720-80,6400,80},--moveLeft
{240,720-80,6400,80},--moveRight
{1280-240,720-80,6400,80},--rotRight
{1280-400,720-80,6400,80},--rotLeft
{1280-240,720-240,6400,80},--rotFlip
{1280-80,720-80,6400,80},--hardDrop
{1280-80,720-240,6400,80},--softDrop
{1280-80,720-400,6400,80},--hold
{80,360,6400,80},--func
{80,80,6400,80},--restart
--[[
{x=0,y=0,r=0},--toLeft
{x=0,y=0,r=0},--toRight
{x=0,y=0,r=0},--toDown
]]
}
virtualkeyDown={X,X,X,X,X,X,X,X,X,X}
virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
--User datas&settings
------------------------------------------------------------- -------------------------------------------------------------
scene=require("scene")
require("default_data")
require("class") require("class")
require("ai") require("ai")
require("toolfunc") require("toolfunc")
@@ -200,100 +120,16 @@ local function getNewBlock()
FX_BGblock.next=FX_BGblock.next%7+1 FX_BGblock.next=FX_BGblock.next%7+1
return t return t
end end
local sceneInit={
load=function()
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar(0~1)
loadTip=text.tips[rnd(#text.tips)]
end,
intro=function()
count=0
BGM("blank")
updatePowerInfo()
end,
main=function()
modeEnv={}
if not players[1]then
newDemoPlayer(1,900,35,1.1)
end--create demo player
collectgarbage()
end,
music=function()
if bgmPlaying then
for i=1,#musicID do
if musicID[i]==bgmPlaying then
sel=i
return
end
end
else
sel=1
end
end,
mode=function()
curBG="none"
destroyPlayers()
BGM("blank")
end,
custom=function()
sel=sel or 1
destroyPlayers()
curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]])
end,
draw=function()
curBG="none"
clearSureTime=0
pen,sx,sy=1,1,1
end,
play=function()
kb.setKeyRepeat(false)
restartCount=0
if needResetGameData then
resetGameData()
needResetGameData=nil
end
end,
pause=function()
end,
setting_game=function()
curBG="none"
end,
setting_control=function()
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
end,
setting_touch=function()
curBG="game1"
defaultSel=1
sel=nil
snapLevel=1
end,
help=function()
curBG="none"
end,
history=function()
updateLog=require"updateLog"
curBG="lightGrey"
sel=1
end,
quit=function()
love.timer.sleep(.3)
love.event.quit()
end,
}
local function onVirtualkey(x,y) local function onVirtualkey(x,y)
local d2,nearest,distance local dist,nearest=1e15
for K=1,#virtualkey do for K=1,#virtualkey do
local b=virtualkey[K] local b=virtualkey[K]
d2=(x-b[1])^2+(y-b[2])^2 if b.ava then
if d2<b[3]then local d1=(x-b.x)^2+(y-b.y)^2
if not nearest or d2<distance then if d1<b.r^2 then
nearest,distance=K,d2 if d1<dist then
nearest,dist=K,d1
end
end end
end end
end end
@@ -324,19 +160,22 @@ local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{} local gamepadDown,gamepadUp={},{}
function mouseDown.intro(x,y,k) function mouseDown.intro(x,y,k)
if k==2 then if k==2 then
back() scene.back()
else else
gotoScene("main") scene.push()
scene.swapTo("main")
end end
end end
function touchDown.intro(id,x,y) function touchDown.intro(id,x,y)
gotoScene("main") scene.push()
scene.swapTo("main")
end end
function keyDown.intro(key) function keyDown.intro(key)
if key=="escape"then if key=="escape"then
back() scene.back()
else else
gotoScene("main") scene.push()
scene.swapTo("main")
end end
end end
@@ -366,11 +205,12 @@ function keyDown.mode(key)
levelSel=levelSel+1 levelSel=levelSel+1
end end
elseif key=="return"then elseif key=="return"then
loadGame(modeSel,levelSel) scene.push()loadGame(modeSel,levelSel)
elseif key=="c"then elseif key=="c"then
gotoScene("custom") scene.push()
scene.swapTo("custom")
elseif key=="escape"then elseif key=="escape"then
back() scene.back()
end end
end end
@@ -393,7 +233,7 @@ function keyDown.music(key)
BGM() BGM()
end end
elseif key=="escape"then elseif key=="escape"then
back() scene.back()
end end
end end
@@ -417,13 +257,24 @@ function keyDown.custom(key)
elseif key=="up"then elseif key=="up"then
sel=(sel-2)%#customID+1 sel=(sel-2)%#customID+1
elseif key=="d"then elseif key=="d"then
gotoScene("draw") scene.push()
scene.swapTo("draw")
elseif key=="return"then elseif key=="return"then
loadGame(0,1) scene.push()loadGame(0,1)
elseif key=="space"then elseif key=="space"then
loadGame(0,2) scene.push()loadGame(0,2)
elseif key=="1"then
Widget.custom.set1.code()
elseif key=="2"then
Widget.custom.set2.code()
elseif key=="3"then
Widget.custom.set3.code()
elseif key=="4"then
Widget.custom.set4.code()
elseif key=="5"then
Widget.custom.set5.code()
elseif key=="escape"then elseif key=="escape"then
back() scene.back()
end end
end end
@@ -486,97 +337,127 @@ function keyDown.draw(key)
elseif key=="backspace"or key=="lalt"then elseif key=="backspace"or key=="lalt"then
pen=0 pen=0
elseif key=="escape"then elseif key=="escape"then
back() scene.back()
else else
pen=string.find("123qwea#sdzxc",key)or pen pen=string.find("123qwea#sdzxc",key)or pen
end end
end end
function keyDown.setting_control(key) function keyDown.setting_key(key)
if key=="escape"then if key=="escape"then
if keyboardSetting then if keyboardSetting then
keyboardSetting=false keyboardSetting=false
SFX("error",.5)
else else
back() scene.back()
end end
elseif keyboardSetting then elseif keyboardSetting then
for l=1,8 do for l=1,8 do
for y=1,13 do for y=1,20 do
if setting.keyMap[l][y]==key then if setting.keyMap[l][y]==key then
setting.keyMap[l][y]="" setting.keyMap[l][y]=""
end end
end end
end end
setting.keyMap[curBoard][keyboardSet]=key setting.keyMap[curBoard][keyboardSet]=key
SFX("reach",.5)
keyboardSetting=false keyboardSetting=false
elseif key=="return"then elseif key=="return"then
keyboardSetting=true keyboardSetting=true
SFX("lock",.5)
elseif key=="up"then elseif key=="up"then
keyboardSet=max(keyboardSet-1,1) if keyboardSet>1 then
keyboardSet=keyboardSet-1
SFX("move",.5)
end
elseif key=="down"then elseif key=="down"then
keyboardSet=min(keyboardSet+1,13) if keyboardSet<20 then
keyboardSet=keyboardSet+1
SFX("move",.5)
end
elseif key=="left"then elseif key=="left"then
curBoard=max(curBoard-1,1) if curBoard>1 then
curBoard=curBoard-1
SFX("rotate",.5)
end
elseif key=="right"then elseif key=="right"then
curBoard=min(curBoard+1,8) if curBoard<8 then
curBoard=curBoard+1
SFX("rotate",.5)
end
end end
end end
function gamepadDown.setting_control(key) function gamepadDown.setting_key(key)
if key=="back"then if key=="back"then
if joystickSetting then if joystickSetting then
joystickSetting=false joystickSetting=false
SFX("error",.5)
else else
back() scene.back()
end end
elseif joystickSetting then elseif joystickSetting then
for l=9,16 do for l=9,16 do
for y=1,12 do for y=1,20 do
if setting.keyMap[l][y]==key then if setting.keyMap[l][y]==key then
setting.keyMap[l][y]="" setting.keyMap[l][y]=""
end end
end end
end end
setting.keyMap[8+curBoard][joystickSet]=key setting.keyMap[8+curBoard][joystickSet]=key
SFX("reach",.5)
joystickSetting=false joystickSetting=false
elseif key=="start"then elseif key=="start"then
joystickSetting=true joystickSetting=true
SFX("lock",.5)
elseif key=="up"then elseif key=="up"then
joystickSet=max(joystickSet-1,1) if joystickSet>1 then
joystickSet=joystickSet-1
SFX("move",.5)
end
elseif key=="down"then elseif key=="down"then
joystickSet=min(joystickSet+1,12) if joystickSet<20 then
joystickSet=joystickSet+1
SFX("move",.5)
end
elseif key=="left"then elseif key=="left"then
curBoard=max(curBoard-1,1) if curBoard>1 then
curBoard=curBoard-1
SFX("rotate",.5)
end
elseif key=="right"then elseif key=="right"then
curBoard=min(curBoard+1,8) if curBoard<8 then
curBoard=curBoard+1
SFX("rotate",.5)
end
end end
end end
function mouseDown.setting_touch(x,y,k) function mouseDown.setting_touch(x,y,k)
if k==2 then back()end if k==2 then scene.back()end
for K=1,#virtualkey do for K=1,#VK_org do
local b=virtualkey[K] local B=VK_org[K]
if (x-b[1])^2+(y-b[2])^2<b[3]then if (x-B.x)^2+(y-B.y)^2<B.r^2 then
sel=K sel=K
end end
end end
end end
function mouseMove.setting_touch(x,y,dx,dy) function mouseMove.setting_touch(x,y,dx,dy)
if sel and ms.isDown(1)then if sel and ms.isDown(1)then
local b=virtualkey[sel] local B=VK_org[sel]
b[1],b[2]=b[1]+dx,b[2]+dy B.x,B.y=B.x+dx,B.y+dy
end end
end end
function mouseUp.setting_touch(x,y,k) function mouseUp.setting_touch(x,y,k)
if sel then if sel then
local b=virtualkey[sel] local B=VK_org[sel]
local k=snapLevelValue[snapLevel] local k=snapLevelValue[snapLevel]
b[1],b[2]=int(b[1]/k+.5)*k,int(b[2]/k+.5)*k B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k
end end
end end
function touchDown.setting_touch(id,x,y) function touchDown.setting_touch(id,x,y)
for K=1,#virtualkey do for K=1,#VK_org do
local b=virtualkey[K] local B=VK_org[K]
if (x-b[1])^2+(y-b[2])^2<b[3]then if (x-B.x)^2+(y-B.y)^2<B.r^2 then
sel=K sel=K
end end
end end
@@ -585,43 +466,62 @@ function touchUp.setting_touch(id,x,y)
if sel then if sel then
x,y=xOy:inverseTransformPoint(x,y) x,y=xOy:inverseTransformPoint(x,y)
if sel then if sel then
local b=virtualkey[sel] local B=VK_org[sel]
local k=snapLevelValue[snapLevel] local k=snapLevelValue[snapLevel]
b[1],b[2]=int(b[1]/k+.5)*k,int(b[2]/k+.5)*k B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k
end end
end end
end end
function touchMove.setting_touch(id,x,y,dx,dy) function touchMove.setting_touch(id,x,y,dx,dy)
if sel then if sel then
local b=virtualkey[sel] local B=VK_org[sel]
b[1],b[2]=b[1]+dx,b[2]+dy B.x,B.y=B.x+dx,B.y+dy
end end
end end
function keyDown.pause(key) function keyDown.pause(key)
if key=="escape"then if key=="escape"then
back() scene.back()
elseif key=="return"or key=="space"then elseif key=="return"or key=="space"then
resumeGame() resumeGame()
elseif key=="r"and kb.isDown("lctrl","rctrl")then elseif key=="r"and kb.isDown("lctrl","rctrl")then
clearTask("play") clearTask("play")
updateStat() updateStat()
resetGameData() resetGameData()
gotoScene("play","none") scene.swapTo("play","none")
end--Restart with ctrl+R end--Ctrl+R重开
end end
function touchDown.play(id,x,y) function touchDown.play(id,x,y)
if setting.virtualkeySwitch then if setting.VKSwitch then
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
if t then if t then
players[1]:pressKey(t) players[1]:pressKey(t)
if setting.VKTrack then
local B=virtualkey[t]
--按钮软碰撞(做不来hhh随便做一个,效果还行!)
if setting.VKDodge then
for i=1,#virtualkey do
local b=virtualkey[i]
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--碰撞深度(负数=间隔距离)
if d>0 then
b.x=b.x+(b.x-B.x)*d*b.r*.00005
b.y=b.y+(b.y-B.y)*d*b.r*.00005
end
end
end
local O=VK_org[t]
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1
local _OW=1-_FW-_CW
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
--按钮自动跟随:手指位置,当前位置,原始位置,权重取决于设置
end
VIB(0) VIB(0)
end end
end end
end end
function touchUp.play(id,x,y) function touchUp.play(id,x,y)
if setting.virtualkeySwitch then if setting.VKSwitch then
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
if t then if t then
players[1]:releaseKey(t) players[1]:releaseKey(t)
@@ -629,26 +529,28 @@ function touchUp.play(id,x,y)
end end
end end
function touchMove.play(id,x,y,dx,dy) function touchMove.play(id,x,y,dx,dy)
if setting.virtualkeySwitch then if setting.VKSwitch then
local l=tc.getTouches() local l=tc.getTouches()
for n=1,#virtualkey do for n=1,#virtualkey do
local b=virtualkey[n] local B=virtualkey[n]
for i=1,#l do for i=1,#l do
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i])) local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
if(x-b[1])^2+(y-b[2])^2<=b[3]then goto L end if(x-B.x)^2+(y-B.y)^2<=B.r^2 then
goto nextButton
end
end end
players[1]:releaseKey(n) players[1]:releaseKey(n)
::L:: ::nextButton::
end end
end end
end end
function keyDown.play(key) function keyDown.play(key)
if key=="escape"and not sceneSwaping then if key=="escape"and not scene.swapping then
return(frame<180 and back or pauseGame)() return(frame<180 and back or pauseGame)()
end end
local m=setting.keyMap local m=setting.keyMap
for p=1,players.human do for p=1,players.human do
for k=1,12 do for k=1,20 do
if key==m[2*p-1][k]or key==m[2*p][k]then if key==m[2*p-1][k]or key==m[2*p][k]then
players[p]:pressKey(k) players[p]:pressKey(k)
return return
@@ -659,7 +561,7 @@ end
function keyUp.play(key) function keyUp.play(key)
local m=setting.keyMap local m=setting.keyMap
for p=1,players.human do for p=1,players.human do
for k=1,12 do for k=1,20 do
if key==m[2*p-1][k]or key==m[2*p][k]then if key==m[2*p-1][k]or key==m[2*p][k]then
players[p]:releaseKey(k) players[p]:releaseKey(k)
return return
@@ -668,10 +570,10 @@ function keyUp.play(key)
end end
end end
function gamepadDown.play(key) function gamepadDown.play(key)
if key=="back"then back()return end if key=="back"then scene.back()return end
local m=setting.keyMap local m=setting.keyMap
for p=1,players.human do for p=1,players.human do
for k=1,12 do for k=1,20 do
if key==m[2*p+7][k]or key==m[2*p+8][k]then if key==m[2*p+7][k]or key==m[2*p+8][k]then
players[p]:pressKey(k) players[p]:pressKey(k)
return return
@@ -682,7 +584,7 @@ end
function gamepadUp.play(key) function gamepadUp.play(key)
local m=setting.keyMap local m=setting.keyMap
for p=1,players.human do for p=1,players.human do
for k=1,12 do for k=1,20 do
if key==m[2*p+7][k]or key==m[2*p+8][k]then if key==m[2*p+7][k]or key==m[2*p+8][k]then
players[p]:releaseKey(k) players[p]:releaseKey(k)
return return
@@ -700,7 +602,7 @@ function keyDown.history(key)
elseif key=="down"then elseif key=="down"then
sel=min(sel+5,#updateLog-22) sel=min(sel+5,#updateLog-22)
elseif key=="escape"then elseif key=="escape"then
back() scene.back()
end end
end end
------------------------------------------------------------- -------------------------------------------------------------
@@ -740,10 +642,10 @@ local function widgetControl_key(i)
if widget_sel then if widget_sel then
widget_sel=kb.isDown("lshift")and widget_sel.prev or widget_sel.next or widget_sel widget_sel=kb.isDown("lshift")and widget_sel.prev or widget_sel.next or widget_sel
else else
widget_sel=select(2,next(Widget[scene])) widget_sel=select(2,next(Widget[scene.cur]))
end end
elseif i=="space"or i=="return"then elseif i=="space"or i=="return"then
if not sceneSwaping and widget_sel then if not scene.swapping and widget_sel then
widgetPress(widget_sel) widgetPress(widget_sel)
end end
else else
@@ -768,10 +670,10 @@ local function widgetControl_gamepad(i)
if widget_sel then if widget_sel then
widget_sel=i=="dpup"and widget_sel.prev or widget_sel.next or widget_sel widget_sel=i=="dpup"and widget_sel.prev or widget_sel.next or widget_sel
else else
widget_sel=select(2,next(Widget[scene])) widget_sel=select(2,next(Widget[scene.cur]))
end end
elseif i=="start"then elseif i=="start"then
if not sceneSwaping and widget_sel then if not scene.swapping and widget_sel then
local W=widget_sel local W=widget_sel
if W.hide and W.hide()then widget_sel=nil end if W.hide and W.hide()then widget_sel=nil end
if W.type=="button"then if W.type=="button"then
@@ -789,15 +691,16 @@ local function widgetControl_gamepad(i)
end end
end end
function love.mousepressed(x,y,k,t,num) function love.mousepressed(x,y,k,t,num)
if devMode>0 then print(x,y)end
if t then return end if t then return end
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if mouseDown[scene]then if mouseDown[scene.cur]then
mouseDown[scene](mx,my,k) mouseDown[scene.cur](mx,my,k)
elseif k==2 then elseif k==2 then
back() scene.back()
end end
if k==1 then if k==1 then
if widget_sel and not sceneSwaping then if widget_sel and not scene.swapping then
widgetPress(widget_sel,mx,my) widgetPress(widget_sel,mx,my)
end end
end end
@@ -807,14 +710,14 @@ function love.mousemoved(x,y,dx,dy,t)
if t then return end if t then return end
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
dx,dy=dx/scr.k,dy/scr.k dx,dy=dx/scr.k,dy/scr.k
if mouseMove[scene]then if mouseMove[scene.cur]then
mouseMove[scene](mx,my,dx,dy) mouseMove[scene.cur](mx,my,dx,dy)
end end
if ms.isDown(1)and widget_sel then if ms.isDown(1)and widget_sel then
widgetDrag(widget_sel,mx,my,dx,dy) widgetDrag(widget_sel,mx,my,dx,dy)
else else
widget_sel=nil widget_sel=nil
for _,W in next,Widget[scene]do for _,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())and W:isAbove(mx,my)then if not(W.hide and W.hide())and W:isAbove(mx,my)then
widget_sel=W widget_sel=W
return return
@@ -826,12 +729,12 @@ end
function love.mousereleased(x,y,k,t,num) function love.mousereleased(x,y,k,t,num)
if t then return end if t then return end
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if mouseUp[scene]then if mouseUp[scene.cur]then
mouseUp[scene](mx,my,k) mouseUp[scene.cur](mx,my,k)
end end
end end
function love.wheelmoved(x,y) function love.wheelmoved(x,y)
if wheelmoved[scene]then wheelmoved[scene](x,y)end if wheelmoved[scene.cur]then wheelmoved[scene.cur](x,y)end
end end
function love.touchpressed(id,x,y) function love.touchpressed(id,x,y)
@@ -840,20 +743,20 @@ function love.touchpressed(id,x,y)
touching=id touching=id
love.touchmoved(id,x,y,0,0) love.touchmoved(id,x,y,0,0)
end end
if touchDown[scene]then if touchDown[scene.cur]then
touchDown[scene](id,xOy:inverseTransformPoint(x,y)) touchDown[scene.cur](id,xOy:inverseTransformPoint(x,y))
end end
end end
function love.touchmoved(id,x,y,dx,dy) function love.touchmoved(id,x,y,dx,dy)
x,y=xOy:inverseTransformPoint(x,y) x,y=xOy:inverseTransformPoint(x,y)
if touchMove[scene]then if touchMove[scene.cur]then
touchMove[scene](id,x,y,dx/scr.k,dy/scr.k) touchMove[scene.cur](id,x,y,dx/scr.k,dy/scr.k)
end end
if widget_sel then if widget_sel then
widgetDrag(widget_sel,x,y,dx,dy) widgetDrag(widget_sel,x,y,dx,dy)
else else
widget_sel=nil widget_sel=nil
for _,W in next,Widget[scene]do for _,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())and W:isAbove(x,y)then if not(W.hide and W.hide())and W:isAbove(x,y)then
widget_sel=W widget_sel=W
return return
@@ -868,13 +771,13 @@ function love.touchreleased(id,x,y)
x,y=xOy:inverseTransformPoint(x,y) x,y=xOy:inverseTransformPoint(x,y)
if id==touching then if id==touching then
touching=nil touching=nil
if widget_sel and not sceneSwaping then if widget_sel and not scene.swapping then
widgetPress(widget_sel,x,y) widgetPress(widget_sel,x,y)
end end
widget_sel=nil widget_sel=nil
end end
if touchUp[scene]then if touchUp[scene.cur]then
touchUp[scene](id,x,y) touchUp[scene.cur](id,x,y)
end end
end end
function love.keypressed(i) function love.keypressed(i)
@@ -908,14 +811,14 @@ function love.keypressed(i)
end end
end end
else else
if keyDown[scene]then keyDown[scene](i) if keyDown[scene.cur]then keyDown[scene.cur](i)
elseif i=="escape"or i=="back"then back() elseif i=="escape"then scene.back()
else widgetControl_key(i) else widgetControl_key(i)
end end
end end
end end
function love.keyreleased(i) function love.keyreleased(i)
if keyUp[scene]then keyUp[scene](i)end if keyUp[scene.cur]then keyUp[scene.cur](i)end
end end
local keyMirror={ local keyMirror={
@@ -928,20 +831,20 @@ local keyMirror={
} }
function love.gamepadpressed(joystick,i) function love.gamepadpressed(joystick,i)
mouseShow=false mouseShow=false
if gamepadDown[scene]then gamepadDown[scene](i) if gamepadDown[scene.cur]then gamepadDown[scene.cur](i)
elseif keyDown[scene]then keyDown[scene](keyMirror[i]or i) elseif keyDown[scene.cur]then keyDown[scene.cur](keyMirror[i]or i)
elseif i=="back"then back() elseif i=="back"then scene.back()
else widgetControl_gamepad(i) else widgetControl_gamepad(i)
end end
end end
function love.gamepadreleased(joystick,i) function love.gamepadreleased(joystick,i)
if gamepadUp[scene]then gamepadUp[scene](i) if gamepadUp[scene.cur]then gamepadUp[scene.cur](i)
end end
end end
--[[ --[[
function love.joystickpressed(js,k)end function love.joystickpressed(js,k)end
function love.joystickaxis(js,axis,valend function love.joystickaxis(js,axis,val)end
function love.joystickhat(js,hat,dirend function love.joystickhat(js,hat,dir)end
function love.sendData(data)end function love.sendData(data)end
function love.receiveData(id,data)end function love.receiveData(id,data)end
]] ]]
@@ -960,10 +863,9 @@ function love.resize(w,h)
gc.origin() gc.origin()
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360) xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
gc.replaceTransform(xOy) gc.replaceTransform(xOy)
collectgarbage()
end end
function love.focus(f) function love.focus(f)
if system~="Android" and not f and scene=="play"then pauseGame()end if system~="Android" and not f and scene.cur=="play"then pauseGame()end
end end
function love.update(dt) function love.update(dt)
-- if players then for k,v in pairs(players[1])do -- if players then for k,v in pairs(players[1])do
@@ -989,28 +891,25 @@ function love.update(dt)
FX_BGblock.tm=rnd(20,30) FX_BGblock.tm=rnd(20,30)
end end
end end
if sceneSwaping then if scene.swapping then
sceneSwaping.time=sceneSwaping.time-1 local S=scene.swap
if sceneSwaping.time==sceneSwaping.mid then S.time=S.time-1
for k,W in next,Widget[scene]do if S.time==S.mid then
if W.type=="button"then scene.cur=S.tar
W.alpha=0 scene.init(S.tar)
end--Reset widgets' alpha
end
widget_sel=nil widget_sel=nil
scene=sceneSwaping.tar --此时场景切换
if sceneInit[scene] then sceneInit[scene]()end end
--scene swapped! if S.time==0 then
elseif sceneSwaping.time==0 then scene.swapping=false
sceneSwaping=nil
end end
end end
if Tmr[scene]then if Tmr[scene.cur]then
Tmr[scene](dt) Tmr[scene.cur](dt)
end end
for i=#Task,1,-1 do for i=#Task,1,-1 do
local T=Task[i] local T=Task[i]
if(not T.P or T.P and scene=="play")and T.code(T.P,T.data)then if T.code(T.P,T.data)then
rem(Task,i) rem(Task,i)
end end
end end
@@ -1022,28 +921,27 @@ function love.update(dt)
for i=1,#Q do for i=1,#Q do
Q[i]=Q[i+1] Q[i]=Q[i+1]
end end
end--play next when stop end--放完后放下一个
else else
local n=1 local n=1
local L=voiceBank[Q[1]] local L=voiceBank[Q[1]]
::L::if L[n]:isPlaying()then while L[n]:isPlaying()do
n=n+1 n=n+1
if not L[n]then if not L[n]then
L[n]=L[n-1]:clone() L[n]=L[n-1]:clone()
L[n]:seek(0) L[n]:seek(0)
goto quit break
end end
goto L end
end::quit::
Q[1]=L[n] Q[1]=L[n]
Q[1]:setVolume(setting.voc*.125) Q[1]:setVolume(setting.voc*.1)
Q[1]:play() Q[1]:play()
--load voice with string --load voice with string
end end
end end
end end
-- for k,W in next,Widget[scene]do -- for k,W in next,Widget[scene.cur]do
-- end--update Widgets -- end--更新控件
end end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5} local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
local FPS=love.timer.getFPS local FPS=love.timer.getFPS
@@ -1059,9 +957,9 @@ function love.draw()
gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_BGblock[n].y+(i-1)*30*size,nil,size) gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_BGblock[n].y+(i-1)*30*size,nil,size)
end end
end end end end
end end--Draw BG falling blocks
if Pnt[scene]then Pnt[scene]()end if Pnt[scene.cur]then Pnt[scene.cur]()end
for k,W in next,Widget[scene]do for k,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())then if not(W.hide and W.hide())then
W:draw() W:draw()
end end
@@ -1070,7 +968,7 @@ function love.draw()
local r=Timer()*.5 local r=Timer()*.5
gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3)) gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3))
r=int(r)%7+1 r=int(r)%7+1
gc.draw(mouseBlock[r],mx,my,Timer()%3.1416*4,20,20,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5) 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,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3) gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end--Awesome mouse! end--Awesome mouse!
@@ -1085,27 +983,27 @@ function love.draw()
gc.setColor(1,1,1,1-S[2]/S[3]) gc.setColor(1,1,1,1-S[2]/S[3])
local r=(10*S[2]/S[3])^1.2 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) gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--Ripple --按钮波纹
elseif S[1]==1 then elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3]) 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) gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--Shade --开关/滑条残影
end end
end--sysFXs end--sysFXs
if sceneSwaping then if scene.swapping then
sceneSwaping.draw() scene.swap.draw(scene.swap.time)
end--Swaping animation end--Swapping animation
if scr.r~=.5625 then if scr.r~=.5625 then
gc.setColor(0,0,0) gc.setColor(0,0,0)
if scr.r>.5625 then if scr.r>.5625 then
local d=(scr.h-scr.w*9/16)*.5/scr.k local d=(scr.h-scr.w*9/16)*.5/scr.k
gc.rectangle("fill",0,0,1280,-d) gc.rectangle("fill",0,0,1280,-d)
gc.rectangle("fill",0,720,1280,d) gc.rectangle("fill",0,720,1280,d)
else--high else--高窗口
local d=(scr.w-scr.h*16/9)*.5/scr.k local d=(scr.w-scr.h*16/9)*.5/scr.k
gc.rectangle("fill",0,0,-d,720) gc.rectangle("fill",0,0,-d,720)
gc.rectangle("fill",1280,0,d,720) gc.rectangle("fill",1280,0,d,720)
end--wide end--扁窗口
end--Black side end--Black side
setFont(20) setFont(20)
gc.setColor(1,1,1) gc.setColor(1,1,1)
@@ -1121,12 +1019,12 @@ function love.draw()
end end
function love.run() function love.run()
local T=love.timer local T=love.timer
local lastFrame,lastUpdatePowerInfo=T.getTime(),T.getTime() local lastFrame,lastFreshPow=T.getTime(),T.getTime()
local readyDrawFrame=0 local readyDrawFrame=0
local mini=love.window.isMinimized local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
scene="load"sceneInit.load()--System Launch scene.init("load")--Scene Launch
return function() return function()
PUMP() PUMP()
for N,a,b,c,d,e in POLL()do for N,a,b,c,d,e in POLL()do
@@ -1149,14 +1047,14 @@ function love.run()
gc.present() gc.present()
end end
end end
repeat while Timer()-lastFrame<.0158 do
if Timer()-lastUpdatePowerInfo>5 then T.sleep(.001)
updatePowerInfo() end
lastUpdatePowerInfo=Timer()
end
until Timer()-lastFrame>.013
T.sleep(.002)
lastFrame=Timer() lastFrame=Timer()
if Timer()-lastFreshPow>5 then
updatePowerInfo()
lastFreshPow=Timer()
end
end end
end end
@@ -1168,8 +1066,9 @@ end
if fs.getInfo("usersetting")then if fs.getInfo("usersetting")then
loadSetting() loadSetting()
elseif system=="Android"or system=="iOS" then elseif system=="Android"or system=="iOS" then
setting.virtualkeySwitch=true
setting.swap=false setting.swap=false
else
setting.VKSwitch=false
end end
math.randomseed(os.time()*626) math.randomseed(os.time()*626)
swapLanguage(setting.lang) swapLanguage(setting.lang)

176
paint.lua
View File

@@ -17,6 +17,7 @@ local modeLevelColor={
["NORMAL+"]=color.darkGreen, ["NORMAL+"]=color.darkGreen,
["HARD+"]=color.darkMagenta, ["HARD+"]=color.darkMagenta,
["LUNATIC+"]=color.darkRed, ["LUNATIC+"]=color.darkRed,
["ULTIMATE+"]=color.grey,
MESS=color.lightGrey, MESS=color.lightGrey,
GM=color.blue, GM=color.blue,
@@ -50,6 +51,10 @@ local function dataOpt(i)
return stat.pc return stat.pc
elseif i==14 then elseif i==14 then
return format("%0.2f",stat.atk/stat.row) return format("%0.2f",stat.atk/stat.row)
elseif i==15 then
return stat.extraPiece
elseif i==16 then
return max(100-int(stat.extraRate/stat.piece*10000)*.01,0).."%"
end end
end end
local statOptL={ local statOptL={
@@ -72,6 +77,8 @@ local function statOpt(i)
return stat.pc return stat.pc
elseif i==17 then elseif i==17 then
return format("%0.2f",stat.atk/stat.row) return format("%0.2f",stat.atk/stat.row)
elseif i==18 then
return stat.extraPiece.."["..(int(stat.extraRate/stat.piece*10000)*.01).."%]"
end end
end end
local miniTitle_rect={ local miniTitle_rect={
@@ -173,29 +180,36 @@ local function drawAtkPointer(x,y)
gc.circle("line",x,y,30*(1+a),6) gc.circle("line",x,y,30*(1+a),6)
end end
local function VirtualkeyPreview() local function VirtualkeyPreview()
for i=1,#virtualkey do if setting.VKSwitch then
local c=sel==i and .8 or 1 for i=1,#VK_org do
gc.setColor(c,c,c,setting.virtualkeyAlpha*.1) local B=VK_org[i]
local b=virtualkey[i] if B.ava then
gc.setLineWidth(b[4]*.07) local c=sel==i and .6 or 1
gc.circle("line",b[1],b[2],b[4]-5) gc.setColor(c,1,c,setting.VKAlpha*.1)
if setting.virtualkeyIcon then gc.draw(virtualkeyIcon[i],b[1],b[2],nil,b[4]*.025,nil,18,18)end gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r)
if setting.VKIcon then gc.draw(VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end
end
end
end end
end end
local function drawVirtualkey() local function drawVirtualkey()
local a=setting.virtualkeyAlpha*.1 local a=setting.VKAlpha*.1
for i=1,#virtualkey do for i=1,#virtualkey do
if i~=9 or modeEnv.Fkey then if i~=9 or modeEnv.Fkey then
local p,b=virtualkeyDown[i],virtualkey[i] local B=virtualkey[i]
if p then gc.setColor(.7,.7,.7,a) if B.ava then
else gc.setColor(1,1,1,a) local _=virtualkeyDown[i]and gc.setColor(.7,.7,.7,a)or gc.setColor(1,1,1,a)--Dark magic
end gc.setLineWidth(B.r*.07)
gc.setLineWidth(b[4]*.07) local ΔY=virtualkeyPressTime[i]
gc.circle("line",b[1],b[2]+virtualkeyPressTime[i],b[4]-5) gc.circle("line",B.x,B.y+ΔY,B.r)--Outline circle
if setting.virtualkeyIcon then gc.draw(virtualkeyIcon[i],b[1],b[2]+virtualkeyPressTime[i],nil,b[4]*.025,nil,18,18)end if setting.VKIcon then
if virtualkeyPressTime[i]>0 then gc.draw(VKIcon[i],B.x,B.y+ΔY,nil,B.r*.025,nil,18,18)
gc.setColor(1,1,1,a*virtualkeyPressTime[i]*.1) end--Icon
gc.circle("line",b[1],b[2],b[4]*(1.4-virtualkeyPressTime[i]*.04)) if ΔY>0 then
gc.setColor(1,1,1,a*ΔY*.1)
gc.circle("line",B.x,B.y,B.r*(1.4-ΔY*.04))
end--Ripple
end end
end end
end end
@@ -215,6 +229,27 @@ function Pnt.BG.glow()
local t=((sin(Timer()*.5)+sin(Timer()*.7)+sin(Timer()*.9+1)+sin(Timer()*1.5)+sin(Timer()*2+3))+5)*.05 local t=((sin(Timer()*.5)+sin(Timer()*.7)+sin(Timer()*.9+1)+sin(Timer()*1.5)+sin(Timer()*2+3))+5)*.05
gc.clear(t,t,t) gc.clear(t,t,t)
end end
function Pnt.BG.rgb()
gc.clear(
sin(Timer()*1.2)*.15+.5,
sin(Timer()*1.5)*.15+.5,
sin(Timer()*1.9)*.15+.5
)
end
function Pnt.BG.strap()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
end
function Pnt.BG.flink()
local t=.13-Timer()%3%1.7
if t<.25 then
gc.clear(t,t,t)
else
gc.clear(0,0,0)
end
end
function Pnt.BG.game1() function Pnt.BG.game1()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64) gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
@@ -247,21 +282,8 @@ function Pnt.BG.game6()
end end
gc.setColor(.3,.3,.3) gc.setColor(.3,.3,.3)
local r=7-int(Timer()*.5)%7 local r=7-int(Timer()*.5)%7
gc.draw(mouseBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5) gc.draw(miniBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
end--Fast lightning&spining tetromino end--Fast lightning&spining tetromino
function Pnt.BG.rgb()
gc.clear(
sin(Timer()*1.2)*.15+.5,
sin(Timer()*1.5)*.15+.5,
sin(Timer()*1.9)*.15+.5
)
end
function Pnt.BG.strap()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
end
local matrixT={}for i=0,15 do matrixT[i]={}for j=0,8 do matrixT[i][j]=love.math.noise(i,j)+2 end end local matrixT={}for i=0,15 do matrixT[i]={}for j=0,8 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function Pnt.BG.matrix() function Pnt.BG.matrix()
gc.clear(.15,.15,.15) gc.clear(.15,.15,.15)
@@ -401,12 +423,12 @@ function Pnt.draw()
gc.translate(-200,-60) gc.translate(-200,-60)
if clearSureTime>0 then if clearSureTime>0 then
gc.setColor(1,1,1,clearSureTime*.02) gc.setColor(1,1,1,clearSureTime*.02)
gc.draw(drawableText.question,1100,570) gc.draw(drawableText.question,760,11)
end end
if pen>0 then if pen>0 then
gc.setLineWidth(13) gc.setLineWidth(13)
gc.setColor(blockColor[pen]) gc.setColor(blockColor[pen])
gc.rectangle("line",945,605,70,70) gc.rectangle("line",746,460,70,70)
elseif pen==-1 then elseif pen==-1 then
gc.setLineWidth(5) gc.setLineWidth(5)
gc.setColor(.9,.9,.9) gc.setColor(.9,.9,.9)
@@ -441,7 +463,7 @@ function Pnt.play()
gc.pop() gc.pop()
end--FX animation end--FX animation
gc.setColor(1,1,1) gc.setColor(1,1,1)
if setting.virtualkeySwitch then drawVirtualkey()end if setting.VKSwitch then drawVirtualkey()end
if modeEnv.royaleMode then if modeEnv.royaleMode then
for i=1,#FX_badge do for i=1,#FX_badge do
local b=FX_badge[i] local b=FX_badge[i]
@@ -485,13 +507,13 @@ function Pnt.pause()
if pauseCount>0 then if pauseCount>0 then
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150) gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150)
end end
for i=1,7 do for i=1,8 do
gc.print(text.stat[i+3],110,30*i+270) gc.print(text.stat[i+3],110,30*i+270)
gc.print(dataOpt(i),305,30*i+270) gc.print(dataOpt(i),305,30*i+270)
end end
for i=8,14 do for i=9,16 do
gc.print(text.stat[i+3],860,30*i+60) gc.print(text.stat[i+3],860,30*i+30)
gc.print(dataOpt(i),1000,30*i+60) gc.print(dataOpt(i),1050,30*i+30)
end end
setFont(40) setFont(40)
if system~="Android"then if system~="Android"then
@@ -520,40 +542,54 @@ function Pnt.setting_sound()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mDraw(drawableText.setting_sound,640,15) mDraw(drawableText.setting_sound,640,15)
end end
function Pnt.setting_control() function Pnt.setting_key()
local a=.3+sin(Timer()*15)*.1 local a=.3+sin(Timer()*15)*.1
if keyboardSetting then if keyboardSetting then gc.setColor(1,.3,.3,a)else gc.setColor(1,.7,.7,a)end
gc.setColor(1,.5,.5,a) gc.rectangle("fill",
else keyboardSet<11 and 240 or 840,
gc.setColor(.9,.9,.9,a) 45*keyboardSet+20-450*int(keyboardSet/11),
end 200,45
gc.rectangle("fill",240,40*keyboardSet-10,200,40) )
if joystickSetting then if joystickSetting then gc.setColor(.3,.3,.1,a)else gc.setColor(.7,.7,1,a)end
gc.setColor(1,.5,.5,a) gc.rectangle("fill",
else joystickSet<11 and 440 or 1040,
gc.setColor(.9,.9,.9,a) 45*joystickSet+20-450*int(joystickSet/11),
end 200,45
gc.rectangle("fill",440,40*joystickSet-10,200,40) )
--Selection rect
gc.setColor(1,.3,.3)
mDraw(drawableText.keyboard,340,35)
mDraw(drawableText.keyboard,940,35)
gc.setColor(.3,.3,1)
mDraw(drawableText.joystick,540,35)
mDraw(drawableText.joystick,1140,35)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(25) setFont(31)
for y=1,13 do for N=1,20 do
mStr(text.actName[y],150,40*y-5) if N<11 then
for x=1,2 do gc.printf(text.actName[N],47,45*N+22,180,"right")
mStr(setting.keyMap[curBoard+x*8-8][y],200*x+140,40*y-3) mStr(setting.keyMap[curBoard][N],340,45*N+22)
mStr(setting.keyMap[curBoard+8][N],540,45*N+22)
else
gc.printf(text.actName[N],647,45*N-428,180,"right")
mStr(setting.keyMap[curBoard][N],940,45*N-428)
mStr(setting.keyMap[curBoard+8][N],1040,45*N-428)
end end
gc.line(40,40*y-10,640,40*y-10)
end end
for x=1,4 do gc.setLineWidth(2)
gc.line(200*x-160,30,200*x-160,550) for x=40,1240,200 do
gc.line(x,65,x,515)
end
for y=65,515,45 do
gc.line(40,y,1240,y)
end end
gc.line(40,550,640,550)
mDraw(drawableText.keyboard,340,0)
mDraw(drawableText.joystick,540,0)
gc.draw(drawableText.ctrlSetHelp,50,620)
setFont(40) setFont(40)
gc.print("P"..int(curBoard*.5+.5).."/P4",420,560) gc.print("Player:",170,590)
gc.print(curBoard.."/8",580,560) gc.print(int(curBoard*.5+.5),300,590)
gc.print(curBoard.."/8",580,590)
gc.draw(drawableText.ctrlSetHelp,50,650)
end end
function Pnt.setting_touch() function Pnt.setting_touch()
VirtualkeyPreview() VirtualkeyPreview()
@@ -569,6 +605,12 @@ function Pnt.setting_touch()
end end
end end
end 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)
end
function Pnt.help() function Pnt.help()
setFont(30) setFont(30)
gc.setColor(1,1,1) gc.setColor(1,1,1)
@@ -592,7 +634,7 @@ end
function Pnt.stat() function Pnt.stat()
setFont(28) setFont(28)
gc.setColor(1,1,1) gc.setColor(1,1,1)
for i=1,17 do for i=1,18 do
gc.print(text.stat[i],400,30*i-5) gc.print(text.stat[i],400,30*i-5)
gc.print(statOpt(i),720,30*i-5) gc.print(statOpt(i),720,30*i-5)
end end

File diff suppressed because it is too large Load Diff

212
scene.lua Normal file
View File

@@ -0,0 +1,212 @@
local scene={
cur="load",--Current scene
swapping=false,--ifSwapping
swap={
tar=nil, --Swapping target
style=nil, --Swapping target
mid=nil, --Loading point
time=nil, --Full swap time
draw=nil, --Swap draw
},
seq={"quit","slowFade"},--Back sequence
}
local sceneInit={
quit=love.event.quit,
load=function()
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar(0~1)
loadTip=text.tips[math.random(#text.tips)]
end,
intro=function()
count=0
BGM("blank")
end,
main=function()
curBG="none"
BGM("blank")
destroyPlayers()
modeEnv={}
if not players[1]then
newDemoPlayer(1,900,35,1.1)
end--create demo player
collectgarbage()
end,
music=function()
if bgmPlaying then
for i=1,#musicID do
if musicID[i]==bgmPlaying then
sel=i
return
end
end
else
sel=1
end
end,
mode=function()
curBG="none"
BGM("blank")
destroyPlayers()
end,
custom=function()
sel=sel or 1
destroyPlayers()
curBG=customRange.bg[customSel[12]]
BGM(customRange.bgm[customSel[13]])
end,
draw=function()
curBG="none"
clearSureTime=0
pen,sx,sy=1,1,1
end,
play=function()
love.keyboard.setKeyRepeat(false)
restartCount=0
if needResetGameData then
resetGameData()
needResetGameData=nil
else
BGM(modeEnv.bgm)
end
curBG=modeEnv.bg
end,
pause=function()
curBG=modeEnv.bg
end,
setting_game=function()
curBG="none"
end,
setting_graphic=function()
curBG="none"
end,
setting_sound=function()
curBG="none"
end,
setting_key=function()
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
end,
setting_touch=function()
curBG="game2"
defaultSel=1
sel=nil
snapLevel=1
end,
setting_touchSwitch=function()
curBG="matrix"
end,
help=function()
curBG="none"
end,
history=function()
updateLog=require"updateLog"
curBG="lightGrey"
sel=1
end,
quit=function()
love.timer.sleep(.3)
love.event.quit()
end,
}
local swapDeck_data={
{4,0,1,1},{6,0,15,1},{5,0,9,1},{6,0,6,1},
{1,0,3,1},{3,0,12,1},{1,1,8,1},{2,1,4,2},
{3,2,13,2},{4,1,12,2},{5,2,1,2},{7,1,11,2},
{2,1,9,3},{3,0,6,3},{4,2,14,3},{1,0,4,4},
{7,1,1,4},{6,0,2,4},{5,2,6,4},{6,0,14,5},
{3,3,15,5},{4,0,7,6},{7,1,10,5},{5,0,2,6},
{2,1,1,7},{1,0,4,6},{4,1,13,5},{1,1,6,7},
{5,3,11,5},{3,2,11,7},{6,0,8,7},{4,2,12,8},
{7,0,8,9},{1,0,2,8},{5,2,4,8},{6,0,15,8},
}--Block id [ZSLJTOI] ,dir,x,y
local gc=love.graphics
local swap={
none={1,0,NULL},
flash={8,1,function()gc.clear(1,1,1)end},
fade={30,15,function(t)
local t=t>15 and 2-t/15 or t/15
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720)
end},
slowFade={120,40,function(t)
local t=t>40 and 1.5-t/80 or t/40
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720)
end},
deck={50,8,function(t)
gc.setColor(1,1,1)
if t>8 then
local t=t<15 and 15 or t
for i=1,51-t do
local bn=swapDeck_data[i][1]
local b=blocks[bn][swapDeck_data[i][2]]
local cx,cy=swapDeck_data[i][3],swapDeck_data[i][4]
for y=1,#b do for x=1,#b[1]do
if b[y][x]then
gc.draw(blockSkin[bn],80*(cx+x-2),80*(10-cy-y),nil,8/3)
end
end end
end
end
if t<17 then
gc.setColor(1,1,1,1-(t>8 and t-8 or 8-t)*.125)
gc.rectangle("fill",0,0,1280,720)
end
end},
}--Scene swapping animations
local backFunc={
load=love.event.quit,
pause=function()
love.keyboard.setKeyRepeat(true)
updateStat()
saveData()
clearTask("play")
end,
setting_game=function()
saveSetting()
end,
}
function scene.init(s)
if sceneInit[s]then sceneInit[s]()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"
end
end
function scene.pop()
scene.seq={}
end
function scene.swapTo(tar,style)
local S=scene.swap
if not scene.swapping and tar~=scene.cur then
scene.swapping=true
if not style then style="fade"end
S.tar=tar
S.style=style
S.time=swap[style][1]
S.mid=swap[style][2]
S.draw=swap[style][3]
widget_sel=nil
if style~="none"then SFX("swipe")end
end
end
function scene.back()
if not scene.swapping then
if backFunc[scene.cur] then backFunc[scene.cur]()end
--func when scene end
local m=#scene.seq
if m>0 then
scene.swapTo(scene.seq[m-1],scene.seq[m])
scene.seq[m],scene.seq[m-1]=nil
--Poll&Back to preScene
end
end
end
return scene

View File

@@ -1,5 +1,6 @@
local gc=love.graphics local gc=love.graphics
local N,c=gc.newImage local N,c=gc.newImage
local int=math.floor
local function T(s,t)return gc.newText(setFont(s),t)end local function T(s,t)return gc.newText(setFont(s),t)end
local function C(x,y) local function C(x,y)
c=gc.newCanvas(x,y) c=gc.newCanvas(x,y)
@@ -15,16 +16,18 @@ for i=1,13 do
blockSkinmini[i]=C(6,6) blockSkinmini[i]=C(6,6)
end end
virtualkeyIcon={} local VKI=N("/image/virtualkey.png")
for i=1,10 do VKIcon={}
virtualkeyIcon[i]=N("/image/virtualkey/"..actName[i]..".png") for i=1,#actName do
VKIcon[i]=C(36,36)
gc.draw(VKI,(i-1)%5*-36,int((i-1)*.2)*-36)
end end
gc.setColor(1,1,1) gc.setColor(1,1,1)
mouseBlock={} miniBlock={}
for i=1,7 do for i=1,7 do
local b=blocks[i][0] local b=blocks[i][0]
mouseBlock[i]=C(#b[1],#b) miniBlock[i]=C(#b[1],#b)
gc.setColor(blockColor[i]) gc.setColor(blockColor[i])
for y=1,#b do for x=1,#b[1]do for y=1,#b do for x=1,#b[1]do
if b[y][x]then if b[y][x]then
@@ -61,6 +64,19 @@ payCode=N("/image/mess/paycode.png")
drawableText={ drawableText={
question=T(100,"?"), question=T(100,"?"),
bpm=T(15,"BPM"),kpm=T(15,"KPM"), bpm=T(15,"BPM"),kpm=T(15,"KPM"),
speedLV=T(20,"speed level"),
atk=T(20,"Attack"),
eff=T(20,"Efficiency"),
tsd=T(35,"TSD"),
line=T(25,"Lines"),
techrash=T(25,"Techrash"),
grade=T(25,"Grade"),
wave=T(30,"Wave"),
rpm=T(35,"RPM"),
combo=T(20,"Combo"),
mxcmb=T(20,"Max Combo"),
pc=T(22,"Perfect Clear"),
ko=T(25,"KO"),
modeName=T(30),levelName=T(30), modeName=T(30),levelName=T(30),
next=T(40),hold=T(40), next=T(40),hold=T(40),
@@ -68,9 +84,12 @@ drawableText={
custom=T(80), custom=T(80),
setting_game=T(80),setting_graphic=T(80),setting_sound=T(80), setting_game=T(80),setting_graphic=T(80),setting_sound=T(80),
keyboard=T(25),joystick=T(25), keyboard=T(25),joystick=T(25),
ctrlSetHelp=T(25), ctrlSetHelp=T(30),
musicRoom=T(80), musicRoom=T(80),
nowPlaying=T(50), nowPlaying=T(50),
warning=T(30), warning=T(30),
VKTchW=T(30),
VKOrgW=T(30),
VKCurW=T(30),
} }
c=gc.setCanvas() gc.setCanvas()

View File

@@ -47,7 +47,7 @@ function Tmr.load()
loadnum=loadnum+1 loadnum=loadnum+1
if loadnum==48 then if loadnum==48 then
stat.run=stat.run+1 stat.run=stat.run+1
gotoScene("intro","none") scene.swapTo("intro","none")
end end
end end
end end

View File

@@ -44,6 +44,7 @@ function destroyPlayers()
players.alive[i]=nil players.alive[i]=nil
end end
players.human=0 players.human=0
collectgarbage()
end end
function getNewRow(val) function getNewRow(val)
local t=rem(freeRow) local t=rem(freeRow)
@@ -72,12 +73,15 @@ local drawableTextLoad={
"next","hold", "next","hold",
"pause","finish", "pause","finish",
"custom", "custom",
"setting_game","setting_graphic","setting_sound", "setting_game",
"setting_graphic",
"setting_sound",
"keyboard","joystick", "keyboard","joystick",
"ctrlSetHelp", "ctrlSetHelp",
"musicRoom", "musicRoom",
"nowPlaying", "nowPlaying",
"warning", "warning",
"VKTchW","VKOrgW","VKCurW",
} }
function swapLanguage(l) function swapLanguage(l)
text=require("language/"..langID[l]) text=require("language/"..langID[l])
@@ -125,20 +129,29 @@ function VIB(t)
love.system.vibrate(vibrateLevel[setting.vib+t]) love.system.vibrate(vibrateLevel[setting.vib+t])
end end
end end
function SFX(s,v) function SFX(s,v,pos)
if setting.sfx>0 then if setting.sfx>0 then
local S=sfx[s]--AU_Queue
local n=1 local n=1
::L::if sfx[s][n]:isPlaying()then while S[n]:isPlaying()do
n=n+1 n=n+1
if not sfx[s][n]then if not S[n]then
sfx[s][n]=sfx[s][n-1]:clone() S[n]=S[n-1]:clone()
sfx[s][n]:seek(0) S[n]:seek(0)
goto quit break
end end
goto L end
end::quit:: S=S[n]--AU_SRC
sfx[s][n]:setVolume((v or 1)*setting.sfx*.125) if S:getChannelCount()==1 then
sfx[s][n]:play() if pos then
pos=pos*setting.stereo*.1
S:setPosition(pos,1-pos^2,0)
else
S:setPosition(0,0,0)
end
end
S:setVolume((v or 1)*setting.sfx*.1)
S:play()
end end
end end
function getFreeVoiceChannel() function getFreeVoiceChannel()
@@ -179,7 +192,7 @@ function BGM(s)
bgmPlaying=s bgmPlaying=s
else else
if bgmPlaying then if bgmPlaying then
local v=setting.bgm*.125 local v=setting.bgm*.1
bgm[bgmPlaying]:setVolume(v) bgm[bgmPlaying]:setVolume(v)
if v>0 then if v>0 then
bgm[bgmPlaying]:play() bgm[bgmPlaying]:play()
@@ -194,100 +207,10 @@ function BGM(s)
end end
end end
local swapDeck_data={
{4,0,1,1},{6,0,15,1},{5,0,9,1},{6,0,6,1},
{1,0,3,1},{3,0,12,1},{1,1,8,1},{2,1,4,2},
{3,2,13,2},{4,1,12,2},{5,2,1,2},{7,1,11,2},
{2,1,9,3},{3,0,6,3},{4,2,14,3},{1,0,4,4},
{7,1,1,4},{6,0,2,4},{5,2,6,4},{6,0,14,5},
{3,3,15,5},{4,0,7,6},{7,1,10,5},{5,0,2,6},
{2,1,1,7},{1,0,4,6},{4,1,13,5},{1,1,6,7},
{5,3,11,5},{3,2,11,7},{6,0,8,7},{4,2,12,8},
{7,0,8,9},{1,0,2,8},{5,2,4,8},{6,0,15,8},
}--Block id [ZSLJTOI] ,dir,x,y
local swap={
none={2,1,d=NULL},
flash={8,1,d=function()gc.clear(1,1,1)end},
fade={30,15,d=function()
local t=1-abs(sceneSwaping.time*.06667-1)
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720)
end},
deck={50,8,d=function()
local t=sceneSwaping.time
gc.setColor(1,1,1)
if t>8 then
local t=max(t,15)
for i=1,51-t do
local bn=swapDeck_data[i][1]
local b=blocks[bn][swapDeck_data[i][2]]
local cx,cy=swapDeck_data[i][3],swapDeck_data[i][4]
for y=1,#b do for x=1,#b[1]do
if b[y][x]then
gc.draw(blockSkin[bn],80*(cx+x-2),80*(10-cy-y),nil,8/3)
end
end end
end
end
if t<17 then
gc.setColor(1,1,1,(8-abs(t-8))*.125)
gc.rectangle("fill",0,0,1280,720)
end
end},
}--Scene swapping animations
function gotoScene(s,style)
if not sceneSwaping and s~=scene then
style=style or"fade"
sceneSwaping={
tar=s,style=style,
time=swap[style][1],mid=swap[style][2],
draw=swap[style].d
}
widget_sel=nil
if style~="none"then
SFX("swipe")
end
end
end
function updateStat() function updateStat()
for k,v in next,players[1].stat do local S=players[1].stat
stat[k]=stat[k]+v for k,v in next,S do
end stat[k]=stat[k]+S[k]
end
local prevMenu={
load=love.event.quit,
intro="quit",
main="intro",
music="main",
mode="main",
custom="mode",
draw="custom",
play=function()
kb.setKeyRepeat(true)
updateStat()
saveData()
clearTask("play")
gotoScene(curMode.id~="custom"and"mode"or"custom","deck")
end,
setting_game=function()
saveSetting()
gotoScene("main")
end,
setting_control="setting_game",
setting_touch= "setting_game",
help="main",
history="help",
stat="main",
}
prevMenu.pause=prevMenu.play
prevMenu.setting_graphic=prevMenu.setting_game
prevMenu.setting_sound=prevMenu.setting_game
function back()
local t=prevMenu[scene]
if type(t)=="string"then
gotoScene(t)
else
t()
end end
end end
@@ -379,10 +302,10 @@ function pauseGame()
end end
end end
end end
gotoScene("pause","none") scene.swapTo("pause","none")
end end
function resumeGame() function resumeGame()
gotoScene("play","fade") scene.swapTo("play","fade")
end end
function loadGame(mode,level) function loadGame(mode,level)
--rec={} --rec={}
@@ -390,7 +313,7 @@ function loadGame(mode,level)
drawableText.modeName:set(text.modeName[mode]) drawableText.modeName:set(text.modeName[mode])
drawableText.levelName:set(modeLevel[modeID[mode]][level]) drawableText.levelName:set(modeLevel[modeID[mode]][level])
needResetGameData=true needResetGameData=true
gotoScene("play","deck") scene.swapTo("play","deck")
end end
function resetPartGameData() function resetPartGameData()
frame=30 frame=30
@@ -406,9 +329,7 @@ function resetPartGameData()
players[i]:changeAtk(randomTarget(players[i])) players[i]:changeAtk(randomTarget(players[i]))
end end
end end
for i=1,#virtualkey do restoreVirtualKey()
virtualkey[i].press=false
end
collectgarbage() collectgarbage()
end end
function resetGameData() function resetGameData()
@@ -419,7 +340,7 @@ function resetGameData()
pauseTime=0--Time paused pauseTime=0--Time paused
pauseCount=0--Times paused pauseCount=0--Times paused
destroyPlayers() destroyPlayers()
local E=defaultModeEnv[curMode.id] local E=defModeEnv[curMode.id]
modeEnv=E[curMode.lv]or E[1] modeEnv=E[curMode.lv]or E[1]
loadmode[curMode.id]()--bg/bgm need redefine in custom,so up here loadmode[curMode.id]()--bg/bgm need redefine in custom,so up here
if modeEnv.task then if modeEnv.task then
@@ -450,14 +371,16 @@ function resetGameData()
garbageSpeed=.3 garbageSpeed=.3
pushSpeed=2 pushSpeed=2
end end
for i=1,#virtualkey do restoreVirtualKey()
virtualkey[i].press=false
end
stat.game=stat.game+1 stat.game=stat.game+1
local m,p=#freeRow,40*#players+1 local m,p=#freeRow,40*#players+1
while freeRow[p]do while freeRow[p]do
m,freeRow[m]=m-1 m,freeRow[m]=m-1
end end
for i=1,20 do
virtualkeyDown[i]=X
virtualkeyPressTime[i]=0
end
freeRow.L=#freeRow freeRow.L=#freeRow
SFX("ready") SFX("ready")
collectgarbage() collectgarbage()
@@ -472,8 +395,11 @@ function gameStart()
end end
end end
local dataOpt={ local dataOpt={
"run","game","time", "run","game","time",
"extraPiece","extraRate",
"key","rotate","hold","piece","row", "key","rotate","hold","piece","row",
"atk","send","recv","pend", "atk","send","recv","pend",
"clear_1","clear_2","clear_3","clear_4", "clear_1","clear_2","clear_3","clear_4",
@@ -483,9 +409,6 @@ local dataOpt={
function loadData() function loadData()
userData:open("r") userData:open("r")
local t=userData:read() local t=userData:read()
if not find(t,"spin")then
t=love.data.decompress("string","zlib",t)
end
t=splitS(t,"\r\n") t=splitS(t,"\r\n")
userData:close() userData:close()
for i=1,#t do for i=1,#t do
@@ -513,31 +436,37 @@ function saveData()
userData:write(t) userData:write(t)
userData:close() userData:close()
end end
function loadSetting() function loadSetting()
userSetting:open("r") userSetting:open("r")
local t=userSetting:read() local t=userSetting:read()
if not find(t,"virtual")then
t=love.data.decompress("string","zlib",t)
end
t=splitS(t,"\r\n") t=splitS(t,"\r\n")
userSetting:close() userSetting:close()
for i=1,#t do for i=1,#t do
local p=find(t[i],"=") local p=find(t[i],"=")
if p then if p then
local t,v=sub(t[i],1,p-1),sub(t[i],p+1) local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
if t=="sfx"or t=="bgm"or t=="voc"then if
setting[t]=toN(v:match("[012345678]"))or setting[t] --声音
t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or
--三个触摸设置项
t=="VKTchW"or t=="VKCurW"or t=="VKAlpha"
then
v=toN(v)
if v and v==int(v)and v>=0 and v<=10 then
setting[t]=v
end
elseif t=="vib"then elseif t=="vib"then
setting.vib=toN(v:match("[012345]"))or 0 setting.vib=toN(v:match("[012345]"))or 0
elseif t=="fullscreen"then elseif t=="fullscreen"then
setting.fullscreen=v=="true" setting.fullscreen=v=="true"
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(setting.fullscreen)
elseif t=="virtualkeyAlpha"then
setting.virtualkeyAlpha=min(int(abs(toN(v))),10)
elseif elseif
--开关设置们
t=="bg"or
t=="ghost"or t=="center"or t=="grid"or t=="swap"or t=="ghost"or t=="center"or t=="grid"or t=="swap"or
t=="quickR"or t=="bgblock"or t=="smo"or t=="quickR"or t=="fine"or t=="bgblock"or t=="smo"or
t=="virtualkeyIcon"or t=="virtualkeySwitch" t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon"
then then
setting[t]=v=="true" setting[t]=v=="true"
elseif t=="frameMul"then elseif t=="frameMul"then
@@ -559,14 +488,15 @@ function loadSetting()
setting.keyMap[i][j]=v1[j] setting.keyMap[i][j]=v1[j]
end end
end end
elseif t=="virtualkey"then elseif t=="VK"then
v=splitS(v,"/") v=splitS(v,"/")
for i=1,10 do local SK
for i=1,#v do
if v[i]then if v[i]then
virtualkey[i]=splitS(v[i],",") SK=splitS(v[i],",")
for j=1,4 do local K=VK_org[i]
virtualkey[i][j]=toN(virtualkey[i][j]) K.ava=SK[1]=="T"
end K.x,K.y,K.r=toN(SK[2]),toN(SK[3]),toN(SK[4])
end end
end end
end end
@@ -578,6 +508,7 @@ local saveOpt={
"sddas","sdarr", "sddas","sdarr",
"quickR", "quickR",
"swap", "swap",
"fine",
"ghost","center", "ghost","center",
"smo","grid", "smo","grid",
@@ -594,18 +525,26 @@ local saveOpt={
"sfx","bgm", "sfx","bgm",
"vib","voc", "vib","voc",
"stereo",
"virtualkeyAlpha", "VKSwitch",
"virtualkeyIcon", "VKTrack",
"virtualkeySwitch", "VKDodge",
"VKTchW",
"VKCurW",
"VKIcon",
"VKAlpha",
} }
function saveSetting() function saveSetting()
local vk={} local vk={}--virtualkey table
for i=1,10 do for i=1,#VK_org do
for j=1,4 do local V=VK_org[i]
virtualkey[i][j]=int(virtualkey[i][j]+.5) vk[i]=concat({
end--Saving a integer is better? V.ava and"T"or"F",
vk[i]=concat(virtualkey[i],",") int(V.x+.5),
int(V.y+.5),
V.r,
},",")
end--pre-pack virtualkey setting end--pre-pack virtualkey setting
local map={} local map={}
for i=1,16 do for i=1,16 do
@@ -613,11 +552,10 @@ function saveSetting()
end end
local t={ local t={
"keymap="..toS(concat(map,"/")), "keymap="..toS(concat(map,"/")),
"virtualkey="..toS(concat(vk,"/")), "VK="..toS(concat(vk,"/")),
} }
for i=1,#saveOpt do for i=1,#saveOpt do
t[i+2]=saveOpt[i].."="..toS(setting[saveOpt[i]]) t[#t+1]=saveOpt[i].."="..toS(setting[saveOpt[i]])
--not always i+2!
end end
t=concat(t,"\r\n") t=concat(t,"\r\n")
userSetting:open("w") userSetting:open("w")

View File

@@ -1,24 +1,58 @@
local S=[=[ local S=[=[
Patron(rmb10+):
gggf/T080/Ykzl/zxc
[D*a]?
Future outlook: Future outlook:
Normal Things: Normal Things:
force fineese mode powerinfo switch
highscore of most modes splashing block
ajustable next count
new mode system
custom block color/direction custom block color/direction
custom sequence
virtual key switch(all keys)
combo mode combo mode
infinite c4w mode bigbang mode
any screen size
CC smarter(think of gaebage buffer)
fineese/bigbang mode & easier CTWC
new AI:task-Z
game recording
TTT mode TTT mode
custom block sequence
CC smarter(think of gaebage buffer)
game recording
new AI:task-Z
auto GUI in any screen size
Technical things: Technical things:
Encrypt source code(compile to byte code) Encrypt source code(compile to byte code)
infinite 1v1 infinite 1v1
square mode square mode
more FXs & 3d features & animations more FXs & 3d features & animations
0.7.33+:
MORE POWERFUL 9-stack AI
add stereo-setting slider
code optimized
bug fixed
0.7.32:
Blind-GM now show section directly
easier&more standard classic mode
can switch Virtualkey's auto dodging
in-game setting
code optimized
bug fixed
0.7.31:
stereo system
fixed a problem in finesse calculating
0.7.30:
auto-tracking virtual key,adjustable parameters!
can switch on/off virtuakeys
add 7 more key
better finesse rate calculating
block generating position on Y-axis changed
new icon for android
can use preset in custom mode with keyboard
adjusted GUI
many bug fixed
0.7.28:
add fineese check(almost useful)
code optimized
0.7.27: 0.7.27:
super O transform system super O transform system
optimized light system(no used) optimized light system(no used)
@@ -224,11 +258,10 @@ Future outlook:
]=] ]=]
local find,sub=string.find,string.sub local find,sub=string.find,string.sub
local L,n,p={},1,1 local L,n,p={},1,1
local eof=#S local EOF=#S
repeat repeat
p1=find(S,"\n",p) p1=find(S,"\n",p)
L[n]=sub(S,p,p1-1) L[n]=sub(S,p,p1-1)
n=n+1 n,p=n+1,p1+1
p=p1+1 until p1==EOF
until p1==eof
return L return L