Compare commits

...

42 Commits

Author SHA1 Message Date
MrZ626
b1fc121a46 0.10.7:15P更新 2020-08-31 23:11:25 +08:00
MrZ626
8e2b49d529 修改15p进入方法 2020-08-31 23:11:13 +08:00
MrZ626
653d81d5f8 取消font文件追踪 2020-08-31 23:09:56 +08:00
MrZ626
fea9da1710 部分控件重排版 2020-08-31 21:46:51 +08:00
MrZ626
0f9fe54957 15p退出按钮忘了放好 2020-08-31 21:46:26 +08:00
MrZ626
851c34dc46 删行末空格 2020-08-31 16:56:04 +08:00
MrZ626
f162733f82 攻击特效和徽章特效并入sysFX 2020-08-31 16:52:26 +08:00
MrZ626
91b2e0b9db 在倒计时阶段按一些按键会报错 2020-08-31 16:41:59 +08:00
MrZ626
7e2af7fe2e 同场景代码整合到scenes.lua 2020-08-31 16:41:05 +08:00
MrZ626
331d932c9e 修改设置值域后虚拟按键透明度过低 2020-08-30 00:41:40 +08:00
MrZ626
c28a467529 15p返回按钮 2020-08-30 00:34:51 +08:00
MrZ626
edfe100027 15puzzle 2020-08-29 22:59:24 +08:00
MrZ626
e370cc42ec 场景事件函数全局化,准备场景文件独立 2020-08-29 11:51:27 +08:00
MrZ626
5024851ed2 统一sceneTemp的local变量名 2020-08-29 02:57:09 +08:00
MrZ626
ac5c6ef7b4 修复挖掘模式涨行不刷新ghost 2020-08-29 02:56:01 +08:00
MrZ626
ea1fe0237c 正方形按钮控件省略宽度信息 2020-08-28 11:39:20 +08:00
MrZ626
b9722dcca1 ghost和center透明度可调,部分设置值域改为[0%,100%],控件交互优化,滑条显示当前值 2020-08-27 03:52:13 +08:00
MrZ626
f6ff36c142 控制设置页面预览显示bug 2020-08-27 03:51:27 +08:00
MrZ626
ecf037f27d 0.10.6:CC更新 2020-08-26 00:22:54 +08:00
MrZ626
cf5844a2af O卡住的时候旋转不刷新锁定延迟 2020-08-26 00:22:04 +08:00
MrZ626
b2f8abb884 修改中文的tips 2020-08-26 00:21:24 +08:00
MrZ626
128ab01cf0 cc适配代码调整 2020-08-26 00:21:19 +08:00
MrZ626
a62945a71d cc库文件夹添加进gitignore 2020-08-25 02:24:27 +08:00
MrZ626
9ff8cd3aaa 修改UVRY的踢墙表 2020-08-25 02:21:37 +08:00
MrZ626
b1306ac220 隐形-瞬隐模式强制关闭瞬落/锁定特效 2020-08-25 02:21:32 +08:00
MrZ626
57a89c3859 代码/注释整理 2020-08-25 02:21:26 +08:00
MrZ626
610d953803 修复没开软件锁报错 2020-08-25 02:21:12 +08:00
MrZ626
b788f26f50 修复cc不能用的问题 2020-08-25 02:14:24 +08:00
MrZ626
e5f489fbab 代码整理,修复一个读取问题 2020-08-23 00:16:59 +08:00
MrZ626
4786ab59b0 代码整理 2020-08-23 00:16:30 +08:00
MrZ626
8c7e2da69a 软件锁加新功能和彩蛋 2020-08-23 00:16:04 +08:00
MrZ626
f511aa2f6f 软件锁也可显示tip 2020-08-23 00:15:29 +08:00
MrZ_26
46b119601b Merge pull request #22 from Gompyn/AndroidCC
CC for Android(and Linux)
2020-08-22 15:58:37 +08:00
MrZ_26
d4238da156 Merge pull request #21 from Gompyn/resolve-conflict-with-MrZ626/master
adapt cold-clear 45d5276 and update field when block placement is wrong
2020-08-22 15:55:44 +08:00
MrZ_26
f9cf35f746 输入重置码也可解锁游戏 2020-08-22 02:19:14 +08:00
Gompyn
097129bd08 Merge branch 'master' into resolve-conflict-with-MrZ626/master 2020-08-21 20:36:22 +08:00
Gompyn
c72dedf7cf try load CCloaders one by one
it will try all available CCloaders in game.love and go back to 9S
if all CCloaders are not available
2020-08-15 02:37:16 +08:00
Gompyn
5342d4f6d6 make CC update field *after* locking 2020-07-31 17:19:36 +08:00
Gompyn
6641d402c0 Fix variable scope 2020-07-30 14:30:17 +08:00
Gompyn
86ffc4a207 add CC on android (and Linux btw) 2020-07-29 16:04:35 +08:00
Gompyn
71130bbced make cc update field when block placement is wrong 2020-07-29 15:01:38 +08:00
Gompyn
17d670a1ba adapt cold-clear 45d5276 2020-07-29 14:47:49 +08:00
37 changed files with 2464 additions and 1955 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
lib
font.ttf

View File

@@ -175,7 +175,7 @@ back.fan={
gc.setLineWidth(320)
gc.setColor(.3,.2,.3)
gc.arc("line","open",0,420,500,-.8*3.1416,-.2*3.1416)
gc.setLineWidth(4)
gc.setColor(.7,.5,.65)
gc.arc("line","open",0,420,660,-.799*3.1416,-.201*3.1416)

View File

@@ -3,7 +3,7 @@ local rem=table.remove
local function fadeOut(id)
local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm*.01
local v=src:getVolume()-.025*setting.bgm
src:setVolume(v>0 and v or 0)
if v<=0 then
src:stop()
@@ -12,10 +12,10 @@ local function fadeOut(id)
end
local function fadeIn(id)
local src=BGM.list[id]
local v=setting.bgm*.01
local v=setting.bgm
v=min(v,src:getVolume()+.025*v)
src:setVolume(v)
if v>=setting.bgm*.01 then return true end
if v>=setting.bgm then return true end
end
local BGM={
@@ -68,7 +68,7 @@ function BGM.play(s)
end
function BGM.freshVolume()
if BGM.playing then
local v=setting.bgm*.01
local v=setting.bgm
if v>0 then
BGM.playing:setVolume(v)
if BGM.suspend then
@@ -76,9 +76,10 @@ function BGM.freshVolume()
BGM.nowPlay,BGM.suspend=BGM.suspend
end
else
BGM.playing:setVolume(0)
BGM.playing:pause()
BGM.suspend,BGM.nowPlay=BGM.nowPlay
if BGM.nowPlay then
BGM.playing:pause()
BGM.suspend,BGM.nowPlay=BGM.nowPlay
end
end
end
end

View File

@@ -16,8 +16,6 @@ WIDGET= require("Zframework/widget")
Widgets=require("Zframework/widgetList")
LIGHT= require("Zframework/light")
SCN= require("Zframework/scene")
local Tmr=require("Zframework/timer")
local Pnt=require("Zframework/paint")
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local gc,sys=love.graphics,love.system
@@ -122,11 +120,18 @@ local function wheelScroll(y)
floatWheel=floatWheel+1
end
end
local mouseClick,touchClick={},{}
local mouseDown,mouseMove,mouseUp,wheelMoved={},{},{},{}
local touchDown,touchUp,touchMove={},{},{}
local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{}
mouseClick,touchClick={},{}
mouseDown,mouseMove,mouseUp,wheelMoved={},{},{},{}
touchDown,touchUp,touchMove={},{},{}
keyDown,keyUp={},{}
gamepadDown,gamepadUp={},{}
local mouseClick,touchClick=mouseClick,touchClick
local mouseDown,mouseMove,mouseUp,wheelMoved=mouseDown,mouseMove,mouseUp,wheelMoved
local touchDown,touchUp,touchMove=touchDown,touchUp,touchMove
local keyDown,keyUp=keyDown,keyUp
local gamepadDown,gamepadUp=gamepadDown,gamepadUp
function keyDown.calculator(k)
local S=sceneTemp
@@ -170,9 +175,9 @@ function keyDown.calculator(k)
end
S.sym="="
S.reg=false
if S.val==626 then
if S.val==600+20+6 then
S.pass=true
elseif S.val==196022 then
elseif S.val==196000+022 then
S.pass=true
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
@@ -187,17 +192,160 @@ function keyDown.calculator(k)
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
elseif S.val==137926261379 then
elseif S.val==1379e8+2626e4+1379 then
S.pass=true
SCN.go("debug")
elseif S.val==34494 then
error("This is an error testing message.")
elseif S.val==114 then
S.reg=514
elseif S.val==114514 then
S.reg=1919810
elseif S.val==1145141919810 then
error("小鬼自裁请")
elseif S.val==123456789 then
S.reg=123456789
S.val=987654321
elseif S.val==815 or S.val==1524 or S.val==2435 then
SCN.go("p15")
end
end
elseif k=="space"then
if S.pass then
SCN.swapTo("intro")
end
elseif k=="escape"then
S.val,S.reg,S.sym=0
elseif k=="delete"then
S.val=0
elseif k=="space"and S.pass then
SCN.swapTo("intro")
end
end
local function moveU(S,b,x,y)
if y<4 then
b[y][x],b[y+1][x]=b[y+1][x],b[y][x]
S.y=y+1
end
end
local function moveD(S,b,x,y)
if y>1 then
b[y][x],b[y-1][x]=b[y-1][x],b[y][x]
S.y=y-1
end
end
local function moveL(S,b,x,y)
if x<4 then
b[y][x],b[y][x+1]=b[y][x+1],b[y][x]
S.x=x+1
end
end
local function moveR(S,b,x,y)
if x>1 then
b[y][x],b[y][x-1]=b[y][x-1],b[y][x]
S.x=x-1
end
end
local function shuffleBoard(S,b)
for i=1,300 do
i=rnd()
if i<.25 then moveU(S,b,S.x,S.y)
elseif i<.5 then moveD(S,b,S.x,S.y)
elseif i<.75 then moveL(S,b,S.x,S.y)
else moveR(S,b,S.x,S.y)
end
end
end
local function checkBoard(b)
for i=4,1,-1 do
for j=1,4 do
if b[i][j]~=4*i+j-4 then return false end
end
end
return true
end
local function tapBoard(x,y,key)
local S=sceneTemp
if S.state<2 then
if not key then
sysFX.newRipple(.16,x,y,10)
x,y=int((x-320)/160)+1,int((y-40)/160)+1
end
local b=S.board
local moves=0
if S.x==x then
if y>S.y and y<5 then
for i=S.y,y-1 do
moveU(S,b,x,i)
moves=moves+1
end
elseif y<S.y and y>0 then
for i=S.y,y+1,-1 do
moveD(S,b,x,i)
moves=moves+1
end
end
elseif S.y==y then
if x>S.x and x<5 then
for i=S.x,x-1 do
moveL(S,b,i,y)
moves=moves+1
end
elseif x<S.x and x>0 then
for i=S.x,x+1,-1 do
moveR(S,b,i,y)
moves=moves+1
end
end
end
if moves>0 then
SFX.play("move")
S.move=S.move+moves
if S.state==0 then
S.state=1
S.startTime=Timer()
end
if checkBoard(b)then
S.state=2
S.time=Timer()-S.startTime
SFX.play("win")
end
end
end
end
function keyDown.p15(k)
local S=sceneTemp
local b=S.board
if k=="up"then
tapBoard(S.x,S.y+1,true)
elseif k=="down"then
tapBoard(S.x,S.y-1,true)
elseif k=="left"then
tapBoard(S.x+1,S.y,true)
elseif k=="right"then
tapBoard(S.x-1,S.y,true)
elseif k=="space"then
shuffleBoard(S,b)
S.state=0
S.time=0
S.move=0
elseif S.state==0 then
if k=="c"then
S.color=not S.color
elseif k=="h"then
S.blind=not S.blind
end
end
end
function mouseDown.p15(x,y,k)
tapBoard(x,y)
end
function mouseMove.p15(x,y)
tapBoard(x,y)
end
function touchDown.p15(id,x,y)
tapBoard(x,y)
end
function touchMove.p15(id,x,y,dx,dy)
tapBoard(x,y)
end
function keyDown.load(k)
if k=="a"then
@@ -712,7 +860,7 @@ function touchDown.play(id,x,y)
if t then
players[1]:pressKey(t)
if setting.VKSFX>0 then
SFX.play("virtualKey",setting.VKSFX*.25)
SFX.play("virtualKey",setting.VKSFX)
end
virtualkey[t].isDown=true
virtualkey[t].pressTime=10
@@ -865,6 +1013,7 @@ end
function love.mousereleased(x,y,k,touch,num)
if touch or SCN.swapping then return end
mx,my=xOy:inverseTransformPoint(x,y)
WIDGET.release(mx,my)
if mouseUp[SCN.cur]then
mouseUp[SCN.cur](mx,my,k)
end
@@ -913,6 +1062,7 @@ function love.touchreleased(id,x,y)
x,y=xOy:inverseTransformPoint(x,y)
if id==touching then
WIDGET.press(x,y)
WIDGET.release(x,y)
touching=nil
WIDGET.sel=nil
end

View File

@@ -198,6 +198,12 @@ local langList={
["/"]="/",
play="开始",
},
p15={
reset="重新开始",
color="颜色",
hide="",
back="退出",
},
main={
play="开始",
setting="设置",
@@ -669,6 +675,12 @@ local langList={
["/"]="/",
play="开始",
},
p15={
reset="重新开始",
color="颜色",
hide="",
back="退出",
},
main={
play="开始",
setting="设置",
@@ -1130,6 +1142,12 @@ local langList={
["/"]="/",
play="Play",
},
p15={
reset="Reset",
color="Color",
hide="Blind",
back="Back",
},
main={
play="Play",
setting="Settings",
@@ -1589,6 +1607,12 @@ local langList={
["/"]="/",
play="!!!",
},
p15={
reset="Reset",
color="Color",
hide="Blind",
back="X",
},
main={
play="!!!",
setting="_?_",
@@ -2062,6 +2086,12 @@ local langList={
["/"]="/",
play="开始",
},
p15={
reset="Reset",
color="",
hide="",
back="退出",
},
main={
play="开始",
setting="设置",

View File

@@ -1,873 +0,0 @@
local gc=love.graphics
local setFont=setFont
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local format=string.format
local Timer=love.timer.getTime
local mStr=mStr
local scr=scr
local scs=require("parts/spinCenters")
local modeRankColor={
color.dRed, --D
color.dOrange, --C
color.lYellow, --B
color.lBlue, --A
color.lCyan, --S
color.lGreen, --Special
}
local rankString={
"D","C","B","A","S",
}
local miniTitle_rect={
{2,0,5,1},{4,1,1,6},
{9,0,4,1},{9,3,4,1},{9,6,4,1},{8,0,1,7},
{15,0,3,1},{15,6,3,1},{14,0,1,7},
{19,0,1,7},{23,0,1,7},{20,3,3,1},
{0,8,1,6},{6,8,1,6},{1,9,1,1},{2,10,1,1},{3,11,1,1},{4,10,1,1},{5,9,1,1},
{8,8,5,1},{8,13,5,1},{10,9,1,4},
{14,8,1,6},{19,8,1,6},{15,9,1,1},{16,10,1,1},{17,11,1,1},{18,12,1,1},
{21,8,5,1},{21,13,5,1},{21,9,1,4},{25,9,1,4},
}
FX_attack={}--Attack beam
FX_badge={}--Badge thrown
local function drawAtkPointer(x,y)
local t=sin(Timer()*20)
gc.setColor(.2,.7+t*.2,1,.6+t*.4)
gc.circle("fill",x,y,25,6)
local a=Timer()*3%1*.8
gc.setColor(0,.6,1,.8-a)
gc.circle("line",x,y,30*(1+a),6)
end
local function VirtualkeyPreview()
if setting.VKSwitch then
for i=1,#VK_org do
local B=VK_org[i]
if B.ava then
local c=sceneTemp.sel==i and .6 or 1
gc.setColor(c,1,c,setting.VKAlpha*.1)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)
if setting.VKIcon then gc.draw(TEXTURE.VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end
end
end
end
end
local function drawVirtualkey()
local V=virtualkey
local a=setting.VKAlpha*.1
local _
if setting.VKIcon then
local icons=TEXTURE.VKIcon
for i=1,#V do
if V[i].ava then
local B=V[i]
gc.setColor(1,1,1,a)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)--Button outline
_=V[i].pressTime
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--Icon
if _>0 then
gc.setColor(1,1,1,a*_*.08)
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04),10)--Ripple
end
end
end
else
for i=1,#V do
if V[i].ava then
local B=V[i]
gc.setColor(1,1,1,a)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)
_=V[i].pressTime
if _>0 then
gc.setColor(1,1,1,a*_*.08)
gc.circle("fill",B.x,B.y,B.r*.94,10)
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04),10)
end
end
end
end
end
local Pnt={}
function Pnt.calculator()
local S=sceneTemp
gc.setLineWidth(4)
gc.rectangle("line",100,80,650,150)
setFont(45)
if S.reg then gc.printf(S.reg,0,100,720,"right")end
if S.val then gc.printf(S.val,0,150,720,"right")end
setFont(50)
if S.sym then gc.print(S.sym,126,150)end
end
function Pnt.load()
local S=sceneTemp
gc.setLineWidth(4)
gc.setColor(1,1,1,.5)
gc.rectangle("fill",300,330,S.cur/S.tar*680,60,5)
gc.setColor(1,1,1)
gc.rectangle("line",300,330,680,60,5)
if not setting.appLock then
setFont(35)
gc.print(text.load[S.phase],340,335)
if S.phase~=0 then
gc.printf(S.cur.."/"..S.tar,795,335,150,"right")
end
setFont(25)
mStr(S.tip,640,400)
end
end
local titleTransform={
function(t)
gc.translate(0,max(50-t,0)^2/25)
end,
function(t)
gc.translate(0,-max(50-t,0)^2/25)
end,
function(t,i)
local d=max(50-t,0)
gc.translate(sin(Timer()*3+626*i)*d,cos(Timer()*3+626*i)*d)
end,
function(t,i)
local d=max(50-t,0)
gc.translate(sin(Timer()*3+626*i)*d,-cos(Timer()*3+626*i)*d)
end,
function(t)
gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)
end,
}
function Pnt.intro()
local s=sceneTemp
local t=s.t1
local T=(t+110)%300
if T<30 then
gc.setLineWidth(4+(30-T)^1.626/62)
else
gc.setLineWidth(4)
end
local L=title
gc.push("transform")
gc.translate(126,226)
for i=1,8 do
local T=t-i*15
if T>0 then
gc.push("transform")
gc.setColor(1,1,1,min(T*.025,1))
titleTransform[s.r[i]](T,i)
local dt=(t+62-5*i)%300
if dt<20 then
gc.translate(0,abs(10-dt)-10)
end
gc.polygon("line",L[i])
gc.pop()
end
end
gc.pop()
t=s.t2
if t>=80 then
gc.setColor(1,1,1,.6+sin((t-80)*.0626)*.3)
mText(drawableText.anykey,640,615+sin(Timer()*3)*5)
end
end
function Pnt.main()
gc.setColor(1,1,1)
gc.draw(IMG.title_color,60,30,nil,1.3)
setFont(30)
gc.print(gameVersion,70,125)
gc.print(system,610,100)
local L=text.modes[stat.lastPlay]
setFont(25)
gc.print(L[1],700,470)
gc.print(L[2],700,500)
players[1]:draw()
end
function Pnt.mode()
local _
local cam=mapCam
gc.push("transform")
gc.translate(640,360)
gc.scale(cam.zoomK)
gc.translate(-cam.x1,-cam.y1)
gc.scale(cam.k1)
local R=modeRanks
local sel=cam.sel
setFont(30)
--Draw lines connecting modes
gc.setLineWidth(8)
gc.setColor(1,1,1,.2)
for name,M in next,Modes do
if R[name]then
for _=1,#M.unlock do
local m=Modes[M.unlock[_]]
gc.line(M.x,M.y,m.x,m.y)
end
end
end
for name,M in next,Modes do
if R[name]then
local S=M.size
local d=((M.x-(cam.x1+(sel and -180 or 0))/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.55
if d<500 then S=S*(1.25-d*0.0005) end
local c=modeRankColor[R[M.name]]
if c then
gc.setColor(c)
else
c=.5+sin(Timer()*6.26)*.2
S=S*(.9+c*.4)
gc.setColor(c,c,c)
end
if M.shape==1 then--Rectangle
gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S)
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
end
elseif M.shape==2 then--Diamond
gc.circle("fill",M.x,M.y,S+5,4)
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S+5,4)
end
elseif M.shape==3 then--Octagon
gc.circle("fill",M.x,M.y,S,8)
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S,8)
end
end
name=drawableText[rankString[R[M.name]]]
if name then
gc.setColor(0,0,0,.26)
mDraw(name,M.x,M.y)
end
--[[
if M.icon then
local i=M.icon
local l=i:getWidth()*.5
local k=S/l*.8
gc.setColor(0,0,0,2)
gc.draw(i,M.x-1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x-1,M.y+1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y+1,nil,k,nil,l,l)
gc.setColor(1,1,1)
gc.draw(i,M.x,M.y,nil,k,nil,l,l)
end
]]
end
end
gc.pop()
if sel then
local M=Modes[sel]
local lang=setting.lang
gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color)
setFont(40)mStr(text.modes[sel][1],1100,5)
setFont(30)mStr(text.modes[sel][2],1100,50)
gc.setColor(1,1,1)
setFont(28)gc.printf(text.modes[sel][3],920,110,360,"center")
if M.slowMark then
gc.draw(IMG.ctrlSpeedLimit,1230,50,nil,.4)
end
if M.score then
mText(drawableText.highScore,1100,240)
gc.setColor(.4,.4,.4,.8)
gc.rectangle("fill",940,290,320,280)--Highscore board
local L=M.records
gc.setColor(1,1,1)
if L[1]then
for i=1,#L do
local t=M.scoreDisp(L[i])
local s=#t
local dy
if s<15 then dy=0
elseif s<25 then dy=2
else dy=4
end
setFont(int(26-s*.4))
gc.print(t,955,275+dy+25*i)
setFont(10)
_=L[i].date
if _ then gc.print(_,1155,284+25*i)end
end
else
mText(drawableText.noScore,1100,370)
end
end
end
if cam.keyCtrl then
gc.setColor(1,1,1)
gc.draw(TEXTURE.mapCross,460-20,360-20)
end
end
function Pnt.music()
gc.setColor(1,1,1,.3+sin(Timer()*5)*.2)
gc.rectangle("fill",45,98+30*sceneTemp,250,30)
gc.setColor(.7,.7,.7)gc.draw(drawableText.musicRoom,20,20)
gc.setColor(1,1,1)gc.draw(drawableText.musicRoom,22,23)
gc.draw(drawableText.nowPlaying,490,390)
setFont(30)
for i=1,BGM.len do
gc.print(BGM.list[i],50,90+30*i)
end
gc.draw(IMG.title,640,310,nil,1.5,nil,206,35)
if BGM.nowPlay then
setFont(45)
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
mStr(BGM.nowPlay,630,460)
local t=-Timer()%2.3/2
if t<1 then
gc.setColor(1,1,1,t)
gc.draw(IMG.title_color,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
end
end
end
function Pnt.custom()
gc.setColor(1,1,1,.3+sin(Timer()*8)*.2)
gc.rectangle("fill",100,115+40*sceneTemp,570,40)
gc.setColor(.7,.7,.7)gc.draw(drawableText.custom,360,20)
gc.setColor(1,1,1)gc.draw(drawableText.custom,362,23)
setFont(35)
for i=1,#customID do
local k=customID[i]
local y=110+40*i
gc.printf(text.customOption[k],100,y,320,"right")
if text.customVal[k]then
gc.print(text.customVal[k][customSel[i]],440,y)
else
gc.print(customRange[k][customSel[i]],440,y)
end
end
end
function Pnt.sequence()
local s=sceneTemp
gc.setColor(.7,.7,.7)gc.draw(drawableText.sequence,120,-15)
gc.setColor(1,1,1)gc.draw(drawableText.sequence,122,-12)
gc.setLineWidth(4)
gc.rectangle("line",100,100,1080,260)
setFont(30)
local bag=preBag
local len=#bag
setFont(40)
gc.print(len,120,300)
local L=TEXTURE.miniBlock
local lib=SKIN.libColor
local set=setting.skin
local x,y=120,126
local cx,cy=120,126
for i=1,len do
local B=L[bag[i]]
gc.setColor(lib[set[bag[i]]])
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
x=x+B:getWidth()*15+10
if x>1126 then
x,y=120,y+50
end
if i==s.cur then
cx,cy=x,y
end
end
gc.setColor(.5,1,.5,.6+.4*sin(Timer()*6.26))
gc.line(cx-5,cy-20,cx-5,cy+20)
--Confirm reset
if s.sure>0 then
gc.setColor(1,1,1,s.sure*.02)
gc.draw(drawableText.question,980,470)
end
end
function Pnt.draw()
local sx,sy=sceneTemp.x,sceneTemp.y
gc.translate(200,60)
gc.setColor(1,1,1,.2)
gc.setLineWidth(1)
for x=1,9 do gc.line(30*x,0,30*x,600)end
for y=0,19 do gc.line(0,30*y,300,30*y)end
gc.setColor(1,1,1)
gc.setLineWidth(3)
gc.rectangle("line",-2,-2,304,604)
gc.setLineWidth(2)
local cross=puzzleMark[-1]
for y=1,20 do for x=1,10 do
local B=preField[y][x]
if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y)
elseif B==-1 and not sceneTemp.demo then
gc.draw(cross,30*x-30,600-30*y)
end
end end
if sx and sy then
gc.setLineWidth(2)
gc.rectangle("line",30*sx-30,600-30*sy,30,30)
end
gc.translate(-200,-60)
--Pen
local pen=sceneTemp.pen
if pen>0 then
gc.setLineWidth(13)
gc.setColor(SKIN.libColor[pen])
gc.rectangle("line",565,460,70,70)
elseif pen==-1 then
gc.setLineWidth(5)
gc.setColor(.9,.9,.9)
gc.line(575,470,625,520)
gc.line(575,520,625,470)
end
--Confirm reset
if sceneTemp.sure>0 then
gc.setColor(1,1,1,sceneTemp.sure*.02)
gc.draw(drawableText.question,1040,430)
end
--Block name
setFont(40)
local _
for i=1,7 do
_=setting.skin[i]
gc.setColor(SKIN.libColor[_])
mStr(text.block[i],500+65*_,65)
end
end
function Pnt.play()
if marking then
setFont(26)
local t=Timer()
gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t)))
mStr(text.marking,190,60+26*sin(t))
end
for p=1,#players do
players[p]:draw()
end
gc.setLineWidth(5)
for i=1,#FX_attack do
local A=FX_attack[i]
gc.push("transform")
local a=(A.t<10 and A.t*.05 or A.t>50 and 6-A.t*.1 or 1)*A.a
gc.setColor(A.r,A.g,A.b,a*.5)
gc.circle("line",0,0,A.rad,A.corner)
local L=A.drag
local len=#L
for i=1,len,2 do
gc.setColor(A.r,A.g,A.b,.4*a*i/len)
gc.translate(L[i],L[i+1])
gc.rotate(A.t*.1)
gc.circle("fill",0,0,A.rad,A.corner)
gc.rotate(-A.t*.1)
gc.translate(-L[i],-L[i+1])
end
gc.setColor(A.r,A.g,A.b,a)
gc.translate(A.x,A.y)
gc.rotate(A.t*.1)
gc.circle("fill",0,0,A.rad,A.corner)
gc.pop()
end
gc.setColor(1,1,1)
if setting.VKSwitch then drawVirtualkey()end
if modeEnv.royaleMode then
for i=1,#FX_badge do
local b=FX_badge[i]
gc.setColor(1,1,1,b.t<10 and b.t*.1 or b.t<50 and 1 or(60-b.t)*.1)
if b.t<10 then
gc.draw(IMG.badgeIcon,b[1]-14,b[2]-14)
elseif b.t<50 then
local t=((b.t-10)*.025)t=(3-2*t)*t*t
gc.draw(IMG.badgeIcon,b[1]*(1-t)+b[3]*t-14,b[2]*(1-t)+b[4]*t-14)
else
gc.draw(IMG.badgeIcon,b[3]-14,b[4]-14)
end
end
local P=players[1]
gc.setLineWidth(5)
gc.setColor(.8,1,0,.2)
for i=1,#P.atker do
local p=P.atker[i]
gc.line(p.centerX,p.centerY,P.x+300*P.size,P.y+670*P.size)
end
if P.atkMode~=4 then
if P.atking then drawAtkPointer(P.atking.centerX,P.atking.centerY)end
else
for i=1,#P.atker do
local p=P.atker[i]
drawAtkPointer(p.centerX,p.centerY)
end
end
end
--Mode info
gc.setColor(1,1,1,.8)
gc.draw(drawableText.modeName,485,10)
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10)
--Replaying
if game.replaying then
gc.setColor(1,1,Timer()%1>.5 and 1 or 0)
mText(drawableText.replaying,410,17)
end
--Warning
gc.push("transform")
gc.origin()
if restartCount>0 then
gc.setColor(0,0,0,restartCount*.05)
gc.rectangle("fill",0,0,scr.W,scr.H)
end
if game.warnLVL>0 then
gc.setColor(0,0,0,0)
SHADER.warning:send("level",game.warnLVL)
gc.setShader(SHADER.warning)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end
gc.pop()
end
local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}for i=1,6 do hexList[i]=hexList[i]*150 end
local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25}
local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13}
function Pnt.pause()
local S=sceneTemp
local T=S.timer*.02
if T<1 or game.result then Pnt.play()end
--Dark BG
local _=T
if game.result then _=_*.7 end
gc.setColor(.15,.15,.15,_)
gc.push("transform")
gc.origin()
gc.rectangle("fill",0,0,scr.W,scr.H)
gc.pop()
--Pause Info
setFont(25)
if game.pauseCount>0 then
gc.setColor(1,.4,.4,T)
gc.print(text.pauseCount..":["..game.pauseCount.."] "..format("%.2f",game.pauseTime).."s",70,100)
end
gc.setColor(1,1,1,T)
--Mode Info
_=drawableText.modeName
gc.draw(_,40,170)
gc.draw(drawableText.levelName,60+_:getWidth(),170)
--Result Text
setFont(35)
mText(game.result and drawableText[game.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
--Infos
if game.frame>180 then
_=S.list
setFont(26)
for i=1,10 do
gc.print(text.pauseStat[i],40,210+40*i)
gc.printf(_[i],195,210+40*i,300,"right")
end
end
--Radar Chart
if T>.5 and game.frame>180 then
T=T*2-1
gc.setLineWidth(2)
gc.push("transform")
gc.translate(1026,400)
--Polygon
gc.push("transform")
gc.scale((3-2*T)*T)
gc.setColor(1,1,1,T*(.5+.3*sin(Timer()*6.26)))gc.polygon("line",S.standard)
_=S.color
gc.setColor(_[1],_[2],_[3],T*.626)
_=S.val
for i=1,9,2 do
gc.polygon("fill",0,0,_[i],_[i+1],_[i+2],_[i+3])
end
gc.polygon("fill",0,0,_[11],_[12],_[1],_[2])
gc.setColor(1,1,1,T)gc.polygon("line",S.val)
gc.pop()
--Axes
gc.setColor(1,1,1,T)
for i=1,3 do
local x,y=hexList[2*i-1],hexList[2*i]
gc.line(-x,-y,x,y)
end
--Texts
local C
_=Timer()%6.2832
if _>3.1416 then
gc.setColor(1,1,1,-T*sin(_))
setFont(35)
C,_=text.radar,textPos
else
gc.setColor(1,1,1,T*sin(_))
setFont(18)
C,_=S.radar,dataPos
end
for i=1,6 do
mStr(C[i],_[2*i-1],_[2*i])
end
gc.pop()
end
end
function Pnt.setting_game()
gc.setColor(1,1,1)
mText(drawableText.setting_game,640,15)
gc.draw(blockSkin[int(Timer()*2)%11+1],590,540,Timer()%6.28319,2,nil,15,15)
end
function Pnt.setting_video()
gc.setColor(1,1,1)
mText(drawableText.setting_video,640,15)
end
function Pnt.setting_sound()
gc.setColor(1,1,1)
mText(drawableText.setting_sound,640,15)
local t=Timer()
local _=sceneTemp.jump
local x,y=800,340+10*sin(t*.5)+(_-10)*_*.3
gc.translate(x,y)
gc.draw(IMG.miyaCH,0,0)
gc.setColor(1,1,1,.7)
gc.draw(IMG.miyaF1,4,47+4*sin(t*.9))
gc.draw(IMG.miyaF2,42,107+5*sin(t))
gc.draw(IMG.miyaF3,93,126+3*sin(t*.7))
gc.draw(IMG.miyaF4,129,98+3*sin(t*.7))
gc.translate(-x,-y)
end
local function timeConv(t)
return t.."F "..int(t*16.67).."ms"
end
function Pnt.setting_control()
--Testing grid line
gc.setLineWidth(4)
gc.setColor(1,1,1,.4)
gc.line(550,540,950,540)
gc.line(550,580,950,580)
gc.line(550,620,950,620)
for x=590,910,40 do
gc.line(x,530,x,630)
end
gc.setColor(1,1,1)
gc.line(550,530,550,630)
gc.line(950,530,950,630)
--Texts
gc.setColor(.7,.7,.7)gc.draw(drawableText.setting_control,80,50)
gc.setColor(1,1,1)gc.draw(drawableText.setting_control,80,50)
setFont(50)
gc.printf(text.preview,320,540,200,"right")
--Floating number
setFont(30)
local _=setting
mStr(timeConv(_.das),226+35*_.das,145)
mStr(timeConv(_.arr),226+35*_.arr,235)
mStr(timeConv(_.sddas),226+35*_.sddas,325)
mStr(timeConv(_.sdarr),226+35*_.sdarr,415)
--Testing O mino
_=blockSkin[setting.skin[6]]
local x=550+40*sceneTemp.pos
gc.draw(_,x,540,nil,40/30)
gc.draw(_,x,580,nil,40/30)
gc.draw(_,x+40,540,nil,40/30)
gc.draw(_,x+40,580,nil,40/30)
end
function Pnt.setting_key()
local s=sceneTemp
local a=.3+sin(Timer()*15)*.1
if s.kS then gc.setColor(1,.3,.3,a)else gc.setColor(1,.7,.7,a)end
gc.rectangle("fill",
s.kb<11 and 240 or 840,
45*s.kb+20-450*int(s.kb/11),
200,45
)
if s.jS then gc.setColor(.3,.3,.1,a)else gc.setColor(.7,.7,1,a)end
gc.rectangle("fill",
s.js<11 and 440 or 1040,
45*s.js+20-450*int(s.js/11),
200,45
)
--Selection rect
gc.setColor(1,.3,.3)
mText(drawableText.keyboard,340,30)
mText(drawableText.keyboard,940,30)
gc.setColor(.3,.3,1)
mText(drawableText.joystick,540,30)
mText(drawableText.joystick,1140,30)
gc.setColor(1,1,1)
setFont(26)
local b1,b2=keyMap[s.board],keyMap[s.board+2]
for N=1,20 do
if N<11 then
gc.printf(text.acts[N],47,45*N+22,180,"right")
mStr(b1[N],340,45*N+22)
mStr(b2[N],540,45*N+22)
else
gc.printf(text.acts[N],647,45*N-428,180,"right")
mStr(b1[N],940,45*N-428)
mStr(b2[N],1040,45*N-428)
end
end
gc.setLineWidth(2)
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
setFont(35)
gc.print(text.page..s.board,280,590)
gc.draw(drawableText.ctrlSetHelp,50,650)
end
function Pnt.setting_skin()
gc.setColor(.7,.7,.7)gc.draw(drawableText.setting_skin,80,50)
gc.setColor(1,1,1)gc.draw(drawableText.setting_skin,80,50)
for N=1,7 do
local face=setting.face[N]
local B=blocks[N][face]
local x,y=-55+140*N-scs[N][face][2]*30,355+scs[N][face][1]*30
local col=#B[1]
for i=1,#B do for j=1,col do
if B[i][j]then
gc.draw(blockSkin[setting.skin[N]],x+30*j,y-30*i)
end
end end
gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5)
end
for i=1,6 do
gc.draw(blockSkin[11+i],570+60*i,610,nil,2)
end
end
function Pnt.setting_touch()
gc.setColor(1,1,1)
gc.setLineWidth(7)gc.rectangle("line",340,15,600,690)
gc.setLineWidth(3)gc.rectangle("line",490,85,300,600)
VirtualkeyPreview()
local d=snapLevelValue[sceneTemp.snap]
if d>=10 then
gc.setLineWidth(3)
gc.setColor(1,1,1,sin(Timer()*4)*.1+.1)
for i=1,1280/d-1 do
gc.line(d*i,0,d*i,720)
end
for i=1,720/d-1 do
gc.line(0,d*i,1280,d*i)
end
end
end
function Pnt.setting_trackSetting()
gc.setColor(1,1,1)
mText(drawableText.VKTchW,140+50*setting.VKTchW,260)
mText(drawableText.VKOrgW,140+50*setting.VKTchW+50*setting.VKCurW,320)
mText(drawableText.VKCurW,640+50*setting.VKCurW,380)
end
function Pnt.help()
setFont(20)
gc.setColor(1,1,1)
for i=1,#text.help do
gc.printf(text.help[i],150,35*i+40,1000,"center")
end
setFont(19)
gc.print(text.used,30,330)
gc.draw(IMG.title,280,610,.1,1+.05*sin(Timer()*2.6),nil,206,35)
gc.setLineWidth(3)
gc.rectangle("line",18,18,263,263)
gc.rectangle("line",1012,18,250,250)
gc.draw(IMG.pay1,20,20)
gc.draw(IMG.pay2,1014,20)
setFont(20)
mStr(text.group,640,490)
gc.setColor(1,1,1,sin(Timer()*20)*.3+.6)
setFont(30)
mStr(text.support,150+sin(Timer()*4)*20,283)
mStr(text.support,1138-sin(Timer()*4)*20,270)
end
function Pnt.staff()
local L=text.staff
local t=sceneTemp.time
setFont(40)
for i=1,#L do
mStr(L[i],640,800+80*i-t*40)
end
mDraw(IMG.title_color,640,800-t*40,nil,2)
mDraw(IMG.title_color,640,2160-t*40,nil,2)
end
function Pnt.stat()
local chart=sceneTemp.chart
setFont(24)
local _,__=SKIN.libColor,setting.skin
local A,B=chart.A1,chart.A2
for x=1,7 do
gc.setColor(_[__[x]])
mStr(text.block[x],80*x,40)
mStr(text.block[x],80*x,280)
for y=1,4 do
mStr(A[x][y],80*x,40+40*y)
mStr(B[x][y],80*x,280+40*y)
end
mStr(chart.Y1[x],80*x,240)
mStr(chart.Y2[x],80*x,480)
end
gc.setColor(1,1,1)
A,B=chart.X1,chart.X2
mStr(text.stat.spin,650,45)
mStr(text.stat.clear,650,285)
for y=1,4 do
mStr(A[y],650,40+40*y)
mStr(B[y],650,280+40*y)
end
setFont(22)
for i=1,11 do
gc.print(sceneTemp.item[i],740,40*i+10)
end
gc.setLineWidth(4)
for x=1,8 do
x=80*x-40
gc.line(x,80,x,240)
gc.line(x,320,x,480)
end
for y=2,6 do
gc.line(40,40*y,600,40*y)
gc.line(40,240+40*y,600,240+40*y)
end
gc.draw(IMG.title,260,615,.2+.04*sin(Timer()*3),nil,nil,206,35)
end
function Pnt.history()
gc.setColor(.2,.2,.2,.7)
gc.rectangle("fill",30,45,1000,632)
gc.setColor(1,1,1)
gc.setLineWidth(4)
gc.rectangle("line",30,45,1000,632)
setFont(20)
local _=sceneTemp
gc.print(_.text[_.pos],40,50)
end
return Pnt

View File

@@ -1,323 +1,10 @@
local gc=love.graphics
local int,abs=math.floor,math.abs
local max,log=math.max,math.log
local rnd,sin,cos=math.random,math.sin,math.cos
local format=string.format
local abs=math.abs
local scr=scr
local sceneInit={}
sceneInit,sceneBack={},{}
local sceneInit,sceneBack=sceneInit,sceneBack
sceneInit.quit=love.event.quit
function sceneInit.calculator()
sceneTemp={
reg=false,
val=0,
sym=false,
pass=false,
}
end
function sceneInit.load()
sceneTemp={
phase=1,--Loading stage
cur=1,--Counter
tar=#VOC.name,--Loading bar lenth(current)
tip=require("parts/getTip"),
list={
#VOC.name,
#BGM.list,
#SFX.list,
IMG.getCount(),
#Modes,
1,
},
skip=false,--If skipped
}
end
function sceneInit.intro()
BG.set("space")
sceneTemp={
t1=0,--Timer 1
t2=0,--Timer 2
r={},--Random animation type
}
for i=1,8 do
sceneTemp.r[i]=rnd(5)
end
BGM.play("blank")
end
function sceneInit.main()
BG.set("space")
BGM.play("blank")
modeEnv={}
--Create demo player
destroyPlayers()
PLY.newDemoPlayer(1,900,35,1.1)
end
function sceneInit.music()
if BGM.nowPlay then
for i=1,BGM.len do
if BGM.list[i]==BGM.nowPlay then
sceneTemp=i--Music selected
return
end
end
else
sceneTemp=1
end
end
function sceneInit.mode(org)
BG.set("space")
BGM.play("blank")
destroyPlayers()
local cam=mapCam
cam.zoomK=org=="main"and 5 or 1
if cam.sel then
local M=Modes[cam.sel]
cam.x,cam.y=M.x*cam.k+180,M.y*cam.k
cam.x1,cam.y1=cam.x,cam.y
end
end
function sceneInit.custom()
sceneTemp=1--Option selected
destroyPlayers()
BG.set(customRange.bg[customSel[12]])
BGM.play(customRange.bgm[customSel[13]])
end
function sceneInit.sequence()
sceneTemp={cur=#preBag,sure=0}
end
function sceneInit.draw()
BG.set("space")
sceneTemp={
sure=0,
pen=1,
x=1,y=1,
demo=false,
}
end
function sceneInit.play()
love.keyboard.setKeyRepeat(false)
restartCount=0
if needResetGameData then
resetGameData()
needResetGameData=nil
end
BG.set(modeEnv.bg)
end
function sceneInit.pause(org)
if
org=="setting_game"or
org=="setting_video"or
org=="setting_sound"
then
TEXT.show(text.needRestart,640,440,50,"fly",.6)
end
local S=players[1].stat
sceneTemp={
timer=org=="play"and 0 or 50,
list={
toTime(S.time),
format("%d/%d/%d",S.key,S.rotate,S.hold),
format("%d %.2fPPS",S.piece,S.piece/S.time),
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
format("%d(%d) %.2fAPM",S.atk,S.digatk,S.atk/S.time*60),
format("%d(%d-%d)",S.pend,S.recv,S.recv-S.pend),
format("%d/%d/%d/%d",S.clears[1],S.clears[2],S.clears[3],S.clears[4]),
format("(%d)/%d/%d/%d",S.spins[1],S.spins[2],S.spins[3],S.spins[4]),
format("%d/%d ; %d/%d",S.b2b,S.b3b,S.pc,S.hpc),
format("%d [%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
},
--From right-down, 60 degree each
radar={
(S.off+S.dig)/S.time*60,--DefPM
(S.send+S.dig)/S.time*60,--ADPM
S.atk/S.time*60, --AtkPM
S.send/S.time*60, --SendPM
S.piece/S.time*24, --LinePM
S.dig/S.time*60, --DigPM
},
val={1/80,1/80,1/80,1/60,1/100,1/40},
timing=org=="play",
}
local _=sceneTemp
local A,B=_.radar,_.val
--Normalize Values
for i=1,6 do
B[i]=B[i]*A[i]if B[i]>1.26 then B[i]=1.26+log(B[i]-.26,10)end
end
for i=1,6 do
A[i]=format("%.2f",A[i])..text.radarData[i]
end
local f=1
for i=1,6 do
if B[i]>.5 then f=2 end
if B[i]>1 then f=3 break end
end
if f==1 then _.color,f={.4,.9,.5},1.25 --Vegetable
elseif f==2 then _.color,f={.4,.7,.9},1 --Normal
elseif f==3 then _.color,f={1,.3,.3},.626 --Diao
end
A={
120*.5*f, 120*3^.5*.5*f,
120*-.5*f, 120*3^.5*.5*f,
120*-1*f, 120*0*f,
120*-.5*f, 120*-3^.5*.5*f,
120*.5*f, 120*-3^.5*.5*f,
120*1*f, 120*0*f,
}
_.scale=f
_.standard=A
for i=6,1,-1 do
B[2*i-1],B[2*i]=B[i]*A[2*i-1],B[i]*A[2*i]
end
_.val=B
end
function sceneInit.setting_game()
BG.set("space")
end
function sceneInit.setting_video()
BG.set("space")
end
function sceneInit.setting_sound()
sceneTemp={
last=0,--Last sound time
jump=0,--Animation timer(10 to 0)
}
BG.set("space")
end
function sceneInit.setting_control()
sceneTemp={
das=setting.das,
arr=setting.arr,
pos=0,
dir=1,
wait=30,
}
BG.set("bg1")
end
function sceneInit.setting_key()
sceneTemp={
board=1,
kb=1,js=1,
kS=false,jS=false,
}
end
function sceneInit.setting_touch()
BG.set("rainbow")
sceneTemp={
default=1,
snap=1,
sel=nil,
}
end
function sceneInit.setting_touchSwitch()
BG.set("matrix")
end
function sceneInit.help()
BG.set("space")
end
function sceneInit.staff()
sceneTemp={
time=0,
v=1,
}
BG.set("space")
end
function sceneInit.stat()
local S=stat
local X1,X2,Y1,Y2={0,0,0,0},{0,0,0,0},{},{}
for i=1,7 do
local S,C=S.spin[i],S.clear[i]
Y1[i]=S[1]+S[2]+S[3]+S[4]
Y2[i]=C[1]+C[2]+C[3]+C[4]
for j=1,4 do
X1[j]=X1[j]+S[j]
X2[j]=X2[j]+C[j]
end
end
sceneTemp={
chart={
A1=S.spin,A2=S.clear,
X1=X1,X2=X2,
Y1=Y1,Y2=Y2,
},
item={
S.run,
S.game,
toTime(S.time),
S.key.." "..S.rotate.." "..S.hold,
S.piece.." "..S.row.." "..int(S.atk),
S.recv.." "..S.off.." "..S.pend,
S.dig.." "..int(S.digatk),
format("%.2f %.2f",S.atk/S.row,S.digatk/S.dig),
format("%d/%.3f%%",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
S.b2b.." "..S.b3b,
S.pc.." "..S.hpc,
},
}
for i=1,11 do
sceneTemp.item[i]=text.stat[i].."\t"..sceneTemp.item[i]
end
end
function sceneInit.history()
BG.set("rainbow")
sceneTemp={
text=require("parts/updateLog"),--Text list
pos=1,--Scroll pos
}
if newVersionLaunch then
newVersionLaunch=nil
sceneTemp.pos=4
end
end
function sceneInit.debug()
sceneTemp={
reset=false,
}
end
function sceneInit.quit()
if rnd()>.000626 then
love.timer.sleep(.3)
love.event.quit()
else
error("So lucky! 0.0626 precent to get this!!! You can quit the game now.")
end
end
local sceneBack={}
function sceneBack.load()
love.event.quit()
end
function sceneBack.pause()
love.keyboard.setKeyRepeat(true)
if not game.replaying then
mergeStat(stat,players[1].stat)
end
FILE.saveData()
TASK.clear("play")
end
function sceneBack.setting_game()
FILE.saveSetting()
end
function sceneBack.setting_video()
FILE.saveSetting()
end
function sceneBack.setting_sound()
FILE.saveSetting()
end
function sceneBack.setting_touch()
FILE.saveVK()
end
function sceneBack.setting_key()
FILE.saveKeyMap()
end
function sceneBack.setting_lang()
FILE.saveSetting()
end
local SCN={
cur="load",--Current scene

View File

@@ -52,13 +52,13 @@ function SFX.play(s,vol,pos)
S=S[n]--AU_SRC
if S:getChannelCount()==1 then
if pos then
pos=pos*setting.stereo*.1
pos=pos*setting.stereo
S:setPosition(pos,1-pos^2,0)
else
S:setPosition(0,0,0)
end
end
S:setVolume(((vol or 1)*setting.sfx*.01)^1.626)
S:setVolume(((vol or 1)*setting.sfx)^1.626)
S:play()
end
function SFX.fplay(s,vol,pos)
@@ -76,13 +76,13 @@ function SFX.fplay(s,vol,pos)
S=S[n]--AU_SRC
if S:getChannelCount()==1 then
if pos then
pos=pos*setting.stereo*.1
pos=pos*setting.stereo
S:setPosition(pos,1-pos^2,0)
else
S:setPosition(0,0,0)
end
end
S:setVolume((vol*.01)^1.626)
S:setVolume(vol^1.626)
S:play()
end
function SFX.reset()

View File

@@ -6,6 +6,37 @@ local ins,rem=table.insert,table.remove
local fx={}
local FXupdate={}
function FXupdate.badge(S,dt)
S.t=S.t+dt
if S.t<.2 then
S.x,S.y=S.x1-14,S.y1-14
elseif S.t<.8 then
local t=((S.t-.2)*1.6667)
t=(3-2*t)*t*t
S.x,S.y=S.x1*(1-t)+S.x2*t-14,S.y1*(1-t)+S.y2*t-14
else
S.x,S.y=S.x2-14,S.y2-14
end
return S.t>=1
end
function FXupdate.attack(S,dt)
S.t=S.t+dt
local L=S.drag
if S.t>.8 then
S.rad=S.rad*1.05+.1
S.x,S.y=S.x2,S.y2
elseif S.t>.2 then
local t=(S.t-.2)*1.6667
t=(3-2*t)*t*t
S.x,S.y=S.x1*(1-t)+S.x2*t,S.y1*(1-t)+S.y2*t
ins(L,S.x)ins(L,S.y)
end
if #L==4+4*setting.atkFX then
rem(L,1)rem(L,1)
end
return S.t>1
end
function FXupdate.ripple(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
@@ -20,9 +51,36 @@ function FXupdate.shade(S,dt)
end
local FXdraw={}
function FXdraw.badge(S)
gc.setColor(1,1,1,S.t<.2 and S.t*.6 or S.t<.8 and 1 or(1-S.t)*.6)
gc.draw(IMG.badgeIcon,S.x,S.y)
end
function FXdraw.attack(S)
gc.setLineWidth(5)
gc.push("transform")
local t=S.t
local a=(t<.2 and t*5 or t<.8 and 1 or 5-t*5)*S.a
local L=S.drag
local len=#L
local r,g,b=S.r,S.g,S.b
local rad,crn=S.rad,S.corner
for i=1,len,2 do
gc.setColor(r,g,b,.4*a*i/len)
gc.translate(L[i],L[i+1])
gc.rotate(t*.1)
gc.circle("fill",0,0,rad,crn)
gc.rotate(-t*.1)
gc.translate(-L[i],-L[i+1])
end
gc.translate(S.x,S.y)
gc.rotate(t*6)
gc.setColor(r,g,b,a*.5)gc.circle("line",0,0,rad,crn)
gc.setColor(r,g,b,a)gc.circle("fill",0,0,rad,crn)
gc.pop()
end
function FXdraw.ripple(S)
setWidth(2)
local t=S.t
setWidth(2)
setColor(1,1,1,1-t)
gc.circle("line",S.x,S.y,t*(2-t)*S.r)
end
@@ -51,6 +109,31 @@ function sysFX.draw()
end
end
function sysFX.newBadge(x1,y1,x2,y2)
fx[#fx+1]={
update=FXupdate.badge,
draw=FXdraw.badge,
t=0,
x=x1,y=y1,
x1=x1,y1=y1,
x2=x2,y2=y2,
}
end
function sysFX.newAttack(x1,y1,x2,y2,rad,corner,type,r,g,b,a)
fx[#fx+1]={
update=FXupdate.attack,
draw=FXdraw.attack,
t=0,
x=x1,y=y1,
x1=x1,y1=y1,--Start pos
x2=x2,y2=y2,--End pos
rad=rad,
corner=corner,
type=type,
r=r,g=g,b=b,a=a,
drag={},--Afterimage coordinate list
}
end
function sysFX.newRipple(duration,x,y,r)
fx[#fx+1]={
update=FXupdate.ripple,

View File

@@ -1,356 +0,0 @@
local gc=love.graphics
local kb=love.keyboard
local Timer=love.timer.getTime
local int,abs,rnd,max,min,sin,ln=math.floor,math.abs,math.random,math.max,math.min,math.sin,math.log
local ins,rem=table.insert,table.remove
local Tmr={}
function Tmr.load()
local t=Timer()
local S=sceneTemp
repeat
if S.phase==1 then
VOC.loadOne(S.cur)
elseif S.phase==2 then
BGM.loadOne(S.cur)
elseif S.phase==3 then
SFX.loadOne(S.cur)
elseif S.phase==4 then
IMG.loadOne(S.cur)
elseif S.phase==5 then
local m=Modes[S.cur]--Mode template
local M=require("modes/"..m.name)--Mode file
Modes[m.name],Modes[S.cur]=M
for k,v in next,m do
M[k]=v
end
M.records=FILE.loadRecord(m.name)or M.score and{}
if M.score then
if modeRanks[M.name]==6 then
modeRanks[M.name]=0
end
else
modeRanks[M.name]=6
end
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("image/modeIcon/custom.png")
elseif S.phase==6 then
--------------------------Loading other little things here
SKIN.load()
stat.run=stat.run+1
--------------------------
if not setting.appLock then
SFX.play("welcome_sfx")
VOC.play("welcome")
end
else
S.cur=S.cur+1
S.tar=S.cur
if S.cur>62.6 then
SCN.swapTo(setting.appLock and "calculator"or"intro","none")
end
loadingFinished=true
return
end
S.cur=S.cur+1
if S.cur>S.tar then
S.phase=S.phase+1
S.cur=1
S.tar=S.list[S.phase]
if not S.tar then
S.phase=0
S.tar=1
end
end
until not S.skip and Timer()-t>.01
end
function Tmr.intro()
local s=sceneTemp
s.t1=s.t1+1
s.t2=s.t2+1
end
function Tmr.main(dt)
players[1]:update(dt)
end
function Tmr.mode(dt)
local cam=mapCam
local x,y,k=cam.x,cam.y,cam.k
local F
if not SCN.swapping then
if kb.isDown("up", "w")then y=y-10*k;F=true end
if kb.isDown("down","s")then y=y+10*k;F=true end
if kb.isDown("left","a")then x=x-10*k;F=true end
if kb.isDown("right","d")then x=x+10*k;F=true end
local js1=joysticks[1]
if js1 then
local k=js1:getAxis(1)
if k~="c"then
if k=="u"or k=="ul"or k=="ur"then y=y-10*k;F=true end
if k=="d"or k=="dl"or k=="dl"then y=y+10*k;F=true end
if k=="l"or k=="ul"or k=="dl"then x=x-10*k;F=true end
if k=="r"or k=="ur"or k=="dr"then x=x+10*k;F=true end
end
end
end
if F or cam.keyCtrl and(x-cam.x1)^2+(y-cam.y1)^2>2.6 then
if F then
cam.keyCtrl=true
end
local x,y=(cam.x1-180)/cam.k1,cam.y1/cam.k1
for name,M in next,Modes do
if modeRanks[name]then
local SEL
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then SEL=name end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then SEL=name end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<s^2 then SEL=name end
end
if SEL and cam.sel~=SEL then
cam.sel=SEL
SFX.play("click")
end
end
end
end
if x>1850*k then x=1850*k
elseif x<-1000*k then x=-1000*k
end
if y>500*k then y=500*k
elseif y<-1900*k then y=-1900*k
end
cam.x,cam.y=x,y
--Keyboard controlling
cam.x1=cam.x1*.85+x*.15
cam.y1=cam.y1*.85+y*.15
cam.k1=cam.k1*.85+k*.15
local _=SCN.stat.tar
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then
if cam.sel then
local M=Modes[cam.sel]
cam.x=cam.x*.8+M.x*cam.k*.2
cam.y=cam.y*.8+M.y*cam.k*.2
end
_=cam.zoomK
if _<.8 then _=_*1.05 end
if _<1.1 then _=_*1.05 end
cam.zoomK=_*1.05
elseif cam.zoomMethod==2 then
cam.zoomK=cam.zoomK^.9
end
end
function Tmr.sequence()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.draw()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.play(dt)
local _
game.frame=game.frame+1
stat.time=stat.time+dt
--Update attack FX
for i=#FX_attack,1,-1 do
local b=FX_attack[i]
b.t=b.t+1
if b.t>50 then
b.rad=b.rad*1.05+.1
b.x,b.y=b.x2,b.y2
elseif b.t>10 then
_=(b.t-10)*.025
_=(3-2*_)*_*_
b.x,b.y=b.x1*(1-_)+b.x2*_,b.y1*(1-_)+b.y2*_
end
if b.t<60 then
_=FX_attack[i].drag
if #_==4*setting.atkFX then
rem(_,1)rem(_,1)
end
ins(_,b.x)ins(_,b.y)
else
for i=i,#FX_attack do
FX_attack[i]=FX_attack[i+1]
end
end
end
--Update badge FX
for i=#FX_badge,1,-1 do
local b=FX_badge[i]
b.t=b.t+1
if b.t==60 then
rem(FX_badge,i)
end
end
--Update virtualkey animation
if setting.VKSwitch then
for i=1,#virtualkey do
_=virtualkey[i]
if _.pressTime>0 then
_.pressTime=_.pressTime-1
end
end
end
local P1=players[1]
--Replay
if game.replaying then
_=game.replaying
local L=game.rec
while game.frame==L[_]do
local k=L[_+1]
if k>0 then
P1:pressKey(k)
virtualkey[k].isDown=true
virtualkey[k].pressTime=10
else
virtualkey[-k].isDown=false
P1:releaseKey(-k)
end
_=_+2
end
game.replaying=_
end
--Counting,include pre-das,directy RETURN,or restart counting
if game.frame<180 then
if game.frame==179 then
gameStart()
elseif game.frame==60 or game.frame==120 then
SFX.play("ready")
end
for p=1,#players do
local P=players[p]
if P.movDir~=0 then
if P.moving<P.gameEnv.das then
P.moving=P.moving+1
end
else
P.moving=0
end
end
if restartCount>0 then restartCount=restartCount-1 end
return
elseif P1.keyPressing[10]then
restartCount=restartCount+1
if restartCount>20 then
TASK.clear("play")
resetPartGameData()
return
end
elseif restartCount>0 then
restartCount=restartCount>2 and restartCount-2 or 0
end
--Update players
for p=1,#players do
local P=players[p]
P:update(dt)
end
--Fresh royale target
if game.frame%120==0 then
if modeEnv.royaleMode then freshMostDangerous()end
end
--Warning check
if P1.alive then
if game.frame%26==0 and setting.warn then
local F=P1.field
local height=0--Max height of row 4~7
for x=4,7 do
for y=#F,1,-1 do
if F[y][x]>0 then
if y>height then
height=y
end
break
end
end
end
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
end
_=game.warnLVL
if _<game.warnLVL0 then
_=_*.95+game.warnLVL0*.05
elseif _>0 then
_=max(_-.026,0)
end
game.warnLVL=_
elseif game.warnLVL>0 then
game.warnLVL=max(game.warnLVL-.026,0)
end
end
function Tmr.pause(dt)
if not game.result then
game.pauseTime=game.pauseTime+dt
end
if sceneTemp.timer<50 then
sceneTemp.timer=sceneTemp.timer+1
end
end
function Tmr.setting_sound()
local t=sceneTemp.jump
if t>0 then
sceneTemp.jump=t-1
end
end
function Tmr.setting_control()
local T=sceneTemp
if T.wait>0 then
T.wait=T.wait-1
if T.wait==0 then
T.pos=T.pos+T.dir
else
return
end
end
if T.das>0 then
T.das=T.das-1
if T.das==0 then
if T.arr==0 then
T.pos=T.pos+7*T.dir
T.das=setting.das
T.arr=setting.arr
T.dir=-T.dir
T.wait=26
else
T.pos=T.pos+T.dir
end
end
else
T.arr=T.arr-1
if T.arr==0 then
T.pos=T.pos+T.dir
T.arr=setting.arr
elseif T.arr==-1 then
T.pos=T.dir>0 and 8 or 0
T.arr=setting.arr
end
if T.pos%8==0 then
T.dir=-T.dir
T.wait=26
T.das=setting.das
end
end
end
function Tmr.staff(dt)
local S=sceneTemp
if kb.isDown("space","return")and S.v<6.26 then
S.v=S.v+.26
elseif S.v>1 then
S.v=S.v-.26
end
S.time=S.time+S.v*dt
if S.time>45 then
S.time=45
end
end
return Tmr

View File

@@ -91,13 +91,13 @@ function VOC.update()
end
elseif Q.s==1 then--Waiting load source
Q[1]=getVoice(Q[1])
Q[1]:setVolume(setting.voc*.01)
Q[1]:setVolume(setting.voc)
Q[1]:play()
Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--Playing 1,ready 2
if Q[1]:getDuration()-Q[1]:tell()<.08 then
Q[2]=getVoice(Q[2])
Q[2]:setVolume(setting.voc*.01)
Q[2]:setVolume(setting.voc)
Q[2]:play()
Q.s=3
end

View File

@@ -4,6 +4,7 @@ local int,abs=math.floor,math.abs
local format=string.format
local color=color
local setFont=setFont
local Timer=love.timer.getTime
local button={
type="button",
@@ -183,6 +184,21 @@ local slider={
ATV=0,--Activating time(0~8)
pos=0,--Position shown
}
local sliderShowFunc={
int=function(S)
return S.disp()
end,
float=function(S)
return int(S.disp()*100)*.01
end,
percent=function(S)
return int(S.disp()*100).."%"
end,
frame_time=function(S)
S=S.disp()
return S.."F "..int(S*16.67).."ms"
end,
}
function slider:reset()
self.ATV=0
self.pos=0
@@ -212,7 +228,7 @@ function slider:draw()
gc.setColor(1,1,1,.5+ATV*.06)
--Units
if self.showUnit then
if not self.smooth then
gc.setLineWidth(2)
for p=0,self.unit do
local x=x+(x2-x)*p/self.unit
@@ -225,17 +241,24 @@ function slider:draw()
gc.line(x,y,x2,y)
--Block
local bx,by,bw,bh=x+(x2-x)*self.pos/self.unit-10-ATV*.5,y-16-ATV,20+ATV,32+2*ATV
local cx=x+(x2-x)*self.pos/self.unit
local bx,by,bw,bh=cx-10-ATV*.5,y-16-ATV,20+ATV,32+2*ATV
gc.setColor(.8,.8,.8)
gc.rectangle("fill",bx,by,bw,bh)
local t
if ATV>0 then
gc.setLineWidth(2)
gc.setColor(1,1,1,ATV*.16)
gc.rectangle("line",bx+1,by+1,bw-2,bh-2)
if self.show then
setFont(25)
mStr(self:show(),cx,by-30)
end
end
--Text
local t=self.text
t=self.text
if t then
gc.setColor(1,1,1)
setFont(self.font)
@@ -287,6 +310,7 @@ function WIDGET.newImage(D)
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.newButton(D)
if not D.h then D.h=D.w end
local _={
name= D.name,
@@ -310,6 +334,7 @@ function WIDGET.newButton(D)
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.newKey(D)
if not D.h then D.h=D.w end
local _={
name= D.name,
@@ -369,14 +394,34 @@ function WIDGET.newSlider(D)
D.x+D.w,D.y,
},
unit= D.unit,
showUnit=not D.noUnit,
unit= D.unit or 1,
--smooth=nil,
font= D.font,
change= D.change,
disp= D.disp,
code= D.code,
hide= D.hide,
}for k,v in next,slider do _[k]=v end return _
--show= nil,
lastTime=0,
}
if D.smooth~=nil then
_.smooth=D.smooth
else
_.smooth=_.unit<=1
end
if D.show then
if type(D.show)=="function"then
_.show=D.show
else
_.show=sliderShowFunc[D.show]
end
elseif _.unit<=1 then
_.show=sliderShowFunc.percent
else
_.show=sliderShowFunc.int
end
for k,v in next,slider do _[k]=v end return _
end
function WIDGET.moveCursor(x,y)
@@ -402,11 +447,7 @@ function WIDGET.press(x,y)
W.code()
SFX.play("move",.6)
elseif W.type=="slider"then
if not x then return end
local p,P=W.disp(),x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5)
if p==P then return end
W.code(P)
if W.change then W.change()end
WIDGET.drag(x,y)
end
if W.hide and W.hide()then WIDGET.sel=nil end
end
@@ -414,14 +455,32 @@ function WIDGET.drag(x,y,dx,dy)
local W=WIDGET.sel
if not W then return end
if W.type=="slider"then
local p,P=W.disp(),x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5)
if p==P then return end
W.code(P)
if W.change then W.change()end
if not x then return end
local p=W.disp()
local P=x<W.x and 0 or x>W.x+W.w and W.unit or(x-W.x)/W.w*W.unit
if not W.smooth then
P=int(P+.5)
end
if p~=P then
W.code(P)
end
if W.change and Timer()-W.lastTime>.18 then
W.lastTime=Timer()
W.change()
end
elseif not W:isAbove(x,y)then
WIDGET.sel=nil
end
end
function WIDGET.release(x,y)
local W=WIDGET.sel
if not W then return end
if W.type=="slider"then
W.lastTime=0
WIDGET.drag(x,y)
end
WIDGET.sel=nil
end
function WIDGET.keyPressed(i)
if i=="space"or i=="return"then
if WIDGET.sel then

View File

@@ -1,3 +1,4 @@
local rnd=math.random
local ins,rem=table.insert,table.remove
local mobileHide=(system=="Android"or system=="iOS")and function()return true end
local function BACK()SCN.back()end
@@ -99,24 +100,30 @@ newSlider=WIDGET.newSlider
local Widgets={
load={},intro={},quit={},
calculator={
newKey({name="_1", x=150,y=300,w=90,h=90, color="white", font=50,code=pressKey("1")}),
newKey({name="_2", x=250,y=300,w=90,h=90, color="white", font=50,code=pressKey("2")}),
newKey({name="_3", x=350,y=300,w=90,h=90, color="white", font=50,code=pressKey("3")}),
newKey({name="_4", x=150,y=400,w=90,h=90, color="white", font=50,code=pressKey("4")}),
newKey({name="_5", x=250,y=400,w=90,h=90, color="white", font=50,code=pressKey("5")}),
newKey({name="_6", x=350,y=400,w=90,h=90, color="white", font=50,code=pressKey("6")}),
newKey({name="_7", x=150,y=500,w=90,h=90, color="white", font=50,code=pressKey("7")}),
newKey({name="_8", x=250,y=500,w=90,h=90, color="white", font=50,code=pressKey("8")}),
newKey({name="_9", x=350,y=500,w=90,h=90, color="white", font=50,code=pressKey("9")}),
newKey({name="_0", x=150,y=600,w=90,h=90, color="white", font=50,code=pressKey("0")}),
newKey({name="<", x=250,y=600,w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
newKey({name="=", x=350,y=600,w=90,h=90, color="lYellow",font=50,code=pressKey("return")}),
newKey({name="+", x=450,y=300,w=90,h=90, color="lBlue", font=50,code=pressKey("+")}),
newKey({name="-", x=450,y=400,w=90,h=90, color="lBlue", font=50,code=pressKey("-")}),
newKey({name="*", x=450,y=500,w=90,h=90, color="lBlue", font=50,code=pressKey("*")}),
newKey({name="/", x=450,y=600,w=90,h=90, color="lBlue", font=50,code=pressKey("/")}),
newKey({name="_1", x=150,y=300,w=90, color="white", font=50,code=pressKey("1")}),
newKey({name="_2", x=250,y=300,w=90, color="white", font=50,code=pressKey("2")}),
newKey({name="_3", x=350,y=300,w=90, color="white", font=50,code=pressKey("3")}),
newKey({name="_4", x=150,y=400,w=90, color="white", font=50,code=pressKey("4")}),
newKey({name="_5", x=250,y=400,w=90, color="white", font=50,code=pressKey("5")}),
newKey({name="_6", x=350,y=400,w=90, color="white", font=50,code=pressKey("6")}),
newKey({name="_7", x=150,y=500,w=90, color="white", font=50,code=pressKey("7")}),
newKey({name="_8", x=250,y=500,w=90, color="white", font=50,code=pressKey("8")}),
newKey({name="_9", x=350,y=500,w=90, color="white", font=50,code=pressKey("9")}),
newKey({name="_0", x=150,y=600,w=90, color="white", font=50,code=pressKey("0")}),
newKey({name="<", x=250,y=600,w=90, color="lRed", font=50,code=pressKey("backspace")}),
newKey({name="=", x=350,y=600,w=90, color="lYellow",font=50,code=pressKey("return")}),
newKey({name="+", x=450,y=300,w=90, color="lBlue", font=50,code=pressKey("+")}),
newKey({name="-", x=450,y=400,w=90, color="lBlue", font=50,code=pressKey("-")}),
newKey({name="*", x=450,y=500,w=90, color="lBlue", font=50,code=pressKey("*")}),
newKey({name="/", x=450,y=600,w=90, color="lBlue", font=50,code=pressKey("/")}),
newButton({name="play", x=640,y=600,w=180,h=90, color="lGreen", font=40,code=pressKey("space"),hide=function()return not sceneTemp.pass end}),
},
p15={
newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("space")}),
newSwitch({name="color", x=200,y=240,w=60, font=40,disp=function()return sceneTemp.color end,code=pressKey("c"),hide=function()return sceneTemp.state>0 end}),
newSwitch({name="hide", x=200,y=340,w=60, font=40,disp=function()return sceneTemp.blind end,code=pressKey("h"),hide=function()return sceneTemp.state>0 end}),
newButton({name="back", x=1140,y=640,w=180,h=80,color="white", font=35,code=BACK}),
},
main={
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.go("mode")end}),
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.go("setting_game")end}),
@@ -134,106 +141,106 @@ local Widgets={
hide=function()
return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"
end}),
newButton({name="start", x=1040,y=655,w=180,h=80,color="lGrey", font=40,code=pressKey("return"),hide=function()return not mapCam.sel end}),
newButton({name="start", x=1040,y=655,w=180,h=80,color="white", font=40,code=pressKey("return"),hide=function()return not mapCam.sel end}),
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
},
music={
newSlider({name="bgm", x=760, y=80, w=400,unit=100, noUnit=true, font=35,change=function()BGM.freshVolume()end,disp=SETval("bgm"),code=SETsto("bgm")}),
newButton({name="up", x=1100, y=200, w=120,h=120, color="white", font=55,code=pressKey("up")}),
newButton({name="play", x=1100, y=340, w=120,h=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
newButton({name="down", x=1100, y=480, w=120,h=120, color="white", font=55,code=pressKey("down")}),
newButton({name="back", x=640, y=630, w=230,h=90, color="white", font=40,code=BACK}),
newSlider({name="bgm", x=760, y=80, w=400, font=35,disp=SETval("bgm"),code=function(v)setting.bgm=v;BGM.freshVolume()end}),
newButton({name="up", x=1100, y=200, w=120, color="white", font=55,code=pressKey("up")}),
newButton({name="play", x=1100, y=340, w=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
newButton({name="down", x=1100, y=480, w=120, color="white", font=55,code=pressKey("down")}),
newButton({name="back", x=1140, y=640, w=180,h=80, color="white", font=35,code=BACK}),
},
custom={
newKey({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
newKey({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
newKey({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
newKey({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
newKey({name="up", x=1140, y=100, w=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
newKey({name="down", x=1140, y=340, w=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
newKey({name="left", x=1080, y=220, w=100, color="white", font=45,code=pressKey("left")}),
newKey({name="right", x=1200, y=220, w=100, color="white", font=45,code=pressKey("right")}),
newButton({name="set1", x=940, y=320, w=260,h=70, color="lYellow",font=32,code=pressKey("1")}),
newButton({name="set2", x=940, y=400, w=260,h=70, color="lYellow",font=32,code=pressKey("2")}),
newButton({name="set3", x=940, y=480, w=260,h=70, color="lYellow",font=32,code=pressKey("3")}),
newButton({name="set4", x=940, y=560, w=260,h=70, color="lYellow",font=32,code=pressKey("4")}),
newButton({name="set5", x=940, y=640, w=260,h=70, color="lYellow",font=32,code=pressKey("5")}),
newButton({name="set1", x=900, y=320, w=210,h=70, color="lYellow",font=32,code=pressKey("1")}),
newButton({name="set2", x=900, y=400, w=210,h=70, color="lYellow",font=32,code=pressKey("2")}),
newButton({name="set3", x=900, y=480, w=210,h=70, color="lYellow",font=32,code=pressKey("3")}),
newButton({name="set4", x=900, y=560, w=210,h=70, color="lYellow",font=32,code=pressKey("4")}),
newButton({name="set5", x=900, y=640, w=210,h=70, color="lYellow",font=32,code=pressKey("5")}),
newButton({name="seq", x=665, y=415, w=200,h=40, color="lGreen", font=30,code=pressKey("q")}),
newButton({name="draw", x=150, y=80, w=220,h=80, color="white", font=35,code=pressKey("e")}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
newButton({name="back", x=1140, y=640, w=180,h=80, color="white", font=35,code=BACK}),
},
sequence={
newKey({name="Z", x=100, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
newKey({name="S", x=200, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
newKey({name="J", x=300, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
newKey({name="L", x=400, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
newKey({name="T", x=500, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
newKey({name="O", x=600, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
newKey({name="I", x=700, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
newKey({name="Z", x=100, y=440, w=90, color="white", font=50,code=pressKey(1)}),
newKey({name="S", x=200, y=440, w=90, color="white", font=50,code=pressKey(2)}),
newKey({name="J", x=300, y=440, w=90, color="white", font=50,code=pressKey(3)}),
newKey({name="L", x=400, y=440, w=90, color="white", font=50,code=pressKey(4)}),
newKey({name="T", x=500, y=440, w=90, color="white", font=50,code=pressKey(5)}),
newKey({name="O", x=600, y=440, w=90, color="white", font=50,code=pressKey(6)}),
newKey({name="I", x=700, y=440, w=90, color="white", font=50,code=pressKey(7)}),
newKey({name="Z5", x=100, y=540, w=90,h=90, color="grey", font=50,code=pressKey(8)}),
newKey({name="S5", x=200, y=540, w=90,h=90, color="grey", font=50,code=pressKey(9)}),
newKey({name="P", x=300, y=540, w=90,h=90, color="grey", font=50,code=pressKey(10)}),
newKey({name="Q", x=400, y=540, w=90,h=90, color="grey", font=50,code=pressKey(11)}),
newKey({name="F", x=500, y=540, w=90,h=90, color="grey", font=50,code=pressKey(12)}),
newKey({name="E", x=600, y=540, w=90,h=90, color="grey", font=50,code=pressKey(13)}),
newKey({name="T5", x=700, y=540, w=90,h=90, color="grey", font=50,code=pressKey(14)}),
newKey({name="U", x=800, y=540, w=90,h=90, color="grey", font=50,code=pressKey(15)}),
newKey({name="V", x=900, y=540, w=90,h=90, color="grey", font=50,code=pressKey(16)}),
newKey({name="W", x=100, y=640, w=90,h=90, color="grey", font=50,code=pressKey(17)}),
newKey({name="X", x=200, y=640, w=90,h=90, color="grey", font=50,code=pressKey(18)}),
newKey({name="J5", x=300, y=640, w=90,h=90, color="grey", font=50,code=pressKey(19)}),
newKey({name="L5", x=400, y=640, w=90,h=90, color="grey", font=50,code=pressKey(20)}),
newKey({name="R", x=500, y=640, w=90,h=90, color="grey", font=50,code=pressKey(21)}),
newKey({name="Y", x=600, y=640, w=90,h=90, color="grey", font=50,code=pressKey(22)}),
newKey({name="N", x=700, y=640, w=90,h=90, color="grey", font=50,code=pressKey(23)}),
newKey({name="H", x=800, y=640, w=90,h=90, color="grey", font=50,code=pressKey(24)}),
newKey({name="I5", x=900, y=640, w=90,h=90, color="grey", font=50,code=pressKey(25)}),
newKey({name="Z5", x=100, y=540, w=90, color="grey", font=50,code=pressKey(8)}),
newKey({name="S5", x=200, y=540, w=90, color="grey", font=50,code=pressKey(9)}),
newKey({name="P", x=300, y=540, w=90, color="grey", font=50,code=pressKey(10)}),
newKey({name="Q", x=400, y=540, w=90, color="grey", font=50,code=pressKey(11)}),
newKey({name="F", x=500, y=540, w=90, color="grey", font=50,code=pressKey(12)}),
newKey({name="E", x=600, y=540, w=90, color="grey", font=50,code=pressKey(13)}),
newKey({name="T5", x=700, y=540, w=90, color="grey", font=50,code=pressKey(14)}),
newKey({name="U", x=800, y=540, w=90, color="grey", font=50,code=pressKey(15)}),
newKey({name="V", x=900, y=540, w=90, color="grey", font=50,code=pressKey(16)}),
newKey({name="W", x=100, y=640, w=90, color="grey", font=50,code=pressKey(17)}),
newKey({name="X", x=200, y=640, w=90, color="grey", font=50,code=pressKey(18)}),
newKey({name="J5", x=300, y=640, w=90, color="grey", font=50,code=pressKey(19)}),
newKey({name="L5", x=400, y=640, w=90, color="grey", font=50,code=pressKey(20)}),
newKey({name="R", x=500, y=640, w=90, color="grey", font=50,code=pressKey(21)}),
newKey({name="Y", x=600, y=640, w=90, color="grey", font=50,code=pressKey(22)}),
newKey({name="N", x=700, y=640, w=90, color="grey", font=50,code=pressKey(23)}),
newKey({name="H", x=800, y=640, w=90, color="grey", font=50,code=pressKey(24)}),
newKey({name="I5", x=900, y=640, w=90, color="grey", font=50,code=pressKey(25)}),
newKey({name="left", x=800, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
newKey({name="right", x=900, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
newKey({name="backsp", x=1000, y=440, w=90,h=90, color="lYellow",font=50,code=pressKey("backspace")}),
newKey({name="reset", x=1000, y=540, w=90,h=90, color="lYellow",font=50,code=pressKey("delete")}),
newKey({name="left", x=800, y=440, w=90, color="lGreen", font=55,code=pressKey("left")}),
newKey({name="right", x=900, y=440, w=90, color="lGreen", font=55,code=pressKey("right")}),
newKey({name="backsp", x=1000, y=440, w=90, color="lYellow",font=50,code=pressKey("backspace")}),
newKey({name="reset", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey("delete")}),
newButton({name="copy", x=1140, y=440, w=170,h=90, color="lRed", font=40,code=pressKey("cC"),hide=function()return #preBag==0 end}),
newButton({name="paste", x=1140, y=540, w=170,h=90, color="lBlue", font=40,code=pressKey("cV")}),
newButton({name="back", x=1090, y=640, w=270,h=90, color="white", font=50,code=BACK}),
newButton({name="back", x=1140, y=640, w=180,h=80, color="white", font=35,code=BACK}),
},
draw={
newButton({name="b1", x=500+65*1, y=150, w=58, h=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=150, w=58, h=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=150, w=58, h=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=150, w=58, h=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=150, w=58, h=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=150, w=58, h=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=150, w=58, h=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=150, w=58, h=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=150, w=58, h=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=150, w=58, h=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=150, w=58, h=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b1", x=500+65*1, y=150, w=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=150, w=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=150, w=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=150, w=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=150, w=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=150, w=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=150, w=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=150, w=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=150, w=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=150, w=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=150, w=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b12", x=500+65*1, y=230, w=58, h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=230, w=58, h=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=230, w=58, h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=230, w=58, h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=230, w=58, h=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=230, w=58, h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="b12", x=500+65*1, y=230, w=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=230, w=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=230, w=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=230, w=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=230, w=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=230, w=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="any", x=600, y=360, w=120, h=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=360, w=120, h=120, color="grey", font=65,code=setPen(-1)}),
newButton({name="clear", x=1200, y=500, w=120, h=120, color="white", font=40,code=pressKey("delete")}),
newButton({name="any", x=600, y=360, w=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=360, w=120, color="grey", font=65,code=setPen(-1)}),
newButton({name="clear", x=1200, y=500, w=120, color="white", font=40,code=pressKey("delete")}),
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
newButton({name="copy", x=920, y=640, w=120, h=120, color="lRed", font=35,code=pressKey("cC")}),
newButton({name="paste", x=1060, y=640, w=120, h=120, color="lBlue", font=35,code=pressKey("cV")}),
newButton({name="custom", x=110, y=80, w=140, h=80, color="white", font=35,code=pressKey("e")}),
newButton({name="back", x=1200, y=640, w=120, h=120, color="white", font=35,code=BACK}),
newButton({name="copy", x=920, y=640, w=120, color="lRed", font=35,code=pressKey("cC")}),
newButton({name="paste", x=1060, y=640, w=120, color="lBlue", font=35,code=pressKey("cV")}),
newButton({name="custom", x=110, y=80, w=140,h=80, color="white", font=35,code=pressKey("e")}),
newButton({name="back", x=1140, y=640, w=180,h=80, color="white", font=35,code=BACK}),
},
play={
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
newButton({name="pause", x=1235, y=45, w=80, color="white", font=25,code=function()pauseGame()end}),
},
pause={
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}),
newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not(game.result or game.replaying)end}),
newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}),
newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=33,code=pressKey("r")}),
newButton({name="quit", x=640, y=600, w=240,h=100,color="lGrey", font=35,code=BACK}),
newButton({name="quit", x=640, y=600, w=240,h=100,color="white", font=35,code=BACK}),
},
setting_game={
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
@@ -241,7 +248,7 @@ local Widgets={
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.go("setting_control")end}),
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.go("setting_key")end}),
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.go("setting_touch")end}),
newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime")}),
newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end}),
newSlider({name="maxNext", x=350, y=440, w=300,unit=6, font=30,disp=SETval("maxNext"), code=SETsto("maxNext")}),
newButton({name="layout", x=460, y=540, w=140,h=70,color="white", font=35,code=function()
SCN.go("setting_skin")
@@ -250,16 +257,16 @@ local Widgets={
newSwitch({name="swap", x=1080, y=380, font=20,disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1080, y=440, font=20,disp=SETval("fine"), code=SETrev("fine")}),
newSwitch({name="appLock", x=1080, y=500, font=20,disp=SETval("appLock"), code=SETrev("appLock")}),
newButton({name="back", x=1140, y=650, w=200,h=80,color="white", font=40,code=BACK}),
newButton({name="back", x=1140, y=640, w=180,h=80,color="white", font=35,code=BACK}),
},
setting_video={
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound","swipe")end}),
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
newSwitch({name="ghost", x=250, y=180,font=35, disp=SETval("ghost"), code=SETrev("ghost")}),
newSwitch({name="smooth", x=250, y=260,font=25, disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}),
newSwitch({name="grid", x=500, y=260,font=35, disp=SETval("grid"), code=SETrev("grid")}),
newSwitch({name="bagLine", x=730, y=180,font=30, disp=SETval("bagLine"), code=SETrev("bagLine")}),
newSlider({name="ghost", x=250, y=180,w=200,unit=.6,noUnit=true,font=35,disp=SETval("ghost"),show="percent",code=SETsto("ghost")}),
newSlider({name="center", x=600, y=180,w=200,unit=1, font=35,disp=SETval("center"), code=SETsto("center")}),
newSwitch({name="smooth", x=260, y=260, font=25,disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="grid", x=480, y=260, font=35,disp=SETval("grid"), code=SETrev("grid")}),
newSwitch({name="bagLine", x=700, y=260, font=30,disp=SETval("bagLine"), code=SETrev("bagLine")}),
newSlider({name="lockFX", x=350, y=340,w=373,unit=5, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}),
newSlider({name="dropFX", x=350, y=390,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}),
newSlider({name="moveFX", x=350, y=440,w=373,unit=5, font=32,disp=SETval("moveFX"), code=SETsto("moveFX")}),
@@ -291,24 +298,24 @@ local Widgets={
code=function()
setting.powerInfo=not setting.powerInfo
end}),
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=1140, y=640,w=180,h=80,color="white", font=35,code=BACK}),
},
setting_sound={
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newSlider({name="sfx", x=180, y=200,w=400,unit=100,noUnit=true,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400,unit=10, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400,unit=100,noUnit=true,font=30,change=function()SFX.fplay("spawn_1",setting.spawn)end, disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400,unit=100,noUnit=true,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400,unit=100,noUnit=true,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_game","swipe")end}),
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}),
newSlider({name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=SETval("stereo"),code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..rnd(7),setting.spawn)end,disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400, font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400, unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400, font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
newButton({name="back", x=1140, y=640,w=180,h=80,color="white", font=35,code=BACK}),
},
setting_control={
newSlider({name="das", x=226, y=200,w=910, unit=26, font=30,disp=SETval("das"), code=SETsto("das")}),
newSlider({name="arr", x=226, y=290,w=525, unit=15, font=30,disp=SETval("arr"), code=SETsto("arr")}),
newSlider({name="sddas", x=226, y=380,w=350, unit=10, font=30,disp=SETval("sddas"), code=SETsto("sddas")}),
newSlider({name="sdarr", x=226, y=470,w=140, unit=4, font=30,disp=SETval("sdarr"), code=SETsto("sdarr")}),
newSlider({name="das", x=250, y=200,w=910, unit=26, font=30,disp=SETval("das"), show="frame_time",code=SETsto("das")}),
newSlider({name="arr", x=250, y=290,w=525, unit=15, font=30,disp=SETval("arr"), show="frame_time",code=SETsto("arr")}),
newSlider({name="sddas", x=250, y=380,w=350, unit=10, font=30,disp=SETval("sddas"), show="frame_time",code=SETsto("sddas")}),
newSlider({name="sdarr", x=250, y=470,w=140, unit=4, font=30,disp=SETval("sdarr"), show="frame_time",code=SETsto("sdarr")}),
newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}),
newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}),
newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}),
@@ -319,10 +326,10 @@ local Widgets={
_.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false
end}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=1140, y=640,w=180,h=80,color="white",font=35,code=BACK}),
},
setting_key={
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=45,code=BACK}),
newButton({name="back", x=1140,y=640,w=180,h=80,color="white",font=35,code=BACK}),
},
setting_skin={
newButton({name="prev", x=700,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.prevSet()end}),
@@ -363,10 +370,10 @@ local Widgets={
end
SFX.play("hold")
end}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=1140,y=640,w=180,h=80,color="white",font=35,code=BACK}),
},
setting_touch={
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,
newButton({name="default", x=520,y=80,w=200,h=80,color="white",font=35,
code=function()
local D=virtualkeySet[sceneTemp.default]
for i=1,#VK_org do
@@ -385,16 +392,16 @@ local Widgets={
sceneTemp.default=sceneTemp.default%5+1
sceneTemp.sel=nil
end}),
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,
newButton({name="snap", x=760,y=80,w=200,h=80,color="white",font=35,
code=function()
sceneTemp.snap=sceneTemp.snap%6+1
end}),
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
newButton({name="option", x=520,y=180,w=200,h=80,color="white",font=40,
code=function()
SCN.go("setting_touchSwitch")
end}),
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,
newButton({name="back", x=760,y=180,w=200,h=80,color="white",font=35,code=BACK}),
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,show="vkSize",
disp=function()
return VK_org[sceneTemp.sel].r/10-1
end,
@@ -432,8 +439,8 @@ local Widgets={
newButton({name="pro", x=1120, y=100, w=240,h=80,color="white",font=35,code=function()for i=1,20 do VK_org[i].ava=true end end}),
newSwitch({name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")}),
newSwitch({name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")}),
newSlider({name="sfx", x=800, y=380, w=180,unit=4,font=40,change=function()SFX.play("virtualKey",setting.VKSFX*.25)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
newSlider({name="vib", x=800, y=460, w=180,unit=2,font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
newSlider({name="sfx", x=800, y=380, w=180, font=40,change=function()SFX.play("virtualKey",setting.VKSFX)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
newSlider({name="vib", x=800, y=460, w=180,unit=2, font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
code=function()
@@ -442,14 +449,14 @@ local Widgets={
hide=function()
return not setting.VKTrack
end}),
newSlider({name="alpha", x=840, y=540, w=400,unit=10,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}),
newSlider({name="alpha", x=840, y=540, w=400,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
newButton({name="back", x=1140, y=640, w=180,h=80,color="white",font=35,code=BACK}),
},
setting_trackSetting={
newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}),
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}),
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}),
newButton({name="back", x=1080, y=600, w=240, h=80,color="white",font=45,code=BACK}),
newButton({name="back", x=1140, y=640, w=180,h=80,color="white",font=35,code=BACK}),
},
setting_lang={
newButton({name="chi", x=160, y=100,w=200,h=120,color="white",font=45,code=setLang(1)}),
@@ -457,25 +464,25 @@ local Widgets={
newButton({name="eng", x=600, y=100,w=200,h=120,color="white",font=45,code=setLang(3)}),
newButton({name="str", x=820, y=100,w=200,h=120,color="white",font=45,code=setLang(4)}),
newButton({name="yygq", x=1040, y=100,w=200,h=120,color="white",font=45,code=setLang(5)}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=35,code=BACK}),
},
help={
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("staff")end}),
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.go("history")end}),
newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=35,code=BACK}),
},
staff={
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=1140, y=640,w=180,h=80,color="white",font=35,code=BACK}),
},
history={
newKey({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp.pos==1 end}),
newKey({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp.pos==#sceneTemp.text end}),
newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}),
newKey({name="prev", x=1155, y=170,w=180, color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp.pos==1 end}),
newKey({name="next", x=1155, y=400,w=180, color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp.pos==#sceneTemp.text end}),
newButton({name="back", x=1140, y=640,w=180,h=80,color="white",font=35,code=BACK}),
},
stat={
newButton({name="path", x=980, y=620,w=250,h=80,color="white",font=25,code=function()love.system.openURL(love.filesystem.getSaveDirectory())end,hide=mobileHide}),
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=35,code=BACK}),
},
debug={
newButton({name="reset", x=640,y=200,w=260,h=100,color="yellow",font=40,
@@ -524,7 +531,7 @@ local Widgets={
hide=function()
return not sceneTemp.reset
end}),
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=35,code=BACK}),
},
}

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.10.5"
gameVersion="Alpha V0.10.7"
function love.conf(t)
t.identity="Techmino"--Saving folder
t.version="11.1"

BIN
font.ttf

Binary file not shown.

View File

@@ -40,7 +40,7 @@ preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
preBag={}
game={
frame=0, --Frame count
frame=0, --Frame count
result=false, --Game result (string)
pauseTime=0, --Time paused
pauseCount=0, --Pausing count
@@ -49,7 +49,7 @@ game={
warnLVL=0, --Warning level (show)
recording=false, --If recording
replaying=false, --If replaying
seed=math.random(999999999),--Game seed
seed=math.random(2e6),--Game seed
setting={}, --Game settings
rec={}, --Recording list, key,time,key,time...
@@ -82,6 +82,7 @@ AIfunc= require("parts/ai")
Modes= require("parts/modes")
TICK= require("parts/tick")
require("parts/scenes")
--Load files & settings
modeRanks={sprint_10=0}
@@ -116,34 +117,41 @@ if fs.getInfo("tech_ultimate.dat")then fs.remove("tech_ultimate.dat")end
if fs.getInfo("tech_ultimate+.dat")then fs.remove("tech_ultimate+.dat")end
--Update modeRanks
R=modeRanks
for k,v in next,R do
if type(k)=="number"then
local save=v
if not R[Modes[k].name]then
R[Modes[k].name]=v
do
local R=modeRanks
for k,v in next,R do
if type(k)=="number"then
if Modes[k]and not R[Modes[k].name]then
R[Modes[k].name]=v
end
R[k]=nil
end
R[k]=nil
end
end
if R.master_adavnce then
R.master_advance,R.master_adavnce=R.master_adavnce
end
if not text.modes[stat.lastPlay]then
stat.lastPlay="sprint_10"
end
if R.master_adavnce then
R.master_advance,R.master_adavnce=R.master_adavnce
end
if not text.modes[stat.lastPlay]then
stat.lastPlay="sprint_10"
end
--Update data file
S=stat
if type(setting.spawn)~="number"then
setting.spawn=0
end
if S.version~=gameVersion then
S.version=gameVersion
newVersionLaunch=true
--Update data file
local S=setting
if type(S.spawn)~="number"then S.spawn=0 end
if type(S.ghost)~="number"then S.ghost=.3 end
if type(S.center)~="number"then S.center=1 end
if S.bgm>1 then S.bgm=S.bgm*.01 end
if S.sfx>1 then S.sfx=S.sfx*.01 end
if S.voc>1 then S.voc=S.voc*.01 end
if S.stereo>1 then S.stereo=S.stereo*.1 end
if S.VKSFX>1 then S.VKSFX=S.VKSFX*.25 end
if S.VKAlpha>1 then S.VKAlpha=S.VKAlpha*.1 end
S=stat
if S.version~=gameVersion then
S.version=gameVersion
newVersionLaunch=true
fs.remove("sprintPenta.dat")
fs.remove("master_adavnce.dat")
fs.remove("master_beginner.dat")
end
R,S=nil
fs.remove("sprintPenta.dat")
fs.remove("master_adavnce.dat")
fs.remove("master_beginner.dat")
end
end

View File

@@ -6,6 +6,7 @@ return{
drop=15,lock=45,
fall=10,
center=false,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.reach_winCheck,
freshLimit=15,

View File

@@ -5,7 +5,7 @@ return{
env={
drop=10,lock=60,
fall=5,
center=false,ghost=false,
center=0,ghost=0,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.reach_winCheck,

View File

@@ -5,7 +5,7 @@ return{
env={
drop=30,lock=60,
block=false,
center=false,ghost=false,
center=0,ghost=0,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.reach_winCheck,

View File

@@ -7,7 +7,7 @@ return{
drop=30,lock=60,
next=1,
block=false,
center=false,ghost=false,
center=0,ghost=0,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.reach_winCheck,

View File

@@ -18,7 +18,7 @@ return{
env={
noFly=true,
das=16,arr=6,sddas=2,sdarr=2,
ghost=false,center=false,
center=0,ghost=0,
drop=3,lock=3,wait=10,fall=25,
next=1,hold=false,
sequence="rnd",

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,49 do L[i]=true end
local t=system~="Windows"and 0 or 2
local t=CCloader_filename[system] and 2 or 0
while t>0 do
local r=rnd(2,49)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(2,5)))
else
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000))
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(3,5),2,true,10000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(2,5)))
else
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000))
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(3,5),2,true,10000))
end
n=n+1
end end

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,49 do L[i]=true end
local t=system~="Windows"and 0 or 4
local t=CCloader_filename[system] and 4 or 0
while t>0 do
local r=rnd(2,49)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,7)))
else
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000))
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(6,8),3,true,20000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,7)))
else
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000))
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(6,8),3,true,20000))
end
n=n+1
end end

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,49 do L[i]=true end
local t=system~="Windows"and 0 or 6
local t=CCloader_filename[system] and 6 or 0
while t>0 do
local r=rnd(2,49)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(8,10)))
else
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(8,10)-1,4,true,30000))
PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(9,10),4,true,30000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(8,10)))
else
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(8,10)-1,4,true,30000))
PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(9,10),4,true,30000))
end
n=n+1
end end

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,100 do L[i]=true end
local t=system~="Windows"and 0 or 4
local t=CCloader_filename[system] and 4 or 0
while t>0 do
local r=rnd(2,99)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(2,5)))
else
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000))
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(3,5),2,true,10000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(2,5)))
else
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000))
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(3,5),2,true,10000))
end
n=n+1
end end

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,100 do L[i]=true end
local t=system~="Windows"and 0 or 4
local t=CCloader_filename[system] and 4 or 0
while t>0 do
local r=rnd(2,99)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,7)))
else
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000))
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(6,8),3,true,20000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,7)))
else
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000))
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(6,8),3,true,20000))
end
n=n+1
end end

View File

@@ -33,7 +33,7 @@ return{
}
PLY.newPlayer(1,340,15)
local L={}for i=1,100 do L[i]=true end
local t=system~="Windows"and 0 or 4
local t=CCloader_filename[system] and 4 or 0
while t>0 do
local r=rnd(2,99)
if L[r]then L[r],t=false,t-1 end
@@ -43,7 +43,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(8,10)))
else
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000))
PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(9,10),4,true,30000))
end
n=n+1
end end
@@ -51,7 +51,7 @@ return{
if L[n]then
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(8,10)))
else
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000))
PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(9,10),4,true,30000))
end
n=n+1
end end

View File

@@ -1,12 +1,10 @@
--[[
HighestBlock
HorizontalTransitions
VerticalTransitions
BlockedCells
Wells
FilledLines
4deepShape
BlockedWells;
BlockedWells
]]
local int,ceil,min,abs,rnd=math.floor,math.ceil,math.min,math.abs,math.random
local ins,rem=table.insert,table.remove
@@ -18,9 +16,32 @@ local Timer=love.timer.getTime
local blockPos={4,4,4,4,4,5,4}
local scs={{0,1},{0,1},{0,1},{0,1},{0,1},{.5,.5},{-.5,1.5}}
-------------------------------------------------Cold clear
local CCblockID={4,3,6,5,1,2,0}
if system=="Windows"then
require("CCloader")
local CCblockID={6,5,4,3,2,1,0}
CCloader_filename={
Windows={"CCloader.dll",{"x86_64","x86"}},
Android={"libCCloader.so",{"arm64-v8a","armeabi-v7a"}},
Linux={"libCCloader.so",{"x86_64"}},
}
local function loadCC()
if not CCloader_filename[system]then return end
local f
for i=1,#CCloader_filename[system][2]do
function f()
local CCloader_f,size=love.filesystem.read("data",table.concat({"lib",system,CCloader_filename[system][2][i],CCloader_filename[system][1]},"/"))
if not CCloader_f then return end
local success,message=love.filesystem.write(CCloader_filename[system][1],CCloader_f,size)
if not success then return end
local success,message=package.loadlib(table.concat({love.filesystem.getSaveDirectory(),CCloader_filename[system][1]},"/"),"luaopen_CCloader")
return success,message
end
f=f()
if f then break end
end
if not f then
CCloader_filename[system]=nil
return
end
f()
BOT={
getConf= cc.get_default_config ,--()options,weights
--setConf= cc.set_options ,--(options,hold,20g,bag7)
@@ -29,12 +50,12 @@ if system=="Windows"then
addNext= cc.add_next_piece_async ,--(bot,piece)
update= cc.reset_async ,--(bot,field,b2b,combo)
think= cc.request_next_move ,--(bot)
getMove= cc.poll_next_move ,--(bot)success,hold,move
ifDead= cc.is_dead_async ,--(bot)dead
getMove= cc.poll_next_move ,--(bot)success,dest,hold,move
destroy= cc.destroy_async ,--(bot)
setHold= cc.set_hold ,--(opt,bool)
set20G= cc.set_20g ,--(opt,bool)
setPCLoop= cc.set_pcloop ,--(opt,bool)
setBag= cc.set_bag7 ,--(opt,bool)
setNode= cc.set_max_nodes ,--(opt,bool)
free= cc.free ,--(opt/wei)
@@ -66,7 +87,8 @@ if system=="Windows"then
BOT.addNext(P.AI_bot,CCblockID[P.next[i].id])
end
CC_updateField(P)
P.hd={bk={{}},id=0,color=0,name=0}P.holded=false
P.hd=nil
P.holded=false
P.cur=rem(P.next,1)
P.sc,P.dir=scs[P.cur.id],0
P.r,P.c=#P.cur.bk,#P.cur.bk[1]
@@ -80,6 +102,7 @@ if system=="Windows"then
collectgarbage()
end
end
loadCC()
-------------------------------------------------9 Stack setup
local dirCount={1,1,3,3,3,0,1}
local spinOffset={
@@ -218,7 +241,7 @@ return{
end
if not bn then goto CTN end
for dir=0,dirCount[bn] do--Each dir
for dir=0,dirCount[bn]do--Each dir
local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--Each pos
local cy=#Tfield+1
@@ -282,9 +305,17 @@ return{
return 2
end,
function(P,ctrl)--Poll keys
if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end
local success,hold,move=BOT.getMove(P.AI_bot)
if success then
local success,dest,hold,move=BOT.getMove(P.AI_bot)
if success==2 then
ins(ctrl,6)
return 3
elseif success==0 then
for i=1,#dest do
for j=1,#dest[i]do
dest[i][j]=dest[i][j]+1
end
end
P.AI_dest=dest
if hold then ctrl[1]=8 end--Hold
while move[1]do
local m=rem(move,1)

View File

@@ -5,7 +5,7 @@ setting={
ihs=true,irs=true,ims=true,
maxNext=6,
swap=true,
--System
reTime=4,
autoPause=true,
@@ -17,7 +17,7 @@ setting={
face={},
--Graphic
ghost=true,center=true,
ghost=.3,center=1,
smooth=true,grid=false,
bagLine=false,
lockFX=2,
@@ -35,15 +35,15 @@ setting={
powerInfo=false,
--Sound
sfx=10,
sfx=1,
spawn=0,
bgm=7,
stereo=6,
bgm=.7,
stereo=.6,
vib=0,
voc=0,
--Virtualkey
VKSFX=3,--SFX volume
VKSFX=.2,--SFX volume
VKVIB=0,--VIB
VKSwitch=false,--If disp
VKTrack=false,--If tracked
@@ -51,7 +51,7 @@ setting={
VKTchW=3,--Touch-Pos Weight
VKCurW=4,--Cur-Pos Weight
VKIcon=true,--If disp icon
VKAlpha=3,
VKAlpha=.3,
}
for i=1,25 do
setting.face[i]=0

View File

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

View File

@@ -321,8 +321,6 @@ function resetGameData()
BGM.play(modeEnv.bgm)
TEXT.clear()
FX_badge={}
FX_attack={}
if modeEnv.royaleMode then
for i=1,#players do
players[i]:changeAtk(randomTarget(players[i]))

View File

@@ -27,11 +27,21 @@ if setting.lang==1 or setting.lang==2 then
"e^(pi*i)=-1",
"DT炮=TSD+TST炮",
"Cultris II也很好玩!",
"Ctrl+W=关闭当前标签页",
"Ctrl+Tab=切换标签页",
"Ctrl+F=查找",
"Ctrl+D=复制一份",
"Ctrl+Alt+Z=查看所有qq消息",
"Ctrl+A=全选",
"Ctrl+鼠标滚轮=缩放",
"COOL!!",
"BT炮=beta炮",
"backspace=返回上一个文件目录",
"B2B2B2B存在吗?",
"B2B2B???",
"Am G F G",
"Alt+Tab=切换窗口",
"Alt+F4=关闭当前窗口",
"ALLSPIN!",
"注意到\"旋转\"到底对方块做了些什么吗?",
"有疑问? 先看设置有没有你想要的",
@@ -47,24 +57,22 @@ if setting.lang==1 or setting.lang==2 then
"使用love2d引擎制作",
"少女祈祷中",
"扫雷好玩!",
"哦,我的上帝",
"你可以长按R键重新开始游戏(也不是很长)",
"你可以从统计页面打开游戏存档目录",
"你好 世界!",
"魔方好玩!",
"喵!",
"免费吃鸡方块",
"秘密数字:626",
"每个虚拟按键都可以隐藏/显示",
"每个虚拟按键都可以隐藏/显示,尺寸也可调",
"每个块的出现方向可以自定义",
"没专业美术,程序员审美警告",
"专业美术的人,程序员审美警告",
"没学过编曲,音乐都是自己凭感觉写的,觉得不好听就设置里关了吧",
"联网还没做呢, 别急",
"键位是可以自定义的",
"健康小贴士:上厕所太用力容易脑出血(尤其是老年人!)",
"健康小贴士:不要熬夜,真的容易猝死",
"健康小贴士:玩游戏多眨眼,不然会干眼病",
"健康小贴士:不要熬夜,真的猝死",
"合群了就会消失, 但是消失不代表没有意义",
"更小的DAS和ARR拥有更高的操作上限(如果你还能控制得了的话)",
"更小的DAS和ARR拥有更高的操作上限(前提是你能控制得了)",
"俄罗斯方块环游记也不错!",
"调到特殊的日期也不会发生什么的",
"低帧率会降低游戏体验",
@@ -75,7 +83,6 @@ if setting.lang==1 or setting.lang==2 then
"草(日本语)",
"不要在上课时玩游戏!",
"不要盯着bug不放",
"不要按F10",
"不是动画,真的在加载!",
"别问游戏名怎么取的,问就是随便想的",
"本游戏难度上限很高, 做好心理准备",
@@ -109,6 +116,7 @@ elseif setting.lang==3 then
"Who is diao",
"What about 26 TSDs?",
"What about 20 PCs?",
"What about 23 PCs in 100 lines?",
"Warning: Programmer Art",
"Try to use two rotate button,three better",
"This in not a casual game",

View File

@@ -119,7 +119,10 @@ local TRS={
if y==P.imgY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
local D=P.spinSeq%100*10+d
P.spinSeq=D
if D<100 then return end
if D<100 then
P:freshBlock(true,true)
return
end
for i=1,#OspinList do
local L=OspinList[i]
if D==L[1]then
@@ -144,8 +147,8 @@ local TRS={
end
else
P.spinSeq=0
P:freshBlock(true,true)
end
P:freshBlock(true,true)
end,--O
{
[01]={{ 0, 1},{ 1, 0},{-2, 0},{-2,-1},{ 1, 2}},
@@ -213,10 +216,10 @@ local TRS={
[31]={{-1, 0},{ 1, 1},{ 2, 0}},
},--T5
{
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{-1,-3}},
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 1, 3}},
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 1,-3}},
[30]={{-1, 0},{-1,-1},{ 0,-2},{-1, 2},{-1, 3}},
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2}},
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2}},
[03]={{ 1, 0},{ 1, 1},{ 0,-2},{ 1,-2}},
[30]={{-1, 0},{-1,-1},{ 0,-2},{-1, 2}},
[12]={{ 1, 0},{ 1,-1},{ 1, 1}},
[21]={{-1,-1},{-1, 1},{-1,-1}},
[32]={{-1, 0},{-1,-1},{-1, 1}},
@@ -230,7 +233,7 @@ local TRS={
[01]={{ 0, 1},{-1, 0},{ 0,-2},{-1,-2}},
[10]={{ 0, 1},{ 1, 0},{ 0,-2},{ 1,-2}},
[03]={{ 0,-1},{ 0, 1},{ 0, 2}},
[30]={{ 0,-1},{ 0,-1},{ 0,-2}},
[30]={{ 0,-1},{ 0, 1},{ 0,-2}},
[12]={{ 0,-1},{ 0, 1}},
[21]={{ 0,-1},{ 0,-2}},
[32]={{ 1, 0},{-1, 0}},
@@ -285,14 +288,14 @@ local TRS={
},--J5
{},--L5
{
[01]={{-1, 0},{-1, 1},{ 1, 0},{-1, 2},{-1,-1},{ 0,-3},{ 0, 1}},
[10]={{-1, 0},{ 1,-1},{ 1, 0},{ 1,-2},{ 1, 1},{ 0, 3},{ 0, 1}},
[03]={{ 0,-1},{ 1,-1},{-1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 0,-3},{ 1,-3},{-1, 1}},
[30]={{ 0, 1},{-1, 1},{ 1, 0},{-1,-1},{ 0, 2},{-1, 2},{ 0, 3},{-1, 3},{ 1,-1}},
[01]={{-1, 0},{-1, 0},{-1, 1},{ 1, 0},{-1, 2},{-1,-1},{ 0,-3},{ 0, 1}},
[10]={{-1, 0},{ 1, 0},{ 1,-1},{ 1, 0},{ 1,-2},{ 1, 1},{ 0, 3},{ 0, 1}},
[03]={{ 0,-1},{ 1, 0},{ 1,-1},{-1, 0},{ 1, 1},{ 0,-2},{ 1,-2},{ 0,-3},{ 1,-3},{-1, 1}},
[30]={{ 0, 1},{-1, 0},{-1, 1},{ 1, 0},{-1,-1},{ 0, 2},{-1, 2},{ 0, 3},{-1, 3},{ 1,-1}},
[12]={{ 1, 0},{ 1,-1},{ 0,-1},{ 1,-2},{ 0,-2},{ 1, 1},{-1, 0},{ 0, 2},{ 1, 2}},
[21]={{-1, 0},{-1, 1},{ 0, 1},{-1, 2},{ 0, 2},{-1,-1},{ 1, 0},{ 0,-2},{-1,-2}},
[32]={{-1, 0},{ 0,-1},{-1, 1},{-1,-1},{ 1, 0},{ 0, 2},{-1, 2},{ 0,-2}},
[23]={{ 1, 0},{ 0, 1},{ 1,-1},{ 1, 1},{-1, 0},{ 0,-2},{ 1,-2},{ 0, 2}},
[32]={{ 0,-1},{-1, 0},{-1, 1},{-1,-1},{ 1, 0},{ 0, 2},{-1, 2},{ 0,-2}},
[23]={{ 0, 1},{ 1, 0},{ 1,-1},{ 1, 1},{-1, 0},{ 0,-2},{ 1,-2},{ 0, 2}},
[02]={{ 0,-1},{ 1,-1},{-1, 0},{ 2,-1},{ 0, 1}},
[20]={{ 0, 1},{-1, 1},{ 1, 0},{-2, 1},{ 0,-1}},
[13]={{-1, 0},{-1,-1},{ 0, 1},{-1,-2}},

View File

@@ -14,7 +14,7 @@ local gameEnv0={
ihs=true,irs=true,ims=true,
swap=true,
ghost=true,center=true,
ghost=.3,center=1,
smooth=false,grid=false,
bagLine=false,
text=true,
@@ -87,7 +87,7 @@ local finesseList={
finesseList[1][3],finesseList[1][4],finesseList[7][3],finesseList[7][4]=finesseList[1][1],finesseList[1][2],finesseList[7][1],finesseList[7][2]--"2-phase" SZI
finesseList[2]=finesseList[1]--S=Z
finesseList[4],finesseList[5]=finesseList[3],finesseList[3]--J=L=T
local CCblockID={4,3,6,5,1,2,0}
local CCblockID={6,5,4,3,2,1,0}
local freshPrepare={
none=NULL,
bag=function(P)
@@ -568,7 +568,7 @@ local function drawFXs(P)
local w=30*S[3]*(1-S[5]*.5)
gc.rectangle("fill",30*S[1]-30+15*S[3]-w*.5,600-30*S[2],w,30*S[4])
end
--MoveFX
for i=1,#P.moveFX do
local S=P.moveFX[i]
@@ -588,6 +588,7 @@ local function drawFXs(P)
end
local function Pdraw_norm(P)
local _
local ENV=P.gameEnv
gc.push("transform")
--Camera
@@ -598,7 +599,7 @@ local function Pdraw_norm(P)
gc.setColor(0,0,0,.6)gc.rectangle("fill",0,-10,300,610)
--Grid
if P.gameEnv.grid then
if ENV.grid then
gc.setLineWidth(1)
gc.setColor(1,1,1,.2)
for x=1,9 do gc.line(30*x,-10,30*x,600)end
@@ -622,8 +623,8 @@ local function Pdraw_norm(P)
end
end
else--Field with falling animation
local dy,stepY=0,P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local A=P.falling/P.gameEnv.fall
local dy,stepY=0,ENV.smooth and(P.falling/(ENV.fall+1))^2.5*30 or 30
local A=P.falling/ENV.fall
local h,H=1,#P.field
for j=int(P.fieldBeneath/30+1),H do
while j==P.clearingRow[h]do
@@ -649,8 +650,8 @@ local function Pdraw_norm(P)
local curColor=P.cur.color
--Ghost
if P.gameEnv.ghost then
gc.setColor(1,1,1,.3)
if ENV.ghost then
gc.setColor(1,1,1,ENV.ghost)
for i=1,P.r do for j=1,P.c do
if P.cur.bk[i][j]then
drawPixel(i+P.imgY-1,j+P.curX-1,curColor)
@@ -658,10 +659,10 @@ local function Pdraw_norm(P)
end end
end
local dy=P.gameEnv.smooth and P.imgY~=P.curY and(P.dropDelay/P.gameEnv.drop-1)*30 or 0
local dy=ENV.smooth and P.imgY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0
gc.translate(0,-dy)
local trans=P.lockDelay/P.gameEnv.lock
if P.gameEnv.block then
local trans=P.lockDelay/ENV.lock
if ENV.block then
--White Boarder(indicate lockdelay)
SHADER.alpha:send("a",trans)
gc.setShader(SHADER.alpha)
@@ -686,13 +687,13 @@ local function Pdraw_norm(P)
end
--Rotate center
if P.gameEnv.center then
gc.setColor(1,1,1,trans)
if ENV.center then
gc.setColor(1,1,1,trans*ENV.center)
local x=30*(P.curX+P.sc[2])-15
gc.draw(IMG.spinCenter,x,600-30*(P.curY+P.sc[1])+15,nil,nil,nil,4,4)
if P.gameEnv.ghost then
if ENV.ghost then
gc.translate(0,dy)
gc.setColor(1,1,1,.5)
gc.setColor(1,1,1,trans*ENV.center)
gc.draw(IMG.spinCenter,x,600-30*(P.imgY+P.sc[1])+15,nil,nil,nil,4,4)
goto E
end
@@ -706,19 +707,19 @@ local function Pdraw_norm(P)
gc.rectangle("line",-1,-11,302,612)--Boarder
gc.rectangle("line",301,0,15,601)--AtkBuffer boarder
gc.rectangle("line",-16,-3,15,604)--B2b bar boarder
--LockDelay indicator
if P.gameEnv.easyFresh then
if ENV.easyFresh then
gc.setColor(1,1,1)
else
gc.setColor(1,.26,.26)
end
if P.lockDelay>=0 then
gc.rectangle("fill",0,602,300*P.lockDelay/P.gameEnv.lock,6)--Lock delay indicator
gc.rectangle("fill",0,602,300*P.lockDelay/ENV.lock,6)--Lock delay indicator
end
_=3
for i=1,min(P.gameEnv.freshLimit-P.freshTime,15)do
for i=1,min(ENV.freshLimit-P.freshTime,15)do
gc.rectangle("fill",_,615,14,5)
_=_+20
end
@@ -769,7 +770,7 @@ local function Pdraw_norm(P)
gc.translate(-P.fieldOff.x,-P.fieldOff.y)
--Draw Hold
if P.gameEnv.hold then
if ENV.hold then
gc.setColor(0,0,0,.4)gc.rectangle("fill",-140,36,124,80)
gc.setColor(1,1,1)gc.rectangle("line",-140,36,124,80)
mText(drawableText.hold,-78,-15)
@@ -785,13 +786,13 @@ local function Pdraw_norm(P)
end
--Draw Next(s)
local N=P.gameEnv.next*72
if P.gameEnv.next>0 then
local N=ENV.next*72
if ENV.next>0 then
gc.setColor(0,0,0,.4)gc.rectangle("fill",316,36,124,N)
gc.setColor(1,1,1)gc.rectangle("line",316,36,124,N)
mText(drawableText.next,378,-15)
N=1
while N<=P.gameEnv.next and P.next[N]do
while N<=ENV.next and P.next[N]do
local b,c=P.next[N].bk,P.next[N].color
for i=1,#b do for j=1,#b[1] do
if b[i][j]then
@@ -803,8 +804,8 @@ local function Pdraw_norm(P)
end
--Draw Bagline(s)
if P.gameEnv.bagLine then
local L=P.gameEnv.bagLen
if ENV.bagLine then
local L=ENV.bagLen
local C=-P.pieceCount%L--Phase
gc.setColor(.8,.5,.5)
for i=C,N-1,L do
@@ -914,6 +915,7 @@ local function Pdraw_small(P)
end
local function Pdraw_demo(P)
local _
local ENV=P.gameEnv
local curColor=P.cur.color
--Camera
@@ -940,8 +942,8 @@ local function Pdraw_demo(P)
end
else
--Field with falling animation
local dy,stepY=0,P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local A=P.falling/P.gameEnv.fall
local dy,stepY=0,ENV.smooth and(P.falling/(ENV.fall+1))^2.5*30 or 30
local A=P.falling/ENV.fall
local h,H=1,#P.field
for j=int(P.fieldBeneath/30+1),H do
while j==P.clearingRow[h]do
@@ -993,7 +995,7 @@ local function Pdraw_demo(P)
--Draw next
local N=1
while N<=P.gameEnv.next and P.next[N]do
while N<=ENV.next and P.next[N]do
local id=P.next[N].id
_=P.color[id]
gc.setColor(_[1],_[2],_[3],.3)
@@ -1040,7 +1042,7 @@ function player.createLockFX(P)
end
end
end
function player.creatDropFX(P,x,y,w,h)--TODO, remake dropFX
function player.creatDropFX(P,x,y,w,h)
ins(P.dropFX,{x,y,w,h,0,13-2*P.gameEnv.dropFX})
end
function player.createMoveFX(P,dir)
@@ -1049,40 +1051,32 @@ function player.createMoveFX(P,dir)
local x=P.curX-1
local y=P.gameEnv.smooth and P.curY+P.dropDelay/P.gameEnv.drop-2 or P.curY-1
if dir=="left"then
for i=1,P.r do
for j=P.c,1,-1 do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
for i=1,P.r do for j=P.c,1,-1 do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
end
end end
elseif dir=="right"then
for i=1,P.r do
for j=1,P.c do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
for i=1,P.r do for j=1,P.c do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
end
end end
elseif dir=="down"then
for j=1,P.c do
for i=P.r,1,-1 do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
for j=1,P.c do for i=P.r,1,-1 do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
break
end
end
end end
else
for i=1,P.r do
for j=1,P.c do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
end
for i=1,P.r do for j=1,P.c do
if P.cur.bk[i][j]then
ins(P.moveFX,{C,x+j,y+i,0,T})
end
end
end end
end
end
function player.createBeam(P,R,send,time,target,color,clear,spin,combo)
@@ -1136,17 +1130,7 @@ function player.createBeam(P,R,send,time,target,color,clear,spin,combo)
radius=radius*.4
a=.35
end
ins(FX_attack,{
x=x1,y=y1,--Current pos
x1=x1,y1=y1,--Start pos
x2=x2,y2=y2,--End pos
rad=radius*(setting.atkFX+3)*.12,
corner=corner,
type=type==1 and"fill"or"line",
r=r,g=g,b=b,a=a*(setting.atkFX+5)*.1,
t=0,
drag={},--Afterimage coordinate list
})
sysFX.newAttack(x1,y1,x2,y2,radius*(setting.atkFX+3)*.12,corner,type==1 and"fill"or"line",r,g,b,a*(setting.atkFX+5)*.1)
end
function player.newTask(P,code,data)
local L=P.tasks
@@ -1280,6 +1264,7 @@ function player.garbageRise(P,color,amount,pos)
for i=1,#P.clearingRow do
P.clearingRow[i]=P.clearingRow[i]+amount
end
P:freshBlock(false,false)
for i=1,#P.lockFX do
_=P.lockFX[i]
_[2]=_[2]-30*amount--Shift 30px per line cleared
@@ -1367,9 +1352,10 @@ function player.changeAtk(P,R)
end
end
function player.freshBlock(P,keepGhost,control,system)
local ENV=P.gameEnv
if not keepGhost and P.cur then
P.imgY=min(#P.field+1,P.curY)
if P.gameEnv._20G or P.keyPressing[7]and P.gameEnv.sdarr==0 then
if ENV._20G or P.keyPressing[7]and ENV.sdarr==0 then
local _=P.imgY
--Move ghost to bottom
@@ -1384,11 +1370,11 @@ function player.freshBlock(P,keepGhost,control,system)
--Create FX if dropped
if P.curY>P.imgY then
if P.gameEnv.dropFX and P.gameEnv.block and P.curY-P.imgY-P.r>-1 then
if ENV.dropFX and ENV.block and P.curY-P.imgY-P.r>-1 then
P:creatDropFX(P.curX,P.curY-1,P.c,P.curY-P.imgY-P.r+1)
end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5
if ENV.shakeFX then
P.fieldOff.vy=ENV.shakeFX*.5
end
P.curY=P.imgY
end
@@ -1400,33 +1386,35 @@ function player.freshBlock(P,keepGhost,control,system)
end
if control then
if P.gameEnv.easyFresh then
local d0=P.gameEnv.lock
if P.lockDelay<d0 and P.freshTime<P.gameEnv.freshLimit then
if ENV.easyFresh then
local d0=ENV.lock
if P.lockDelay<d0 and P.freshTime<ENV.freshLimit then
if not system then
P.freshTime=P.freshTime+1
end
P.lockDelay=d0
P.dropDelay=P.gameEnv.drop
P.dropDelay=ENV.drop
end
if P.curY<P.minY then
P.minY=P.curY
P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
P.dropDelay=ENV.drop
P.lockDelay=ENV.lock
end
else
if P.curY<P.minY then
P.minY=P.curY
if P.lockDelay<P.gameEnv.lock and P.freshTime<P.gameEnv.freshLimit then
if P.lockDelay<ENV.lock and P.freshTime<ENV.freshLimit then
P.freshTime=P.freshTime+1
P.dropDelay=P.gameEnv.drop
P.lockDelay=P.gameEnv.lock
P.dropDelay=ENV.drop
P.lockDelay=ENV.lock
end
end
end
end
end
function player.lock(P)
local dest=P.AI_dest
local has_dest=dest~=nil
for i=1,P.r do
local y=P.curY+i-1
if not P.field[y]then P.field[y],P.visTime[y]=freeRow.get(0),freeRow.get(0)end
@@ -1434,9 +1422,25 @@ function player.lock(P)
if P.cur.bk[i][j]then
P.field[y][P.curX+j-1]=P.cur.color
P.visTime[y][P.curX+j-1]=P.showTime
local x=P.curX+j-1
if dest then
local original_length=#dest
for k=1,original_length do
if x==dest[k][1]and y==dest[k][2]then
rem(dest, k)
break
end
end
if #dest~=original_length-1 then
dest=nil
end
end
end
end
end
if has_dest and not dest then
CC_updateField(P)
end
end
function player.spin(P,d,ifpre)
local iki=P.RS[P.cur.id]
@@ -2496,19 +2500,21 @@ function player.act.insRight(P,auto)
end
end
function player.act.insDown(P)
if P.curY>P.imgY and P.cur then
if P.cur and P.curY>P.imgY then
if P.gameEnv.dropFX and P.gameEnv.block and P.curY-P.imgY-P.r>-1 then
P:creatDropFX(P.curX,P.curY-1,P.c,P.curY-P.imgY-P.r+1)
end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5
end
P.curY,P.lockDelay,P.spinLast=P.imgY,P.gameEnv.lock,false
P.curY=P.imgY
P.lockDelay=P.gameEnv.lock
P.spinLast=false
P:freshBlock(true,true)
end
end
function player.act.down1(P)
if P.curY>P.imgY and P.cur then
if P.cur and P.curY>P.imgY then
if P.gameEnv.moveFX and P.gameEnv.block then
P:createMoveFX("down")
end
@@ -2518,27 +2524,25 @@ function player.act.down1(P)
end
end
function player.act.down4(P)
for _=1,4 do
if P.curY>P.imgY and P.cur then
P.curY=P.curY-1
P:freshBlock(true,true)
P.spinLast=false
else
return
if P.cur and P.curY>P.imgY then
local y=max(P.cur-4,P.imgY)
if P.gameEnv.dropFX and P.gameEnv.block and P.curY-y-P.r>-1 then
P:creatDropFX(P.curX,P.curY-1,P.c,P.curY-y-P.r+1)
end
P.curY=y
P:freshBlock(true,true)
P.spinLast=false
end
end
function player.act.down10(P)
if P.cur then
for _=1,10 do
if P.curY>P.imgY then
P.curY=P.curY-1
P:freshBlock(true,true)
P.spinLast=false
else
return
end
if P.cur and P.curY>P.imgY then
local y=max(P.cur-10,P.imgY)
if P.gameEnv.dropFX and P.gameEnv.block and P.curY-y-P.r>-1 then
P:creatDropFX(P.curX,P.curY-1,P.c,P.curY-y-P.r+1)
end
P.curY=y
P:freshBlock(true,true)
P.spinLast=false
end
end
function player.act.dropLeft(P)
@@ -2566,14 +2570,16 @@ function player.act.zangiRight(P)
P.act.hardDrop(P)
end
--Give operations a num name
A=player.act
T={
A.moveLeft ,A.moveRight, A.rotRight, A.rotLeft,
A.rot180 ,A.hardDrop, A.softDrop, A.hold,
A.func ,A.restart, A.insLeft, A.insRight,
A.insDown ,A.down1, A.down4, A.down10,
A.dropLeft ,A.dropRight, A.zangiLeft,A.zangiRight
}for i=1,20 do A[i]=T[i]end;A,T=nil
do
local A=player.act
local T={
A.moveLeft ,A.moveRight, A.rotRight, A.rotLeft,
A.rot180 ,A.hardDrop, A.softDrop, A.hold,
A.func ,A.restart, A.insLeft, A.insRight,
A.insDown ,A.down1, A.down4, A.down10,
A.dropLeft ,A.dropRight, A.zangiLeft,A.zangiRight
}for i=1,20 do A[i]=T[i]end
end
--------------------------</Control>--------------------------
--------------------------<Generator>--------------------------
@@ -2731,6 +2737,8 @@ local function applyGameEnv(P)--Finish gameEnv processing
if ENV.moveFX==0 then ENV.moveFX=nil end
if ENV.clearFX==0 then ENV.clearFX=nil end
if ENV.shakeFX==0 then ENV.shakeFX=nil end
if ENV.ghost==0 then ENV.ghost=nil end
if ENV.center==0 then ENV.center=nil end
end
local function prepareSequence(P)--Call freshPrepare and set newNext
local ENV=P.gameEnv

1635
parts/scenes.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,7 @@ function Tick.throwBadge(data)--{ifAI,Sender,timer}
end
--Generate badge object
FX_badge[#FX_badge+1]={x1,y1,x2,y2,t=0}
sysFX.newBadge(x1,y1,x2,y2)
if not data[1]and data[3]%8==0 then
SFX.play("collect")

View File

@@ -1,11 +1,11 @@
local S=[=[
"Patron"(time ordered, may not accurate):
[rmb100+]:
<<<rmb100+>>>
那没事了(T6300) 加油啊,钉钉动了的大哥哥(T3228)
弥佑瑶 Alan 幽灵3383
靏鸖龘龘 込余 saki
模电
[rmb10+]:
<rmb10+>
八零哥 蕴空之灵 gggf127 dtg ThTsOd
Fireboos 金巧 10元 立斐 Deep_Sea
时雪 yyangdid sfqr 心痕 Sasoric
@@ -18,31 +18,29 @@ local S=[=[
世界沃德 蓝绿 天生的魔法师 琳雨空 T8779.易缄
吃水榴莲 诗情画意 星姐阿夸双推Man暗炎 [*炎]
[*Y] aaa222 [**城] cnDD 红桃老给
昭庭玲秋 旋树墩 火花工作室 Cosine 天上_飞
昭庭玲秋 旋树墩 火花工作室 Cosine 沁音的芝麻王
SuperJH 天上_飞 *莲 uiro
Thanks!!!
Future outlook:
New modes:
PUYO
dig practice
dig zen
infinite PC challenge
reverb (often repeat a piece many times)
game tutorial
finesse tutorial/exam(3next, 1pt/mino, drop to score)
finesse tutorial/exam (3next, 1pt/mino, drop to score)
easy finesse (only revert current)
game Abbr. test
combo
backfire
round-based dig
bigbang
rhythm
KPP-locked
combo
square
field shifting(left/right)
task survival
dig practice
dig zen
symmetry
hidden: sound only
reverb (often repeat a piece many times)
game Abbr. test
parkour
Other:
mod system with:
@@ -51,22 +49,50 @@ Future outlook:
field flip(LR/UD)
no fail(∞ lives)
mini games:
15 puzzle (with hidden mode)
2048 (with next/deadly mode)
mine sweeper
tank battle
new AI: task-Z
'Encrypt'(compile to byte code)
better drop FX
60+ fps supporting
in-game document
game recording
full-key control
drag control for mobile device
new widgets (joystick etc.)
splashing block
more graphic FXs & 3D features & animations
network game
方块散落动画
task-Z(新AI)
工程编译到字节码
游戏内文档
改连击攻击
场地序列一起复制
自定义消行要求(可复制)
支持超60帧
录像保存/导出
"一键操作"
手机滑动操作
新控件(例如虚拟摇杆)
联网游戏
更多画面效果 & 一些3D小玩意
0.10.7: 15P更新 15puzzle update
新内容:
ghost和center透明度可调
15puzzle(软件锁界面输入815/1524/2435进入)
改动:
大多数滑条都会显示当前值
滑条交互机制优化
部分控件重排版
更新计划改为中文
代码:
部分设置值域改为[0%,100%]
整理场景代码,同一个场景代码放在一起
攻击特效和徽章特效并入sysFX
修复:
修复挖掘模式涨行不刷新ghost
控制设置页面预览显示bug
在倒计时阶段按一些按键会报错
0.10.6: CC更新 Cold Clear update
新内容:
全平台支持新版CC(也许)
改动:
修改UVRY的踢墙表
修复:
O卡住的时候旋转不刷新锁定延迟
CC在发现重力过大后hold即报错
0.10.5: 特效更新 FX update
新内容:
@@ -80,18 +106,19 @@ Future outlook:
增加无尽挖掘连挖提示,挖完后下一波立即升起
new English translation by @MattMayuga#8789
修改100/400/1000L的评级要求
支持加载部分老版本存档
软件锁界面出现时机调整,按钮位置调整
调整混战模式倍率影响边框颜色的范围
软件锁也可显示tip
代码:
重命名大多数背景
重构createXxxFX函数
重构create___FX函数
修复:
几个设置大标题样式统一
加载部分老版本存档报错
几个设置大标题样式不统一
有消行延迟+出块等待时连续硬降出现神秘现象
垃圾行上涨不刷新ghost
粘贴序列bug
可以用键盘复制粘贴序列
粘贴序列后光标位置错误
不能用键盘复制粘贴序列
每次启动游戏ai是一样的块序
0.10.4: 漏洞修复 Bug Fix