0.9.2:调试界面,新背景,布局微调

This commit is contained in:
MrZ_26
2020-07-23 00:42:47 +08:00
parent ae650bd1ff
commit bb2c732529
39 changed files with 449 additions and 159 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -119,30 +119,38 @@ back.game3={
BG.resize(scr.w,scr.h)
end,
resize=function(w,h)
SHADER.gradient3:send("w",w*scr.dpi)
SHADER.gradient3:send("h",h*scr.dpi)
SHADER.rgb1:send("w",w*scr.dpi)
SHADER.rgb1:send("h",h*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.gradient3:send("t",t)
gc.setShader(SHADER.gradient3)
SHADER.rgb1:send("t",t)
gc.setShader(SHADER.rgb1)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--beautiful RGB
}--Colorful RGB
back.game4={
init=function()
t=0
BG.resize(scr.w,scr.h)
end,
resize=function(w,h)
SHADER.rgb2:send("w",w*scr.dpi)
SHADER.rgb2:send("h",h*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.rgb2:send("t",t)
gc.setShader(SHADER.rgb2)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Blue strap
}--Blue RGB
back.game5={
init=function()
t=0

View File

@@ -1,7 +1,7 @@
local IMG={
batteryImage="/mess/power.png",
titleImage="mess/title.png",
coloredTitleImage="mess/title_colored.png",
title="mess/title.png",
title_color="mess/title_colored.png",
dialCircle="mess/dialCircle.png",
dialNeedle="mess/dialNeedle.png",
badgeIcon="mess/badge.png",

View File

@@ -218,7 +218,7 @@ function mouseClick.mode(x,y,k)
cam.x=cam.x-180
end
elseif _ then
loadGame(_)
keyDown.mode("return")
end
end
cam.keyCtrl=false
@@ -247,8 +247,20 @@ end
function keyDown.mode(key)
if key=="return"then
if mapCam.sel then
if mapCam.sel=="custom_clear"or mapCam.sel=="custom_puzzle"then
if customSel[11]>1 then
if customSel[7]==5 then
TEXT.show(text.ai_fixed,640,360,50,"appear")
return
elseif #preBag>0 then
TEXT.show(text.ai_prebag,640,360,50,"appear")
return
end
end
end
mapCam.keyCtrl=false
SCN.push()loadGame(mapCam.sel)
SCN.push()
loadGame(mapCam.sel)
end
elseif key=="escape"then
if mapCam.sel then
@@ -316,6 +328,8 @@ function keyDown.custom(key)
end
elseif key=="q"then
SCN.goto("sequence")
elseif key=="e"then
SCN.swapTo("draw")
elseif #key==1 then
local T=tonumber(key)
if T and T>=1 and T<=5 then
@@ -442,6 +456,8 @@ function keyDown.draw(key)
if sx and sy then
preField[sy][sx]=pen
end
elseif key=="e"then
SCN.swapTo("custom")
elseif key=="escape"then
SCN.back()
elseif key=="c"and kb.isDown("lctrl","rctrl")then

View File

@@ -71,6 +71,8 @@ local langList={
nowPlaying="正在播放:",
page="页面:",
ai_fixed="不能同时开启AI和固定序列",
ai_prebag="不能同时开启AI和自定义序列",
settingSaved="设置已保存",
settingSavingError="设置保存失败:",
keyMapSaved="键位设置已保存",
@@ -153,7 +155,6 @@ local langList={
},
staff={
"作者:MrZ 邮箱:1046101471@qq.com",
"",
"使用LOVE2D引擎",
"",
"程序:MrZ, FinnTenzor",
@@ -161,6 +162,7 @@ local langList={
"音乐:MrZ, (T0722)",
"音效:MrZ",
"语音:Miya, MrZ",
"官网:渣渣120",
"",
"特别感谢:",
"Flyz, Farter, 蕴空之灵,",
@@ -210,8 +212,8 @@ local langList={
set3="无尽(3)",
set4="隐形(4)",
set5="极限(5)",
seq="高级设置(q)",
draw="初始场地编辑",
seq="高级设置(Q)",
draw="初始场地编辑(E)",
back="返回",
},
sequence={
@@ -231,7 +233,7 @@ local langList={
demo="不显示×",
copy="复制",
paste="粘贴",
custom="参数",
custom="参数(E)",
back="返回",
},
play={
@@ -256,7 +258,6 @@ local langList={
quickR="快速重新开始",
swap="组合键切换攻击模式",
fine="极简操作提示音",
spawn="方块生成音",
back="返回",
},
setting_video={
@@ -284,10 +285,11 @@ local langList={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
bgm="音乐",
vib="震动",
voc="语音",
stereo="立体声",
back="返回",
},
setting_control={
@@ -517,6 +519,8 @@ local langList={
nowPlaying="正在播放:",
page="页面:",
ai_fixed="不能同时开启电脑玩家和固定序列",
ai_prebag="不能同时开启电脑玩家和自定义序列",
settingSaved="设置已保存",
settingSavingError="设置保存失败:",
keyMapSaved="键位设置已保存",
@@ -598,14 +602,14 @@ local langList={
},
staff={
"作者:MrZ 邮箱:1046101471@qq.com",
"",
"使用LOVE2D引擎",
"",
"程序:MrZ, FinnTenzor",
"美术:MrZ, (Gnyar)",
"美术:MrZ, (T0722, Gnyar)",
"音乐:MrZ, (T0722)",
"音效:MrZ",
"语音:Miya, MrZ",
"官网:渣渣120",
"",
"特别感谢:",
"Flyz, Farter, 蕴空之灵,",
@@ -655,8 +659,8 @@ local langList={
set3="无尽(3)",
set4="隐形(4)",
set5="极限(5)",
seq="高级设置(q)",
draw="初始场地编辑",
seq="高级设置(Q)",
draw="初始场地编辑(E)",
back="返回",
},
sequence={
@@ -701,7 +705,6 @@ local langList={
quickR="快速重新开始",
swap="组合键切换攻击模式",
fine="极简操作提示音",
spawn="方块生成音",
back="返回",
},
setting_video={
@@ -729,10 +732,11 @@ local langList={
game="←游戏设置",
graphic="画面设置→",
sfx="音效",
stereo="立体声",
spawn="方块生成",
bgm="音乐",
vib="震动",
voc="语音",
stereo="立体声",
back="返回",
},
setting_control={
@@ -962,6 +966,8 @@ local langList={
nowPlaying="Now Playing:",
page="Page:",
ai_fixed="AI is incompatible with fixed sequence",
ai_prebag="AI is incompatible with custom sequence",
settingSaved="Settings Saved",
settingSavingError="Failed to save settings:",
keyMapSaved="Key settings saved",
@@ -1040,7 +1046,6 @@ local langList={
},
staff={
"Author: MrZ E-mail: 1046101471@qq.com",
"",
"Powered by LOVE2D",
"",
"Program: MrZ, FinnTenzor",
@@ -1048,6 +1053,7 @@ local langList={
"Music: MrZ, (T0722)",
"Sound: MrZ",
"Voice: Miya, MrZ",
"Web: 渣渣120",
"",
"Special Thanks:",
"Flyz, Farter, 蕴空之灵,",
@@ -1089,8 +1095,8 @@ local langList={
set3="Inf. (3)",
set4="Blind (4)",
set5="Master (5)",
seq="Advanced(q)",
draw="Field Edit",
seq="Advanced(Q)",
draw="Field Edit(E)",
back="Back",
},
sequence={
@@ -1110,7 +1116,7 @@ local langList={
demo="Don't show ×",
copy="Copy",
paste="Paste",
custom="Args",
custom="Args(E)",
back="Back",
},
play={
@@ -1135,7 +1141,6 @@ local langList={
quickR="Quick Retry",
swap="Key Combination (Change Atk. Mode)",
fine="Finesse Error Sound",
spawn="Piece Spawning Sound",
back="Back",
},
setting_video={
@@ -1163,10 +1168,11 @@ local langList={
game="←Game",
graphic="Video→",
sfx="SFX",
stereo="Stereo",
spawn="Spawning",
bgm="BGM",
vib="Vibration",
voc="Voice",
stereo="Stereo",
back="Back",
},
setting_control={
@@ -1396,6 +1402,8 @@ local langList={
nowPlaying="~:",
page=":",
ai_fixed="X!!!",
ai_prebag="X!!!",
settingSaved="~~~",
settingSavingError="x!:",
keyMapSaved="~~~",
@@ -1474,7 +1482,6 @@ local langList={
},
staff={
"Author: MrZ E-mail: 1046101471@qq.com",
"",
"Powered by LOVE2D",
"",
"Program: MrZ, FinnTenzor",
@@ -1482,6 +1489,7 @@ local langList={
"Music: MrZ, (T0722)",
"Sound: MrZ",
"Voice: Miya, MrZ",
"Web: 渣渣120",
"",
"Special Thanks:",
"Flyz, Farter, 蕴空之灵,",
@@ -1523,8 +1531,8 @@ local langList={
set3="Inf. (3)",
set4="Blind (4)",
set5="Master (5)",
seq="Advanced(q)",
draw="Field Edit",
seq="Advanced(Q)",
draw="Field Edit(E)",
back="X",
},
sequence={
@@ -1544,7 +1552,7 @@ local langList={
demo="X ×",
copy="→__",
paste="__→",
custom="_?_",
custom="_?_(E)",
back="X",
},
play={
@@ -1596,10 +1604,11 @@ local langList={
game="←Game",
graphic="Video→",
sfx="#!#",
stereo="←~→",
spawn="#[]#",
bgm="#~#",
vib="=~=",
voc="~~~",
stereo="←~→",
back="X",
},
setting_control={

View File

@@ -29,13 +29,6 @@ local miniTitle_rect={
{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},
}
local function stencil_miniTitle()
for i=1,#miniTitle_rect do
local a,b,c,d=unpack(miniTitle_rect[i])
gc.rectangle("fill",250+a*30,150+b*30,c*30,d*30)
end
end
FX_attack={}--Attack beam
FX_badge={}--Badge thrown
local function drawAtkPointer(x,y)
@@ -116,30 +109,62 @@ function Pnt.load()
setFont(25)
mStr(S.tip,640,400)
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 T=sceneTemp
gc.stencil(stencil_miniTitle,"replace",1)
gc.setStencilTest("equal",1)
gc.setColor(1,1,1,min(T,80)*.005)
gc.push("transform")
gc.translate(250,150)
gc.scale(30)
gc.rectangle("fill",0,0,26,14)
gc.pop()
gc.setColor(1,1,1,.06)
for i=41,5,-2 do
gc.setLineWidth(i)
gc.line(200+(T-80)*25,130,(T-80)*25,590)
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
gc.setStencilTest()
if T>=80 then
gc.setColor(1,1,1,.5+sin((T-95)/30*3.142)*.5)
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.coloredTitleImage,60,30,nil,1.3)
gc.draw(IMG.title_color,60,30,nil,1.3)
setFont(30)
gc.print(gameVersion,70,125)
gc.print(system,610,100)
@@ -281,7 +306,7 @@ function Pnt.music()
for i=1,BGM.len do
gc.print(BGM.list[i],50,90+30*i)
end
gc.draw(IMG.titleImage,640,310,nil,1.5,nil,206,35)
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)
@@ -289,7 +314,7 @@ function Pnt.music()
local t=-Timer()%2.3/2
if t<1 then
gc.setColor(1,1,1,t)
gc.draw(IMG.coloredTitleImage,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
gc.draw(IMG.title_color,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
end
end
end
@@ -319,10 +344,10 @@ function Pnt.sequence()
setFont(30)
local bag=preBag
local len=#bag
setFont(40)
gc.print(len,120,300)
local L=TEXTURE.miniBlock
local x,y=120,126
local cx,cy=120,126
@@ -540,13 +565,28 @@ function Pnt.pause()
gc.push("transform")
gc.translate(1026,400)
--axes
--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
@@ -561,16 +601,6 @@ function Pnt.pause()
for i=1,6 do
mStr(C[i],_[2*i-1],_[2*i])
end
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)
_=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()
end
end
@@ -700,7 +730,7 @@ function Pnt.setting_skin()
gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5)
end
for i=1,6 do
gc.draw(blockSkin[11+i],1110,100+60*i,nil,2)
gc.draw(blockSkin[11+i],570+60*i,610,nil,2)
end
gc.draw(drawableText.setting_skin,80,50)
end
@@ -735,7 +765,7 @@ function Pnt.help()
end
setFont(19)
gc.print(text.used,30,330)
gc.draw(IMG.titleImage,280,610,.1,1+.05*sin(Timer()*2.6),nil,206,35)
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)
@@ -755,8 +785,8 @@ function Pnt.staff()
for i=1,#L do
mStr(L[i],640,800+80*i-t*40)
end
mDraw(IMG.coloredTitleImage,640,800-t*40,nil,2)
mDraw(IMG.coloredTitleImage,640,2160-t*40,nil,2)
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
@@ -799,7 +829,7 @@ function Pnt.stat()
gc.line(40,240+40*y,600,240+40*y)
end
gc.draw(IMG.titleImage,260,615,.2+.04*sin(Timer()*3),nil,nil,206,35)
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)

View File

@@ -1,7 +1,7 @@
local gc=love.graphics
local int,log=math.floor,math.log
local sin,cos=math.sin,math.cos
local max,format=math.max,string.format
local int,max,log=math.floor,math.max,math.log
local rnd,sin,cos=math.random,math.sin,math.cos
local format=string.format
local scr=scr
local SCN={
cur="load",--Current scene
@@ -32,12 +32,19 @@ function sceneInit.load()
#Modes,
1,
},
skip=false,--if skipping
skip=false,--If skipped
}
end
function sceneInit.intro()
BG.set("space")
sceneTemp=0--animation timer
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()
@@ -47,13 +54,13 @@ function sceneInit.main()
modeEnv={}
if not players[1]then
PLY.newDemoPlayer(1,900,35,1.1)
end--create demo player
end--Create demo player
end
function sceneInit.music()
if BGM.nowPlay then
for i=1,BGM.len do
if BGM.list[i]==BGM.nowPlay then
sceneTemp=i--music select
sceneTemp=i--Music selected
return
end
end
@@ -74,7 +81,7 @@ function sceneInit.mode(org)
end
end
function sceneInit.custom()
sceneTemp=1--option select
sceneTemp=1--Option selected
destroyPlayers()
BG.set(customRange.bg[customSel[12]])
BGM.play(customRange.bgm[customSel[13]])
@@ -128,19 +135,22 @@ function sceneInit.pause(org)
radar={
(S.off+S.dig)/S.time*60,--DefPM
(S.off)/S.time*60, --OffPM
S.atk/S.time*60, --AtkPM
S.send/S.time*60, --SendPM
S.piece/S.time*24, --LinePM
S.dig/S.time*60, --DigPM
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/40,1/60,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+(B[i]-1.26)*.26 end
end--normalize vals
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

View File

@@ -36,8 +36,8 @@ end
function SFX.fieldPlay(s,v,P)
SFX.play(s,v,(P.curX+P.sc[2]-6.5)*.15)
end
function SFX.play(s,v,pos)
if setting.sfx==0 then return end
function SFX.play(s,vol,pos,force)
if setting.sfx==0 and not force then return end
local S=SFX.list[s]--source list
if not S then return end
local n=1
@@ -58,7 +58,11 @@ function SFX.play(s,v,pos)
S:setPosition(0,0,0)
end
end
S:setVolume((v or 1)*setting.sfx*.1)
if not force then
S:setVolume((vol or 1)*setting.sfx*.1)
else
S:setVolume(vol*.1)
end
S:play()
end
function SFX.reset()

View File

@@ -7,7 +7,8 @@ return{
warning=N("warning"),
aura=N("aura"),
gradient1=N("grad1"),--Horizonal
gradient2=N("grad2"),--Vertical
gradient3=N("grad3"),--Oblique
gradient1=N("grad1"),--Horizonal red-blue gradient
gradient2=N("grad2"),--Vertical red-green gradient
rgb1=N("rgb1"),--colorful RGB
rgb2=N("rgb2"),--blue RGB
}

View File

@@ -5,6 +5,6 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
.8-x*.6,
.3+.2*sin(t),
.15+x*.7,
1
1.
);
}

View File

@@ -5,6 +5,6 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
.8-y*.6,
.2+y*.4,
.3+.1*sin(t),
1
1.
);
}

View File

@@ -6,6 +6,6 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
.8-y*.6-.2*sin(t/6.26),
.3+.1*sin(t),
.2+x*.6,
1
1.
);
}

View File

@@ -0,0 +1,11 @@
extern float t,w,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
return vec4(
.4-y*.3-.1*sin(t/6.26),
.2+.1*sin(t),
abs(.7-x*1.2+y*.5*sin(t/16.)),
1.
);
}

View File

@@ -55,8 +55,9 @@ function Tmr.load()
until not S.skip and Timer()-t>.01
end
function Tmr.intro()
sceneTemp=sceneTemp+1
if sceneTemp==200 then sceneTemp=80 end
local s=sceneTemp
s.t1=s.t1+1
s.t2=s.t2+1
end
function Tmr.main(dt)
players[1]:update(dt)

View File

@@ -32,7 +32,7 @@ function toTime(s)
end
end
function mStr(s,x,y)
gc.printf(s,x-400,y,800,"center")
gc.printf(s,x-450,y,900,"center")
end
function mText(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y)

View File

@@ -103,8 +103,13 @@ local Widgets={
quit= newButton(590,610,160,100,C.lightGrey, 45,function()VOC.play("bye")SCN.swapTo("quit","slowFade")end,nil,"play"),
},
mode={
setting=newButton(1100, 540,240,90,C.lightGreen, 40,function()SCN.goto("custom")end,function()return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle" end),
start= newButton(1040, 655,180,80,C.lightGrey, 40,function()if mapCam.sel then SCN.push()loadGame(mapCam.sel)end end,function()return not mapCam.sel end),
setting=newButton(1100, 540,240,90,C.lightGreen, 40,function()
SCN.goto("custom")
end,
function()
return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"
end),
start= newButton(1040, 655,180,80,C.lightGrey, 40,pressKey("return"),function()return not mapCam.sel end),
back= newButton(1200, 655,120,80,C.white, 40,BACK),
},
music={
@@ -126,8 +131,8 @@ local Widgets={
set4= newButton(940, 560,260,70, C.lightYellow, 32,pressKey("4")),
set5= newButton(940, 640,260,70, C.lightYellow, 32,pressKey("5")),
seq= newButton(665, 415,200,40, C.lightGreen, 30,function()SCN.goto("sequence")end),
draw= newButton(150, 80, 220,80, C.white, 35,function()SCN.swapTo("draw")end),
seq= newButton(665, 415,200,40, C.lightGreen, 30,pressKey("q")),
draw= newButton(150, 80, 220,80, C.white, 35,pressKey("e")),
back= newButton(1200, 640,120,120,C.white, 35,BACK),
},
sequence={
@@ -223,8 +228,7 @@ local Widgets={
end,nil,"quickR"),
quickR= newSwitch(1050,320,35, SETval("quickR"), SETrev("quickR"), nil,"swap"),
swap= newSwitch(1050,400,20, SETval("swap"), SETrev("swap"), nil,"fine"),
fine= newSwitch(1050,480,20, SETval("fine"), SETrev("fine"), nil,"spawn"),
spawn= newSwitch(1050,560,20, SETval("spawn"), SETrev("spawn"), nil,"back"),
fine= newSwitch(1050,480,20, SETval("fine"), SETrev("fine"), nil,"back"),
back= newButton(1140,650,200,80,C.white,40,BACK, nil,"graphic"),
},
setting_video={
@@ -259,13 +263,14 @@ local Widgets={
back= newButton(1140,650,200,80,C.white,40,BACK,nil,"sound"),
},
setting_sound={
game= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_video")end, nil,"sfx"),
sfx= newSlider(180,250,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"bgm"),
bgm= newSlider(750,250,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"),
vib= newSlider(180,440,400,5 ,28,function()VIB(2)end, SETval("vib"), SETsto("vib"), nil,"voc"),
voc= newSlider(750,440,400,10,32,function()VOC.play("nya")end, SETval("voc"), SETsto("voc"), nil,"stereo"),
stereo= newSlider(180,630,400,10,35,function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, SETval("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"),
game= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"graphic"),
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_video")end, nil,"sfx"),
sfx= newSlider(180,200,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"stereo"),
stereo= newSlider(180,500,400,10,35,function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, SETval("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"spawn"),
spawn= newSlider(180,300,400,10,30,function()SFX.play("spawn_1",setting.spawn,nil,true)end,SETval("spawn"), SETsto("spawn"),nil,"bgm"),
bgm= newSlider(180,400,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"),
vib= newSlider(750,200,400,5 ,28,function()VIB(2)end, SETval("vib"), SETsto("vib"), nil,"voc"),
voc= newSlider(750,300,400,10,32,function()VOC.play("nya")end, SETval("voc"), SETsto("voc"), nil,"back"),
back= newButton(1140,650,200,80,C.white,40,BACK,nil,"game"),
},
setting_control={
@@ -410,7 +415,7 @@ local Widgets={
help={
staff= newButton(980,500,150,80,C.white,32,function()SCN.goto("staff")end,nil,"his"),
his= newButton(1160,500,150,80,C.white,32,function()SCN.goto("history")end,nil,"qq"),
qq= newButton(980,600,150,80,C.white,32,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,mobileHide,"back"),
qq= newButton(1070,600,200,80,C.white,32,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,mobileHide,"back"),
back= newButton(640,600,200,80,C.white,40,BACK,nil,"staff"),
},
staff={

BIN
image/mess/title_new.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -1,6 +1,11 @@
--[[
Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game
______ __ _
/_ __/___ _____ / /_ ____ ___ (_)____ ____
/ / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \
/ / / __// /__ / / / // / / / / // // / / // /_/ /
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game
]]
--Global Setting & Vars
@@ -81,6 +86,9 @@ if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
--update data file
S=stat
if S.version=="Alpha V0.9.1"then
setting.spawn=0
end
if S.version~=gameVersion then
S.version=gameVersion
TEXT.show(text.newVersion,640,200,30,"fly",.3)

View File

@@ -34,7 +34,7 @@ return{
end
end
end,
bg="game3",bgm="push",
bg="game4",bgm="push",
},
pauseLimit=true,
load=function()

View File

@@ -23,7 +23,7 @@ return{
mStr(P.stat.row,-81,220)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -24,7 +24,7 @@ return{
mStr(P.stat.row,-81,220)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -22,7 +22,7 @@ return{
mStr(P.stat.row,-81,220)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -25,7 +25,7 @@ return{
mStr(P.stat.row,-81,220)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -12,7 +12,11 @@ return{
end
modeEnv._20G=modeEnv.drop==0
modeEnv.oncehold=customSel[6]==1
if preBag[1]then modeEnv.bag=preBag end
if preBag[1]then
modeEnv.bag=preBag
else
modeEnv.bag=nil
end
PLY.newPlayer(1,340,15)
local L=modeEnv.opponent
if L~=0 then

View File

@@ -37,7 +37,7 @@ return{
end
end
end,
bg="game3",bgm="way",
bg="game4",bgm="way",
},
pauseLimit=true,
load=function()

View File

@@ -113,8 +113,8 @@ return{
if L>=100 then
local T=P.stat.time
return
T<=70 and 5 or
T<=110 and 4 or
T<=90 and 5 or
T<=105 and 4 or
T<=160 and 3 or
T<=240 and 2 or
1

View File

@@ -18,7 +18,7 @@ local Timer=love.timer.getTime
local blockPos={4,4,4,4,4,5,4}
local scs={{1,2},{1,2},{1,2},{1,2},{1,2},{1.5,1.5},{0.5,2.5}}
-------------------------------------------------Cold clear
local CCblockID={4,3,5,6,1,2,0}
local CCblockID={4,3,6,5,1,2,0}
if system=="Windows"then
require("CCloader")
BOT={
@@ -73,7 +73,10 @@ if system=="Windows"then
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
P:newNext()
BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])
local id=CCblockID[P.next[P.AIdata.next].id]
if id then
BOT.addNext(P.AI_bot,id)
end
collectgarbage()
end
end
@@ -205,7 +208,15 @@ return{
end
local best={x=1,dir=0,hold=false,score=-1e99}
for ifhold=0,P.gameEnv.hold and 1 or 0 do
local bn=ifhold==0 and P.cur.id or P.hd and P.hd.id or P.next[1]and P.next[1].id
--Get block id
local bn
if ifhold==0 then
bn=P.cur and P.cur.id
else
bn=P.hd and P.hd.id or P.next[1]and P.next[1].id
end
if not bn then goto CTN end
for dir=0,dirCount[bn] do--each dir
local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos
@@ -229,8 +240,9 @@ return{
resetField(field_org,Tfield,cy)
end
end
::CTN::
end
if not best.bn then return 1 end
while #Tfield>0 do
freeRow.discard(rem(Tfield,1))
end--Release cache

View File

@@ -9,7 +9,6 @@ local s={
quickR=true,
swap=true,
fine=false,
spawn=false,
lang=1,
skinSet=1,
skin={1,5,8,2,10,3,7,1,5,1,5,8,2,10,3,7,10,7,8,2,8,2,1,5,3},
@@ -34,6 +33,7 @@ local s={
--sound
sfx=10,
spawn=0,
bgm=7,
stereo=6,
vib=0,

View File

@@ -67,23 +67,31 @@ function copyBoard()
TEXT.show(text.copySuccess,350,360,40,"appear",.5)
end
function pasteBoard()
local str=love.system.getClipboardText()
local _
local fX,fY=1,1--*ptr for Field(r*10+(c-1))
local _,Bid
--Read data
local str=love.system.getClipboardText()
local p=find(str,":")--ptr*
if p then str=sub(str,p+1)end
_,str=pcall(data.decode,"string","base64",str)
if not _ then goto ERROR end
_,str=pcall(data.decompress,"string","deflate",str)
if not _ then goto ERROR end
p=1
while true do
_=byte(str,p)--1byte
if not _ then
if fX~=1 then goto ERROR
else break
if fX~=1 then
goto ERROR
else
fY=fY+1
break
end
end--str end
__=_%32-1--block id
if __>17 then goto ERROR end--illegal blockid
_=int(_/32)--mode id
@@ -91,8 +99,9 @@ function pasteBoard()
if fX<10 then
fX=fX+1
else
if fY==20 then break end
fX=1;fY=fY+1
fY=fY+1
if fY>20 then break end
fX=1
end
p=p+1
end
@@ -215,7 +224,6 @@ function resumeGame()
SCN.swapTo("play","none")
end
function loadGame(M)
print(M)
--rec={}
stat.lastPlay=M
curMode=Modes[M]

View File

@@ -97,7 +97,7 @@ local TRS={
[13]={{ 0,-1},{ 0, 1},{ 1, 0}},
[31]={{ 0, 1},{ 0,-1},{-1, 0}},
},--J
{},--L
{},--L
{
[01]={{-1, 0},{-1, 1},{ 0,-2},{-1,-2},{-1,-1}},
[10]={{ 1, 0},{ 1,-1},{ 0, 2},{ 1, 2},{ 0,-1},{ 1, 1}},
@@ -152,10 +152,10 @@ local TRS={
[10]={{ 2, 0},{-1, 0},{-1,-2},{ 2, 1},{ 0, 2}},
[03]={{ 0, 1},{-1, 0},{ 2, 0},{ 2,-1},{-1, 2}},
[30]={{-2, 0},{ 1, 0},{ 1,-2},{-2, 1},{ 0, 2}},
[12]={{-1, 0},{ 2, 0},{-1, 2},{ 2,-1}},
[21]={{-2, 0},{ 1, 0},{ 1,-2},{-2, 1}},
[32]={{ 1, 0},{-2, 0},{ 1,-2},{-2,-1}},
[23]={{ 2, 0},{-1, 0},{-1,-2},{ 2, 1}},
[12]={{-1, 0},{ 2, 0},{ 0,-1},{-1, 2},{ 2,-1}},
[21]={{-2, 0},{ 1, 0},{ 0, 1},{ 1,-2},{-2, 1}},
[32]={{ 1, 0},{-2, 0},{ 0,-1},{ 1, 2},{-2,-1}},
[23]={{ 2, 0},{-1, 0},{ 0, 1},{-1,-2},{ 2, 1}},
[02]={{-1, 0},{ 1, 0},{ 0,-1},{ 0, 1}},
[20]={{ 1, 0},{-1, 0},{ 0, 1},{ 0,-1}},
[13]={{ 0,-1},{-1, 0},{ 1, 0},{ 0, 1}},

View File

@@ -1,4 +1,151 @@
snapLevelValue={1,10,20,40,60,80}
title={
{
53, 60,
1035, 0,
964, 218,
660, 218,
391, 1300,
231, 1154,
415, 218,
0, 218,
},
{
716, 290,
1429, 290,
1312, 462,
875, 489,
821, 695,
1148, 712,
1017, 902,
761, 924,
707, 1127,
1106, 1101,
1198, 1300,
465, 1300,
},
{
1516, 287,
2102, 290,
2036, 464,
1598, 465,
1322, 905,
1395, 1102,
1819, 1064,
1743, 1280,
1286, 1310,
1106, 902,
},
{
2179, 290,
2411, 290,
2272, 688,
2674, 666,
2801, 290,
3041, 290,
2693, 1280,
2464, 1280,
2601, 879,
2199, 897,
2056, 1280,
1828, 1280,
},
{
3123, 290,
3480, 290,
3496, 480,
3664, 290,
4017, 294,
3682, 1270,
3453, 1280,
3697, 578,
3458, 843,
3304, 842,
3251, 561,
3001, 1280,
2779, 1280,
},
{
4088, 290,
4677, 290,
4599, 501,
4426, 502,
4219, 1069,
4388, 1070,
4317, 1280,
3753, 1280,
3822, 1068,
3978, 1068,
4194, 504,
4016, 504,
},
{
4747, 290,
4978, 295,
4921, 464,
5186, 850,
5366, 290,
5599, 295,
5288, 1280,
5051, 1280,
5106, 1102,
4836, 709,
4641, 1280,
4406, 1280,
},
{
5814, 290,
6370, 295,
6471, 415,
6238, 1156,
6058, 1280,
5507, 1280,
5404, 1154,
5635, 416,
-- -- 5814, 290,
-- -- 5878, 463,
5770, 542,
5617, 1030,
5676, 1105,
5995, 1106,
6100, 1029,
6255, 541,
6199, 465,
5878, 463,
},
}
title2={}
for i=1,#title do title2[i]=title[i]end
title2[5]={
3123, 290,
3480, 290,
3496, 480,
3664, 290,
4017, 294,
3682, 1270,
3652, 1270,
3678, 1240,
3682, 1230,
3648, 1230,
3644, 1240,
3665, 1240,
3631, 1280,
3453, 1280,
3697, 578,
3458, 843,
3304, 842,
3251, 561,
3001, 1280,
2779, 1280,
}
for _,C in next,title do
for i=1,#C do
C[i]=C[i]*.1626
end
end
customID={
"drop","lock",
"wait","fall",

View File

@@ -787,7 +787,7 @@ local function Pdraw_small(P)
gc.push("transform")
gc.origin()
gc.setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1)
--Field
local F=P.field
for j=1,#F do
@@ -1313,8 +1313,8 @@ function player.resetBlock(P)
local id=C.id
local face=P.gameEnv.face[id]
local sc=scs[id][face]
P.sc=sc --spin center
P.dir=face --block direction
P.sc=sc --spin center
P.dir=face --block direction
P.r,P.c=#C.bk,#C.bk[1] --row/column
P.curX=int(6-P.c*.5)
local y=21+ceil(P.fieldBeneath/30)
@@ -1325,6 +1325,10 @@ function player.resetBlock(P)
P.curX=x
end
end--IMS
if P.human and id<8 then
SFX.play("spawn_"..id,setting.spawn,nil,true)
end
end
function player.hold(P,ifpre)
if not P.holded and (ifpre or P.waiting==-1) and P.gameEnv.hold then
@@ -1354,7 +1358,12 @@ function player.hold(P,ifpre)
if C then
P.cur=C
P.pieceCount=P.pieceCount+1
if P.AI_mode=="CC"then BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])end
if P.AI_mode=="CC"then
local next=P.next[P.AIdata.next]
if id then
BOT.addNext(P.AI_bot,CCblockID[next.id])
end
end
else
P.holded=false
end
@@ -1364,9 +1373,6 @@ function player.hold(P,ifpre)
P:freshgho()
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,max(P.freshTime-5,0)
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
if P.human and setting.spawn then
SFX.play("spawn_"..C.id)
end
end
if P.human then
@@ -1390,7 +1396,12 @@ function player.popNext(P)--pop next queue to hand
P:newNext()
if P.cur then
P.pieceCount=P.pieceCount+1
if P.AI_mode=="CC"then BOT.addNext(P.AI_bot,CCblockID[P.next[P.AIdata.next].id])end
if P.AI_mode=="CC"then
local next=P.next[P.AIdata.next]
if id then
BOT.addNext(P.AI_bot,CCblockID[next.id])
end
end
local _=P.keyPressing
if _[8]and P.gameEnv.hold and P.gameEnv.ihs then
P:hold(true)
@@ -1422,9 +1433,6 @@ function player.popNext(P)--pop next queue to hand
end
if _[6]then P.act.hardDrop(P)_[6]=false end--IHdS
if P.human and setting.spawn then
SFX.play("spawn_"..P.cur.id)
end
end
end
function player.drop(P)--Place piece
@@ -2588,7 +2596,7 @@ function PLY.newAIPlayer(id,x,y,size,AIdata)
ENV.face={0,0,0,0,0,0,0}
ENV.skin={1,5,8,2,10,3,7}
prepareSequence(P)
P.human=false
loadAI(P,AIdata)
end

View File

@@ -72,11 +72,19 @@ Future outlook:
0.9.2: Bug Fixed
new:
debug page
independent spawning volume setting
change:
three little better backgrounds instead of stupid rainbow
little change of in-game layout
kick list of i-piece little changed
no extremly huge radar chart in pause page
new in-game layout
new setting page layout
fixed:
error in infinite-dig
CC's sudden death sometimes
missing the top line when paste field
error when AI used all nexts
error when play default-bag game after played with custom sequence
0.9.1: Piece Spawn SFX
new: