Compare commits

...

1 Commits

Author SHA1 Message Date
MrZ_26
a31474c43a Alpha V0.7.9 2020-02-04 19:31:45 +08:00
18 changed files with 877 additions and 522 deletions

BIN
BGM/secret7th.ogg Normal file

Binary file not shown.

BIN
BGM/secret8th.ogg Normal file

Binary file not shown.

4
ai.lua
View File

@@ -125,7 +125,7 @@ end
function AI_getControls(ctrl)
local Tfield={}--test field
local field_org=P.field
for i=1,#field_org do
for i=1,#field_org do
Tfield[i]=getNewRow()
for j=1,10 do
Tfield[i][j]=field_org[i][j]
@@ -133,7 +133,7 @@ function AI_getControls(ctrl)
end
local best={x=1,dir=0,hold=false,score=-9e99}
for ifhold=0,P.gameEnv.hold and 1 or 0 do
local bn=ifhold==0 and P.bn or P.hn>0 and P.hn or P.nxt[1]
local bn=ifhold==0 and P.bid or P.hid>0 and P.hid or P.nxt[1]
for dir=0,dirCount[bn] do--each dir
local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos

Binary file not shown.

BIN
allph.ttf Normal file

Binary file not shown.

View File

@@ -364,7 +364,7 @@ function love.touchmoved(id,x,y,dx,dy)
local x,y=xOy:inverseTransformPoint(tc.getPosition(l[i]))
if(x-b[1])^2+(y-b[2])^2<=b[3]then return end
end
if players[1].isKeyDown[n]then
if P.keyPressing[n]then
releaseKey(n,players[1])
end
end
@@ -381,7 +381,10 @@ end
function love.keypressed(i)
if i=="f12"then devMode=not devMode end
if devMode then
if i=="q"then
if i=="k"then
P=players.alive[rnd(#players.alive)]
Event.gameover.lose()
elseif i=="q"then
for i=1,#Buttons[scene]do
local B=Buttons[scene][i]
print(format("x=%d,y=%d,w=%d,h=%d",B.x,B.y,B.w,B.h))
@@ -459,7 +462,9 @@ function love.update(dt)
for i=1,#Buttons[scene]do
Buttons[scene][i].alpha=0
end--Reset buttons' state
game[sceneSwaping.tar]()
scene=sceneSwaping.tar
BGM("blank")
sceneInit[scene]()
Buttons.sel=nil
elseif sceneSwaping.time==0 then
sceneSwaping=nil
@@ -528,7 +533,7 @@ function love.run()
local frameT=Timer()
local readyDrawFrame=0
love.resize(gc.getWidth(),gc.getHeight())
game.load()--System scene Launch
scene="load"sceneInit.load()--System Launch
math.randomseed(os.time()*626)
return function()
love.event.pump()

View File

@@ -9,7 +9,7 @@ function love.conf(t)
t.audio.mixwithsystem=true--Switch on to keep sysBGM
local W=t.window
W.title="Techmino V0.7.8"
W.title="Techmino V0.7.9"
W.icon="/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360

View File

@@ -1,6 +1,6 @@
function loadGame(mode,level)
--rec={}
curMode={id=modeID[mode],lv=level,modeName=modeName[mode],levelName=modeLevel[modeID[mode]][level]}
curMode={id=modeID[mode],lv=level,modeName=text.modeName[mode],levelName=modeLevel[modeID[mode]][level]}
gotoScene("play")
end
function resetGameData()
@@ -11,6 +11,7 @@ function resetGameData()
players={alive={}}
modeEnv=defaultModeEnv[curMode.id][curMode.lv]or defaultModeEnv[curMode.id][1]
loadmode[curMode.id]()
curBG=modeEnv.bg
BGM(modeEnv.bgm)
FX.beam={}
@@ -39,7 +40,7 @@ function resetGameData()
freeRow={}
collectgarbage()
for i=1,40*#players do
for i=1,30*#players do
freeRow[i]={0,0,0,0,0,0,0,0,0,0}
end
end
@@ -105,7 +106,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
end
end--reset current game settings
P.hn,P.hb,P.holded=0,{{}},false
P.hid,P.hc,P.hb,P.holded=0,0,{{}},false
P.nxt,P.nb={},{}
P.dropDelay,P.lockDelay=P.gameEnv.drop,P.gameEnv.lock
P.freshTime=0
@@ -144,7 +145,7 @@ function createPlayer(id,x,y,size,AIspeed,data)
end
P.showTime=P.gameEnv.visible==1 and 1e99 or P.gameEnv.visible==2 and 300 or 20
P.cb,P.sc,P.bn,P.r,P.c,P.cx,P.cy,P.dir,P.y_img={{}},{0,0},1,0,0,0,0,0,0
P.cb,P.sc,P.bid,P.r,P.c,P.cx,P.cy,P.dir,P.y_img={{}},{0,0},1,0,0,0,0,0,0
P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end
P.moving,P.downing=0,0
P.waiting,P.falling=0,0
@@ -220,7 +221,7 @@ function throwBadge(S,R,amount)--Player id
if R.small then
x2,y2=R.x+30*R.size,R.y+60*R.size
else
x2,y2=R.x+73*R.size,R.y+360*R.size
x2,y2=R.x+73*R.size,R.y+345*R.size
end
ins(FX.badge,{x1,y1,x2,y2,t=0,size=(9+min(amount,12))*.1})
end
@@ -268,16 +269,6 @@ function changeAtk(P,R)
P.atking=nil
end
end
function freshMostBadge()
mostBadge,secBadge=nil
local m=0
for i=1,#players.alive do
if players.alive[i].badge>=m then
mostBadge,secBadge=players.alive[i],mostBadge
m=players.alive[i].badge
end
end
end
function freshMostDangerous()
mostDangerous,secDangerous=nil
local m=0
@@ -292,7 +283,7 @@ function royaleLevelup()
gameStage=gameStage+1
local spd
if(gameStage==3 or gameStage>4)and players[1].alive then
showText(players[1],#players.alive.." Players Remain","beat",50,-100,.3)
showText(players[1],text.royale_remain(#players.alive),"beat",50,-100,.3)
end
if gameStage==2 then
spd=30
@@ -339,7 +330,7 @@ function freshgho()
end
end
function freshLockDelay()
if P.lockDelay<P.gameEnv.lock then
if P.lockDelay<P.gameEnv.lock or P.cy==P.y_img then
if P.freshTime<=P.gameEnv.freshLimit then
P.lockDelay=P.gameEnv.lock
end
@@ -383,11 +374,12 @@ end
function resetblock()
P.holded=false
P.spinLast=false
P.bn,P.cb=rem(P.nxt,1),rem(P.nb,1)
P.bid,P.cb=rem(P.nxt,1),rem(P.nb,1)--block id/current block
P.bc=P.bid--block color
P.freshNext()
P.sc,P.dir=scs[P.bn][0],0
P.r,P.c=#P.cb,#P.cb[1]
P.cx,P.cy=blockPos[P.bn],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
P.sc,P.dir=scs[P.bid][0],0--spin center/direction
P.r,P.c=#P.cb,#P.cb[1]--row/column
P.cx,P.cy=blockPos[P.bid],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
P.dropDelay,P.lockDelay,P.freshTime=P.gameEnv.drop,P.gameEnv.lock,0
if P.keyPressing[8]then hold(true)end
@@ -414,7 +406,7 @@ function pressKey(i,p)
if i==10 then
act.restart()
elseif P.alive then
if P.control and P.waiting<=0 then
if P.control and P.waiting<=0 then
act[actName[i]]()
if i>2 and i<7 then P.keyPressing[i]=false end
elseif P.keyPressing[9]then
@@ -448,20 +440,57 @@ function releaseKey(i,p)
end
function spin(d,ifpre)
local idir=(P.dir+d)%4
if P.bn==6 then
if P.bid==6 then
freshLockDelay()
SFX(ifpre and"prerotate"or"rotate")
if P.id==1 then
stat.rotate=stat.rotate+1
if P.gameEnv.ospin and P.freshTime>10 then
if d==1 then
if P.cy==P.y_img and solid(P.cx+2,P.cy+1)and solid(P.cx+2,P.cy)and solid(P.cx-1,P.cy+1)and not solid(P.cx-1,P.cy)then
if solid(P.cx-2,P.cy)then
P.cx=P.cx-1
goto T
else
P.cx=P.cx-2
goto I
end
end
elseif d==-1 then
if P.cy==P.y_img and solid(P.cx-1,P.cy+1)and solid(P.cx-1,P.cy)and solid(P.cx+2,P.cy+1)and not solid(P.cx+2,P.cy)then
if solid(P.cx+3,P.cy)then
goto T
else
goto I
end
end
elseif d==2 and P.cy==P.y_img and solid(P.cx-1,P.cy+1)and solid(P.cx+2,P.cy+1)and not solid(P.cx-1,P.cy)and not solid(P.cx+2,P.cy)then
P.cx=P.cx-1
goto I
end
goto E
::T::
P.bid=5
P.cb=blocks[5][0]
P.sc=scs[5][0]
P.r,P.c,P.dir=2,3,0
P.spinLast=3
if P.id==1 then stat.rotate=stat.rotate+1 end
goto E
::I::
P.bid=7
P.cb=blocks[7][2]
P.sc=scs[7][2]
P.r,P.c,P.dir=1,4,2
P.spinLast=3
if P.id==1 then stat.rotate=stat.rotate+1 end
end
return
end
local icb=blocks[P.bn][idir]
local isc=scs[P.bn][idir]
::E::return
end
local icb=blocks[P.bid][idir]
local isc=scs[P.bid][idir]
local ir,ic=#icb,#icb[1]
local ix,iy=P.cx+P.sc[2]-isc[2],P.cy+P.sc[1]-isc[1]
local t--succssful test
local iki=TRS[P.bn][P.dir*10+idir]
local iki=TRS[P.bid][P.dir*10+idir]
for i=1,P.freshTime<=1.2*P.gameEnv.freshLimit and #iki or 1 do
if not ifoverlap(icb,ix+iki[i][1],iy+iki[i][2])then
ix,iy=ix+iki[i][1],iy+iki[i][2]
@@ -471,7 +500,7 @@ function spin(d,ifpre)
end
if t then
P.cx,P.cy,P.dir=ix,iy,idir
P.sc,P.cb=scs[P.bn][idir],icb
P.sc,P.cb=scs[P.bid][idir],icb
P.r,P.c=ir,ic
P.spinLast=testScore[t==2 and -d or d]
freshgho()
@@ -484,13 +513,17 @@ function spin(d,ifpre)
end
function hold(ifpre)
if not P.holded and P.waiting<=0 and P.gameEnv.hold then
P.hn,P.bn=P.bn,P.hn
P.hb,P.cb=blocks[P.hn][0],P.hb
P.hid,P.bid,P.bc=P.bid,P.hid,P.hid
P.hb,P.cb=blocks[P.hid][0],P.hb
if P.bn==0 then P.bn,P.cb=rem(P.nxt,1),rem(P.nb,1)P.freshNext()end
P.sc,P.dir=scs[P.bn][0],0
if P.bid==0 then
P.bid,P.cb=rem(P.nxt,1),rem(P.nb,1)
P.bc=P.bid
P.freshNext()
end
P.sc,P.dir=scs[P.bid][0],0
P.r,P.c=#P.cb,#P.cb[1]
P.cx,P.cy=blockPos[P.bn],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
P.cx,P.cy=blockPos[P.bid],21+ceil(P.fieldBeneath/30)-P.r+min(int(#P.field*.2),2)
if abs(P.moving)-P.gameEnv.das>1 then
if not ifoverlap(P.cb,P.cx+sgn(P.moving),P.cy)then
@@ -514,7 +547,7 @@ function drop()
P.waiting=P.gameEnv.wait
local dospin=0
if P.spinLast then
if P.bn<6 then
if P.bid<6 then
local x,y=P.cx+P.sc[2]-1,P.cy+P.sc[1]-1
local c=0
if solid(x-1,y+1)then c=c+1 end
@@ -527,7 +560,7 @@ function drop()
end
end
end--Three point
if P.bn~=6 and ifoverlap(P.cb,P.cx-1,P.cy)and ifoverlap(P.cb,P.cx+1,P.cy)and ifoverlap(P.cb,P.cx,P.cy+1)then
if P.bid~=6 and ifoverlap(P.cb,P.cx-1,P.cy)and ifoverlap(P.cb,P.cx+1,P.cy)and ifoverlap(P.cb,P.cx,P.cy+1)then
dospin=dospin+2
end--Immobile
end
@@ -546,22 +579,22 @@ function drop()
elseif dospin<2 then
dospin=false
elseif dospin==2 then
mini=P.bn<6 and cc<3 and cc<P.r
mini=P.bid<6 and cc<3 and cc<P.r
end
P.combo=P.combo+1--combo=0 is under
if cc==4 then
if P.b2b>480 then
showText(P,"Techrash B2B2B","fly",70)
showText(P,text.techrashB3B,"fly",70)
csend=6
sendTime=100
exblock=exblock+1
elseif P.b2b>=30 then
showText(P,"Techrash B2B","drive",70)
showText(P,text.techrashB2B,"drive",70)
sendTime=80
csend=5
else
showText(P,"Techrash","stretch",80)
showText(P,text.techrash,"stretch",80)
sendTime=60
csend=4
end
@@ -571,39 +604,39 @@ function drop()
elseif cc>0 then
if dospin then
if P.b2b>480 then
showText(P,spinName[cc][P.bn].." B2B2B","spin",40)
showText(P,text.spin[P.bc]..text.clear[cc]..text.b3b,"spin",40)
csend=b2bATK[cc]+1
exblock=exblock+1
elseif P.b2b>=30 then
showText(P,spinName[cc][P.bn].." B2B","spin",40)
showText(P,text.spin[P.bc]..text.clear[cc]..text.b2b,"spin",40)
csend=b2bATK[cc]
else
showText(P,spinName[cc][P.bn],"spin",50)
showText(P,text.spin[P.bc]..text.clear[cc],"spin",50)
csend=2*cc
end
sendTime=20+csend*20
if mini then
showText(P,"Mini","drive",40,10)
showText(P,text.mini,"drive",40,10)
csend=ceil(csend*.5)
sendTime=sendTime+60
P.b2b=P.b2b+b2bPoint[cc]*.8
else
P.b2b=P.b2b+b2bPoint[cc]
end
P.lastClear=P.bn*10+cc
P.lastClear=P.bid*10+cc
if P.id==1 then
stat.spin=stat.spin+1
end
SFX(spin_n[cc])
elseif #P.clearing<#P.field then
P.b2b=P.b2b-150-cc*50
showText(P,clearName[cc],"appear",50)
showText(P,text.clear[cc],"appear",25+cc*5)
csend=cc-1
sendTime=20+csend*20
P.lastClear=cc
end
if #P.clearing==#P.field then
showText(P,"Perfect Clear","flicker",70,-80)
showText(P,text.PC,"flicker",70,-80)
csend=csend+min(6+P.cstat.pc,10)
exblock=exblock+2
sendTime=sendTime+30
@@ -611,13 +644,13 @@ function drop()
P.b2b=600
end
P.cstat.pc=P.cstat.pc+1
P.lastClear=P.bn*10+5
P.lastClear=P.bid*10+5
SFX("perfectclear")
end
else
P.combo=0
if dospin then
showText(P,spinName[0][P.bn],"appear",50)
showText(P,text.spin[P.bc],"appear",50)
SFX("spin_0")
P.b2b=P.b2b+15
end
@@ -625,7 +658,7 @@ function drop()
csend=csend+(renATK[P.combo]or 4)
if P.combo>2 then
showText(P,renName[min(P.combo,20)],P.combo<10 and"appear"or"flicker",20+P.combo*3,60)
showText(P,text.cmb[min(P.combo,20)],P.combo<10 and"appear"or"flicker",20+P.combo*3,60)
end
sendTime=sendTime+20*P.combo
if cc>0 then
@@ -657,7 +690,7 @@ function drop()
if csend>0 then
showText(P,csend,"zoomout",25,70)
if exblock>0 then
showText(P,exblock,"zoomout",10,70)
showText(P,exblock,"zoomout",10,90)
end
end
::L::
@@ -718,7 +751,7 @@ function lock()
if not P.field[y]then P.field[y],P.visTime[y]=getNewRow(),getNewRow()end
for j=1,P.c do
if P.cb[i][j]~=0 then
P.field[y][P.cx+j-1]=P.bn
P.field[y][P.cx+j-1]=P.bc
P.visTime[y][P.cx+j-1]=P.showTime
end
end
@@ -818,18 +851,22 @@ act={
end,
insDown=function()if P.cy~=P.y_img then P.cy,P.lockDelay,P.spinLast=P.y_img,P.gameEnv.lock,false end end,
insLeft=function()
local x0=cx
::L::if not ifoverlap(P.cb,P.cx-1,P.cy)then
P.cx,P.lockDelay=P.cx-1,P.gameEnv.lock
P.cx=P.cx-1
freshgho()
goto L
end
if x0~=cx then freshLockDelay()end
end,
insRight=function()
local x0=cx
::L::if not ifoverlap(P.cb,P.cx+1,P.cy)then
P.cx,P.lockDelay=P.cx+1,P.gameEnv.lock
P.cx=P.cx+1
freshgho()
goto L
end
if x0~=cx then freshLockDelay()end
end,
down1=function()
if P.cy~=P.y_img then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

161
language/chi.lua Normal file
View File

@@ -0,0 +1,161 @@
return{
royale_remain=function(n)
return "剩余 "..n.." 名玩家"
end,
cmb={nil,nil,"3连击","4连击","5连击","6连击","7连击","8连击","9连击","10连击!","11连击!","12连击!","13连击!","14连击!","15连击!","16连击!","17连击!","18连击!","19连击!","巨型连击"},
techrash="四清",
techrashB2B="四清 B2B",
techrashB3B="四清 B2B2B",
block={"Z","S","L","J","T","O","I"},
spin={"Z旋","S旋","L旋","J旋","T旋","O旋","I旋"},
clear={"单消","双消","三清"},
b2b="B2B",
b3b="B2B2B",
mini="次级",
PC="场地全清",
stage={"关卡 1","关卡 2","关卡 3","关卡 4","关卡 5",},
maxspeed="最高速度",
speedup="速度加快",
win="胜利",
lose="失败",
custom="自定义游戏",
softdropdas="软降DAS:",
softdroparr="软降ARR:",
keyboard="键盘",
joystick="手柄",
setting2Help="方向键选择/翻页,回车修改,esc返回",
actName={"左移:","右移:","顺时针旋转:","顺时针旋转:","180°旋转","硬降:","软降:","暂存:","切换攻击:","重新开始:","左瞬移:","右瞬移:","软降到底:"},
modeName={
[0]="自定义",
"竞速","马拉松","","无尽","单挑","仅TSD","隐形","挖掘","生存","科研",
"全清训练","全清挑战","41人混战","99人混战","干旱","多人",
},
modeInfo={
sprint="挑战世界纪录",
marathon="尝试坚持到最后",
zen="无重力消除200行",
infinite="科研沙盒",
solo="打败AI",
tsd="尽可能做T旋消2",
blind="最强大脑",
dig="核能挖掘机",
survivor="防守练习",
tech="ALLSPIN练习",
pctrain="熟悉全清定式的组合",
pcchallenge="100行内尽可能多全清",
techmino41="41人混战",
techmino99="99人混战",
drought="异常序列",
hotseat="友尽模式",
},
loadTip="真在加载,不只是动画!",
load={"加载材质ing","加载音乐ing","加载音效ing","加载完成",},
tips={
"The whole game is made by MrZ!",
"Back to Back 10 combo Techrash PC!",
"Techmino has a Nspire-CX edition!",
"Is B2B2B2B possible?",
"MrZ spin Penta!",
"MEGACMB!",
"ALLSPIN!",
"O spin Techrash?"
},
stat={
"游戏运行次数:",
"游戏局数:",
"游戏时间:",
"总方块使用:",
"总消行数:",
"总攻击行数:",
"总按键数:",
"总旋转数:",
"暂存次数:",
"总旋转消行数:",
},
help={
"好像也没啥好帮助的吧?就当是关于了",
"这只是一个方块游戏,请勿过度解读和随意联想",
"不过就当成TOP/C2/KOS/TGM3玩好了",
"游戏还在测试阶段,请 勿 外 传",
"",
"使用LOVE2D引擎",
"作者:MrZ 邮箱:1046101471@qq.com",
"程序:MrZ 美术:MrZ 音乐:MrZ 音效:MrZ",
"使用工具:VScode,GFIE,Beepbox,Goldwave",
"特别感谢:Farter,Teatube,196,Flyz,T830,[所有测试人员]和 你!",
"错误或者建议请附带相关信息发送到作者邮箱~",
},
ButtonText={
main={
"开始",
"设置",
"帮助",
"统计信息",
"退出",
},
mode={
"Λ",
"v",
"<",
">",
"开始",
"自定义(C)",
"返回",
},
custom={
"Λ",
"v",
"<",
">",
"开始",
"返回",
},
setting={
function()return setting.ghost and"阴影 开"or"阴影 关"end,
function()return setting.center and"旋转中心 开"or"旋转中心 关"end,
"-",
"+",
"-",
"+",
"-",
"+",
"-",
"+",
function()return setting.sfx and"音效 开"or"音效 关"end,
function()return setting.bgm and"音乐 开"or"音乐 关"end,
function()return "震动强度:"..setting.vib end,
function()return setting.fullscreen and"全屏 开"or"全屏 关"end,
function()return setting.bgblock and"背景动画 开"or"背景动画 关"end,
function()return"绘制帧:"..setting.frameMul.."%"end,
"控制设置",
"触摸设置",
function()return langName[setting.lang]end,
"保存&返回",
},
setting2={
"返回",
},
setting3={
"返回",
function()return setting.virtualkeySwitch and"隐藏虚拟按键"or"显示虚拟按键"end,
"默认组合",
function()return snapLevelName[snapLevel]end,
function()return percent0to5[setting.virtualkeyAlpha]end,
"图标",
"大小",
},
help={
"返回",
"作者QQ",
},
stat={
"返回",
},
},
}--中文→

161
language/eng.lua Normal file
View File

@@ -0,0 +1,161 @@
return{
royale_remain=function(n)
return n.." Players Remain"
end,
cmb={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"},
techrash="Techrash",
techrashB2B="Techrash B2B",
techrashB3B="Techrash B2B2B",
block={"Z","S","L","J","T","O","I"},
spin={"Z spin","S spin","L spin","J spin","T spin","O spin","I spin"},
clear={" single"," double"," triple"},
b2b=" B2B",
b3b=" B2B2B",
mini="Mini",
PC="Perfect Clear",
stage={"STAGE 1","STAGE 2","STAGE 3","STAGE 4","STAGE 5",},
maxspeed="Max speed",
speedup="Speed up",
win="WIN",
lose="LOSE",
custom="Custom Game",
softdropdas="softdropDAS:",
softdroparr="softdropARR:",
keyboard="Keyboard",
joystick="Joystick",
setting2Help="Arrowkey to select/change slot,Enter to change,Esc back",
actName={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip:","Hard Drop:","Soft Drop:","Hold:","Swap:","Restart:","Instant Left:","Instant Right:","Ins Down:"},
modeName={
[0]="Custom",
"Sprint","Marathon","Zen","Infinite","1v1","TSD-only","Blind","Dig","Survivor","Tech",
"PC Train","PC Challenge","Techmino41","Techmino99","Drought","Hotseat",
},
modeInfo={
sprint="Speed run",
marathon="Survive and reach target",
zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness",
solo="Beat AI",
tsd="Make more T-spin-doubles",
blind="Invisible board",
dig="Downstack!",
survivor="Hand them!",
tech="Techniques practice",
pctrain="Let's learn some PCs",
pcchallenge="Make PCs in 100 Lines",
techmino41="Melee fight with 40 AIs",
techmino99="Melee fight with 98 AIs",
drought="ERRSEQ flood attack",
hotseat="",
},
loadTip="not animation,real loading!",
load={"Loading textures","Loading BGM","Loading SFX","Finished",},
tips={
"The whole game is made by MrZ!",
"Back to Back 10 combo Techrash PC!",
"Techmino has a Nspire-CX edition!",
"Is B2B2B2B possible?",
"MrZ spin Penta!",
"MEGACMB!",
"ALLSPIN!",
"O spin Techrash?"
},
stat={
"Games run:",
"Games played:",
"Game time:",
"Total block used:",
"Total rows cleared:",
"Total lines sent:",
"Total key pressed:",
"Total rotate:",
"Total hold:",
"Total spin:",
},
help={
"I think you don't need \"help\".",
"THIS IS ONLY A SMALL BLOCK GAME",
"But just play like playing TOP/C2/KOS/TGM3",
"Game is not public now,so DO NOT DISTIRBUTE",
"",
"Powered by LOVE2D",
"Author:MrZ E-mail:1046101471@qq.com",
"Programe:MrZ Art:MrZ Music:MrZ SFX:MrZ",
"Tool used:VScode,GFIE,Beepbox,Goldwave",
"Special thanks:Farter,Teatube,196,Flyz,T830,[all test staff] and YOU!",
"Any bugs/suggestions to my E-mail.",
},
ButtonText={
main={
"Play",
"Settings",
"Help",
"Statistics",
"Quit",
},
mode={
"Λ",
"v",
"<",
">",
"Start",
"Custom(C)",
"Back",
},
custom={
"Λ",
"v",
"<",
">",
"Start",
"Back",
},
setting={
function()return setting.ghost and"Ghost:ON"or"Ghost:OFF"end,
function()return setting.center and"Center:ON"or"Center:OFF"end,
"-",
"+",
"-",
"+",
"-",
"+",
"-",
"+",
function()return setting.sfx and"SFX:on"or"SFX:off"end,
function()return setting.bgm and"BGM:on"or"BGM:off"end,
function()return "Vibrate level:"..setting.vib end,
function()return setting.fullscreen and"Fullscreen:on"or"Fullscreen:off"end,
function()return setting.bgblock and"BG animation:on"or"BG animation:off"end,
function()return"FrameDraw:"..setting.frameMul.."%"end,
"Control settings",
"Touch settings",
function()return langName[setting.lang]end,
"Save&Back",
},
setting2={
"Back",
},
setting3={
"Back",
function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,
"Defaults",
function()return snapLevelName[snapLevel]end,
function()return percent0to5[setting.virtualkeyAlpha]end,
"Icon",
"Size",
},
help={
"Back",
"Author's qq",
},
stat={
"Back",
},
}
}

475
list.lua
View File

@@ -1,6 +1,6 @@
--[["four name"
Techrash
Zestris
x Zestris
x Quadruple
x Tequeno
x Techzino
@@ -20,7 +20,7 @@ PCbase={
{5,5,2,2,0,0,0,6,6,4},
{5,2,2,0,0,0,0,4,4,4},
}
PClist={--ZSLJTOI
PClist={
{7,7,4,5},{7,7,6,4},{7,7,2,4},{7,7,1,3},{7,7,5,6},{7,7,5,2},{7,7,5,4},{7,7,5,3},
{7,4,1,2},{7,3,5,7},{7,5,4,3},{7,5,1,2},{7,1,4,2},{7,4,2,5},{7,6,4,5},{7,5,4,2},
{7,5,6,4},{7,5,3,6},{7,2,5,6},{7,2,6,4},{7,2,1,3},{7,5,2,7},{7,5,7,2},{7,5,2,3},
@@ -61,14 +61,14 @@ color={
}
attackColor={
{color.red,color.yellow},
{color.red,color.purple},
{color.purple,color.white},
{color.blue,color.white},
animate={
function(t)
gc.setColor(1,t,0)
end,
function(t)
gc.setColor(1,.5+t*.5,.5+t*.5)
gc.setColor(1,.5+t*.5,1)
end,
function(t)
gc.setColor(.2+t*.8,.2+t*.8,1)
@@ -82,7 +82,6 @@ frameColor={
color.purple,
color.orange,
}
blockName={"Z","S","L","J","T","O","I"}
blockColor={
color.red,
color.green,
@@ -92,17 +91,6 @@ blockColor={
color.yellow,
color.cyan,
}
clearName={"Single","Double","Triple"}
spinName={[0]={}}
for j=1,7 do
spinName[0][j]=blockName[j].." spin"
end
for i=1,3 do
spinName[i]={}
for j=1,7 do
spinName[i][j]=blockName[j].." spin "..clearName[i]
end
end
miniTitle_rect={
{2,0,5,1},{4,1,1,6},
@@ -138,6 +126,8 @@ bgm={
"infinite",
"cruelty",
"final",
"secret7th",
"secret8th",
}
prevMenu={
@@ -213,11 +203,11 @@ customRange={
opponent={0,60,30,20,15,10,7,5,4,3,2,1},
}
langName={"中文","English"}
langID={"chi","eng"}
actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","swap","restart","insLeft","insRight","insDown"}
actName_show={"Move Left:","Move Right:","Rotate Right:","Rotate Left:","Rotate Flip","Hard Drop:","Soft Drop:","Hold:","Swap:","Restart:","Instant Left:","Instant Right:","Ins Down:"}
blockPos={4,4,4,4,4,5,4}
renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else
renName={nil,nil,"3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB",}
b2bPoint={50,90,150}
b2bATK={3,5,8}
testScore={[0]=0,[-1]=1,[-2]=0,[-3]=1,2,2,2}
@@ -226,10 +216,6 @@ spin_n={"spin_1","spin_2","spin_3"}
clear_n={"clear_1","clear_2","clear_3","clear_4"}
ren_n={"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","ren_10","ren_11"}
vibrateLevel={0,.02,.03,.04,.06,.08,.1}
atkModeName={"Random","Badges","K.O.s","Counters"}
up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
percent0to5={[0]="0%","20%","40%","60%","80%","100%",}
snapLevelName={"Free pos","Snap-10","Snap-20","Snap-40","Snap-60","Snap-80"}
snapLevelValue={1,10,20,40,60,80}
reAtk={0,0,1,1,1,2,2,3,3}
reDef={0,1,1,2,3,3,4,4,5}
@@ -245,51 +231,64 @@ pc_drop={50,45,40,35,30,26,22,18,15,12}
pc_lock={55,50,45,40,36,32,30}
pc_fall={18,16,14,12,10,9,8,7,6}
atkModeName={"Random","Badges","K.O.s","Counters"}
up0to4={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
percent0to5={[0]="0%","20%","40%","60%","80%","100%",}
snapLevelName={"Free pos","Snap-10","Snap-20","Snap-40","Snap-60","Snap-80"}
defaultModeEnv={
sprint={
{
drop=60,
target=10,
reach=Event.gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=20,
reach=Event.gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=40,
reach=Event.gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=100,
reach=Event.gameover.win,
bg="strap",
bgm="race",
},
{
drop=60,
target=400,
reach=Event.gameover.win,
bg="strap",
bgm="push",
},
{
drop=60,
target=1000,
reach=Event.gameover.win,
bg="strap",
bgm="push",
},
},
marathon={
{
drop=1e99,
lock=1e99,
drop=60,
lock=60,
fall=30,
target=200,
reach=Event.marathon_reach,
bg="strap",
bgm="way",
},
{
@@ -297,14 +296,16 @@ defaultModeEnv={
fall=20,
target=10,
reach=Event.marathon_reach,
bg="strap",
bgm="way",
},
{
_20G=true,
fall=20,
fall=15,
target=200,
reach=Event.marathon_reach,
bgm="newera",
bg="strap",
bgm="race",
},
{
_20G=true,
@@ -315,7 +316,8 @@ defaultModeEnv={
target=50,
reach=Event.marathon_reach_lunatic,
arr=2,
bgm="race",
bg="game2",
bgm="secret8th",
},
{
_20G=true,
@@ -324,9 +326,10 @@ defaultModeEnv={
wait=death_wait[1],
fall=death_fall[1],
target=50,
reach=Event.marathon_reach_ultimete,
reach=Event.marathon_reach_ultimate,
arr=1,
bgm="push",
bg="game2",
bgm="secret7th",
},
},
zen={
@@ -335,6 +338,7 @@ defaultModeEnv={
lock=1e99,
target=200,
reach=Event.gameover.win,
bg="strap",
bgm="infinite",
},
},
@@ -343,11 +347,13 @@ defaultModeEnv={
drop=1e99,
lock=1e99,
oncehold=false,
bg="glow",
bgm="infinite",
},
},
solo={
{
bg="game2",
bgm="race",
},
},
@@ -358,6 +364,8 @@ defaultModeEnv={
lock=1e99,
target=1,
reach=Event.tsd_reach,
ospin=false,
bg="matrix",
bgm="reason",
},
{
@@ -365,6 +373,8 @@ defaultModeEnv={
lock=60,
target=1,
reach=Event.tsd_reach,
ospin=false,
bg="matrix",
bgm="reason",
},
},
@@ -373,6 +383,7 @@ defaultModeEnv={
drop=30,
lock=60,
visible=2,
bg="glow",
bgm="newera",
},
{
@@ -380,6 +391,7 @@ defaultModeEnv={
lock=60,
visible=0,
freshLimit=10,
bg="glow",
bgm="reason",
},
{
@@ -387,6 +399,7 @@ defaultModeEnv={
lock=60,
visible=0,
freshLimit=15,
bg="glow",
bgm="reason",
},
{
@@ -397,7 +410,8 @@ defaultModeEnv={
fall=15,
visible=0,
arr=1,
bgm="push",
bg="game3",
bgm="secret8th",
},
},
dig={
@@ -405,12 +419,14 @@ defaultModeEnv={
drop=60,
lock=120,
fall=20,
bg="game2",
bgm="push",
},
{
drop=10,
lock=30,
bgm="push",
bg="game2",
bgm="secret7th",
},
},
survivor={
@@ -418,57 +434,73 @@ defaultModeEnv={
drop=60,
lock=120,
fall=30,
bg="game2",
bgm="push",
},
{
drop=30,
lock=60,
fall=20,
bg="game2",
bgm="newera",
},
{
drop=10,
lock=60,
fall=15,
bgm="race",
bg="game2",
bgm="secret8th",
},
{
drop=5,
lock=60,
fall=10,
bgm="push",
bg="game3",
bgm="secret7th",
},
},
sudden={
tech={
{
oncehold=false,
drop=1e99,
lock=1e99,
target=0,
reach=Event.sudden_reach,
reach=Event.tech_reach,
bg="matrix",
bgm="way",
},
{
drop=30,
lock=60,
target=0,
reach=Event.sudden_reach,
reach=Event.tech_reach,
bg="matrix",
bgm="way",
},
{
drop=15,
lock=60,
target=0,
reach=Event.sudden_reach_hard,
reach=Event.tech_reach_hard,
bg="matrix",
bgm="way",
},
{
drop=5,
lock=40,
target=0,
reach=Event.sudden_reach_hard,
reach=Event.tech_reach_hard,
bg="matrix",
bgm="way",
},
{
drop=1,
lock=40,
target=0,
reach=Event.tech_reach_hard,
bg="matrix",
bgm="secret7th",
},
},
pctrain={
{
@@ -481,6 +513,8 @@ defaultModeEnv={
target=0,
freshLimit=1e99,
reach=Event.newPC,
ospin=false,
bg="rgb",
bgm="newera",
},
{
@@ -492,6 +526,8 @@ defaultModeEnv={
sequence="pc",
target=0,
reach=Event.newPC,
ospin=false,
bg="rgb",
bgm="newera",
},
},
@@ -503,6 +539,8 @@ defaultModeEnv={
target=100,
reach=Event.gameover.win,
freshLimit=1e99,
ospin=false,
bg="rgb",
bgm="newera",
},
{
@@ -511,6 +549,8 @@ defaultModeEnv={
fall=10,
target=100,
reach=Event.gameover.win,
ospin=false,
bg="rgb",
bgm="infinite",
},
{
@@ -519,6 +559,8 @@ defaultModeEnv={
fall=20,
target=100,
reach=Event.gameover.win,
ospin=false,
bg="rgb",
bgm="infinite",
},
},
@@ -529,6 +571,7 @@ defaultModeEnv={
royalePowerup={2,5,10,20},
royaleRemain={30,20,15,10,5},
pushSpeed=2,
bg="game3",
bgm="race",
},
},
@@ -539,6 +582,7 @@ defaultModeEnv={
royalePowerup={2,6,14,30},
royaleRemain={75,50,35,20,10},
pushSpeed=2,
bg="game3",
bgm="race",
},
},
@@ -546,27 +590,33 @@ defaultModeEnv={
{
drop=20,
lock=60,
sequence=drought1,
sequence="drought1",
target=100,
reach=Event.gameover.win,
ospin=false,
bg="glow",
bgm="reason",
},
{
drop=20,
lock=60,
sequence=drought2,
sequence="drought2",
target=100,
reach=Event.gameover.win,
ospin=false,
bg="glow",
bgm="reason",
},
},
hotseat={
{
bg="none",
bgm="way",
},
},
custom={
{
bg="none",
bgm="reason",
reach=Event.gameover.win,
},
@@ -582,7 +632,7 @@ modeLevel={
blind={"EASY","HARD","LUNATIC","GM"},
dig={"NORMAL","LUNATIC"},
survivor={"EASY","NORMAL","HARD","LUNATIC"},
sudden={"EASY","NORMAL","HARD","LUNATIC"},
tech={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
pctrain={"NORMAL","LUNATIC"},
pcchallenge={"NORMAL","HARD","LUNATIC"},
techmino41={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"},
@@ -611,32 +661,9 @@ modeLevelColor={
}
modeID={
[0]="custom",
"sprint","marathon","zen","infinite","solo","tsd","blind","dig","survivor","sudden",
"sprint","marathon","zen","infinite","solo","tsd","blind","dig","survivor","tech",
"pctrain","pcchallenge","techmino41","techmino99","drought","hotseat",
}
modeName={
[0]="Custom",
"Sprint","Marathon","Zen","Infinite","1v1","TSD-only","Blind","Dig","Survivor","Sudden",
"PC Train","PC Challenge","Techmino41","Techmino99","Drought","Hotseat",
}
modeInfo={
sprint="Speed run.",
marathon="Survive and reach target",
zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness",
solo="Beat AI",
tsd="Make more T-spin-doubles",
blind="Invisible board",
dig="Downstack!",
survivor="Hand them!",
sudden="Techniques practice",
pctrain="Let's learn some PCs",
pcchallenge="Make PCs in 100 Lines",
techmino41="Melee fight with 40 AIs",
techmino99="Melee fight with 98 AIs",
drought="ERRSEQ flood attack",
hotseat="",
}
freshMethod={
bag7=function()
@@ -749,14 +776,14 @@ TRS={
[31]={{0,0},{0,-1},{0,1},{-1,0}},
},--S/L
[5]={
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{-1,-1},{0,1}},
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{-1,-1}},
[10]={{0,0},{1,0},{1,-1},{0,2},{1,2},{0,-1},{1,1}},
[12]={{0,0},{1,0},{1,-1},{0,-1},{0,2},{1,2},{-1,-1}},
[21]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{1,1}},
[23]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{-1,1}},
[32]={{0,0},{-1,0},{-1,-1},{0,-1},{0,2},{-1,2},{1,-1}},
[30]={{0,0},{-1,0},{-1,-1},{0,2},{-1,2},{0,-1}},
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{0,1}},
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2}},
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
[20]={{0,0},{1,0},{-1,0},{0,1},{0,-1}},
[13]={{0,0},{0,-1},{0,1},{1,0},{-1,0},{0,2}},
@@ -774,164 +801,10 @@ TRS={
[02]={{0,0},{-1,0},{1,0},{0,-1},{0,1}},
[20]={{0,0},{1,0},{-1,0},{0,1},{0,-1}},
[13]={{0,0},{0,-1},{-1,0},{1,0},{0,1}},
[31]={{0,0},{0,1},{1,0},{-1,0},{0,1}},
[31]={{0,0},{1,0},{-1,0}},
}
}TRS[3],TRS[4]=TRS[2],TRS[1]
Buttons={
load={},
intro={},
main={
{x=250,y=250,w=350,h=100,rgb=color.red,f=55,t="Play",code=function()gotoScene("mode")end,down=2},
{x=250,y=360,w=350,h=100,rgb=color.blue,f=50,t="Settings",code=function()gotoScene("setting")end,up=1,down=3},
{x=160,y=470,w=170,h=100,rgb=color.yellow,f=50,t="Help",code=function()gotoScene("help")end,up=2,down=5,right=4},
{x=340,y=470,w=170,h=100,rgb=color.cyan,f=40,t="Statistics",code=function()gotoScene("stat")end,up=2,down=5,left=3},
{x=250,y=580,w=350,h=100,rgb=color.grey,f=40,t="Quit",code=function()gotoScene("quit")end,up=3},
},
mode={
{x=1000,y=210,w=200,h=140,rgb=color.white,hide=function()return modeSel==1 end,t="Λ",f=64,code=function()keyDown.mode("up")end},
{x=1000,y=430,w=200,h=140,rgb=color.white,hide=function()return modeSel==#modeID end,t="v",f=80,code=function()keyDown.mode("down")end},
{x=190,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==1 end,t="<",code=function()keyDown.mode("left")end},
{x=350,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==#modeLevel[modeID[modeSel]] end,t=">",code=function()keyDown.mode("right")end},
{x=1000,y=600,w=250,h=100,rgb=color.green,f=50,t="Start",code=function()loadGame(modeSel,levelSel)end},
{x=270,y=540,w=190,h=85,rgb=color.yellow,t="Custom(c)",code=function()gotoScene("custom")end},
{x=640,y=630,w=230,h=90,rgb=color.white,f=45,t="Back",code=back},
},
custom={
{x=1000,y=200,w=100,h=100,rgb=color.white,t="Λ",f=40,code=function()optSel=(optSel-2)%#customID+1 end},
{x=1000,y=440,w=100,h=100,rgb=color.white,t="v",f=50,code=function()optSel=optSel%#customID+1 end},
{x=880,y=320,w=100,h=100,rgb=color.white,t="<",f=50,code=function()local k=customID[optSel]customSel[k]=(customSel[k]-2)%#customRange[k]+1 end},
{x=1120,y=320,w=100,h=100,rgb=color.white,t=">",f=50,code=function()local k=customID[optSel]customSel[k]=customSel[k]%#customRange[k]+1 end},
{x=1000,y=580,w=180,h=80,rgb=color.green,t="Start",code=function()loadGame(0,1)end},
{x=640,y=630,w=180,h=60,rgb=color.white,t="Back",code=back},
},
play={
},
setting={--Normal setting
{x=285,y=90,w=210,h=60,rgb=color.white,t=function()return setting.ghost and"Ghost ON"or"Ghost OFF"end,code=function()setting.ghost=not setting.ghost end,down=3,right=2},
{x=505,y=90,w=210,h=60,rgb=color.white,t=function()return setting.center and"Center ON"or"Center OFF"end,code=function()setting.center=not setting.center end,down=5,left=1,right=11},
--1,2
{x=205,y=180,w=50,h=50,rgb=color.white,t="-",code=function()setting.das=(setting.das-1)%31 end,up=1,down=7,right=4},
{x=370,y=180,w=50,h=50,rgb=color.white,t="+",code=function()setting.das=(setting.das+1)%31 end,up=1,down=8,left=3,right=5},
{x=420,y=180,w=50,h=50,rgb=color.white,t="-",code=function()setting.arr=(setting.arr-1)%16 end,up=2,down=9,left=4,right=6},
{x=585,y=180,w=50,h=50,rgb=color.white,t="+",code=function()setting.arr=(setting.arr+1)%16 end,up=2,down=10,left=5,right=13},
--3~6
{x=205,y=260,w=50,h=50,rgb=color.white,t="-",code=function()setting.sddas=(setting.sddas-1)%11 end,up=3,down=13,right=8},
{x=370,y=260,w=50,h=50,rgb=color.white,t="+",code=function()setting.sddas=(setting.sddas+1)%11 end,up=4,down=13,left=7,right=9},
{x=420,y=260,w=50,h=50,rgb=color.white,t="-",code=function()setting.sdarr=(setting.sdarr-1)%4 end,up=5,down=13,left=8,right=10},
{x=585,y=260,w=50,h=50,rgb=color.white,t="+",code=function()setting.sdarr=(setting.sdarr+1)%4 end,up=6,down=13,left=9,right=14},
--7~10
{x=760,y=90,w=160,h=60,rgb=color.white,t=function()return setting.sfx and"SFX:on"or"SFX:off"end,code=function()setting.sfx=not setting.sfx end,down=13,left=2,right=12},
{x=940,y=90,w=160,h=60,rgb=color.white,t=function()return setting.bgm and"BGM:on"or"BGM:off"end,code=function()
BGM()
setting.bgm=not setting.bgm
BGM("blank")
end,down=13,left=6},
{x=850,y=160,w=340,h=60,rgb=color.white,t=function()return "Vibrate level:"..setting.vib end,code=function()
setting.vib=(setting.vib+1)%5
VIB(2)
end,up=11,down=14,left=6},
{x=850,y=230,w=340,h=60,rgb=color.white,t=function()return setting.fullscreen and"Fullscreen:on"or"Fullscreen:off"end,
code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
love.resize(gc.getWidth(),gc.getHeight())
end
end,
up=13,down=15,left=6
},
{x=850,y=300,w=340,h=60,rgb=color.white,t=function()return setting.bgblock and"BG animation:on"or"BG animation:off"end,
code=function()
setting.bgblock=not setting.bgblock
if not setting.bgblock then
for i=1,16 do
BGblockList[i].v=3*BGblockList[i].v
end
end
end,
up=14,down=16,left=10
},
{x=850,y=370,w=340,h=60,rgb=color.white,t=function()return"frameDraw:"..setting.frameMul.."%"end,code=function()
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
if setting.frameMul>100 then setting.frameMul=25 end
end,up=15,down=17},
--11~16
{x=850,y=440,w=340,h=60,rgb=color.green,t="Control settings",code=function()gotoScene("setting2")end,up=16,down=18},
{x=850,y=510,w=340,h=60,rgb=color.yellow,t="Touch settings",code=function()gotoScene("setting3")end,up=17,down=19},
{x=640,y=620,w=300,h=70,rgb=color.white,t="Save&Back",code=back,up=18},
--17~19
},
setting2={--Control setting
{x=840,y=630,w=180,h=60,rgb=color.white,t="Back",code=back},
},
setting3={--Touch setting
{x=640,y=410,w=170,h=80,t="Back",code=back},
{x=640,y=210,w=500,h=80,t=function()return setting.virtualkeySwitch and"Hide Virtual Key"or"Show Virtual Key"end,code=function()
setting.virtualkeySwitch=not setting.virtualkeySwitch
end},
{x=450,y=310,w=170,h=80,t="Defaults",code=function()
for K=1,#virtualkey do
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K]
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4]
end--Default virtualkey
defaultSel=defaultSel%5+1
end},
{x=640,y=310,w=170,h=80,t=function()return snapLevelName[snapLevel]end,code=function()
snapLevel=snapLevel%6+1
end},
{x=830,y=310,w=170,h=80,t=function()return percent0to5[setting.virtualkeyAlpha]end,code=function()
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%6
--Adjust virtualkey alpha
end},
{x=450,y=410,w=170,h=80,t="Icon",code=function()
setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon
end},
{x=830,y=410,w=170,h=80,t="Size",code=function()
if sel then
local b=virtualkey[sel]
b[4]=b[4]+10
if b[4]==150 then b[4]=40 end
b[3]=b[4]^2
end
end},
},
help={
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=back,right=2},
{x=980,y=590,w=230,h=60,rgb=color.white,t="Author's qq",code=function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,left=1},
},
stat={
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=back},
},
sel=nil,--selected button id(integer)
}
for k,v in pairs(Buttons)do
for i=1,#v do
v[i].alpha=0
end
end
virtualkey={
{80,720-80,6400,80},--moveLeft
{240,720-80,6400,80},--moveRight
{1280-240,720-80,6400,80},--rotRight
{1280-400,720-80,6400,80},--rotLeft
{1280-240,720-240,6400,80},--rotFlip
{1280-80,720-80,6400,80},--hardDrop
{1280-80,720-240,6400,80},--softDrop
{1280-80,720-400,6400,80},--hold
{80,360,6400,80},--swap
{80,80,6400,80},--restart
--[[
{x=0,y=0,r=0},--toLeft
{x=0,y=0,r=0},--toRight
{x=0,y=0,r=0},--toDown
]]
}
virtualkeyDown={false,false,false,false,false,false,false,false,false,false,false,false,false}
virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
virtualkeySet={
{
{80,720-200,6400,80},--moveLeft
@@ -994,39 +867,135 @@ virtualkeySet={
{1280-760,40,0,40},--restart
},--PC key feedback
}
Text={
load={"Loading textures","Loading BGM","Loading SFX","Finished",},
tips={
"The whole game is made by MrZ!",
"Back to Back 8 combo Techrash PC!",
"Techmino has a Nspire-CX edition!",
"Is B2B2B2B possible?",
"MrZ spin Penta!",
Buttons={
load={},
intro={},
main={
{x=250,y=250,w=350,h=100,rgb=color.red,f=55,code=function()gotoScene("mode")end,down=2},
{x=250,y=360,w=350,h=100,rgb=color.blue,f=55,code=function()gotoScene("setting")end,up=1,down=3},
{x=160,y=470,w=170,h=100,rgb=color.yellow,f=55,code=function()gotoScene("help")end,up=2,down=5,right=4},
{x=340,y=470,w=170,h=100,rgb=color.cyan,f=40,code=function()gotoScene("stat")end,up=2,down=5,left=3},
{x=250,y=580,w=350,h=100,rgb=color.grey,f=50,code=function()gotoScene("quit")end,up=3},
},
stat={
"Games run:",
"Games played:",
"Game time:",
"Total block used:",
"Total rows cleared:",
"Total lines sent:",
"Total key pressed:",
"Total rotate:",
"Total hold:",
"Total spin:",
mode={
{x=1000,y=210,w=200,h=140,rgb=color.white,hide=function()return modeSel==1 end,f=64,code=function()keyDown.mode("up")end},
{x=1000,y=430,w=200,h=140,rgb=color.white,hide=function()return modeSel==#modeID end,f=80,code=function()keyDown.mode("down")end},
{x=190,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==1 end,code=function()keyDown.mode("left")end},
{x=350,y=160,w=100,h=80,rgb=color.white,hide=function()return levelSel==#modeLevel[modeID[modeSel]] end,code=function()keyDown.mode("right")end},
{x=1000,y=600,w=250,h=100,rgb=color.green,f=50,code=function()loadGame(modeSel,levelSel)end},
{x=270,y=540,w=190,h=85,rgb=color.yellow,code=function()gotoScene("custom")end},
{x=640,y=630,w=230,h=90,rgb=color.white,f=45,code=back},
},
custom={
{x=1000,y=200,w=100,h=100,rgb=color.white,f=40,code=function()optSel=(optSel-2)%#customID+1 end},
{x=1000,y=440,w=100,h=100,rgb=color.white,f=50,code=function()optSel=optSel%#customID+1 end},
{x=880,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=(customSel[k]-2)%#customRange[k]+1 end},
{x=1120,y=320,w=100,h=100,rgb=color.white,f=50,code=function()local k=customID[optSel]customSel[k]=customSel[k]%#customRange[k]+1 end},
{x=1000,y=580,w=180,h=80,rgb=color.green,code=function()loadGame(0,1)end},
{x=640,y=630,w=180,h=60,rgb=color.white,code=back},
},
play={
},
setting={--Normal setting
{x=285,y=90,w=210,h=60,rgb=color.white,code=function()setting.ghost=not setting.ghost end,down=3,right=2},
{x=505,y=90,w=210,h=60,rgb=color.white,code=function()setting.center=not setting.center end,down=5,left=1,right=11},
--1,2
{x=205,y=180,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das-1)%31 end,up=1,down=7,right=4},
{x=370,y=180,w=50,h=50,rgb=color.white,code=function()setting.das=(setting.das+1)%31 end,up=1,down=8,left=3,right=5},
{x=420,y=180,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr-1)%16 end,up=2,down=9,left=4,right=6},
{x=585,y=180,w=50,h=50,rgb=color.white,code=function()setting.arr=(setting.arr+1)%16 end,up=2,down=10,left=5,right=13},
--3~6
{x=205,y=260,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas-1)%11 end,up=3,down=19,right=8},
{x=370,y=260,w=50,h=50,rgb=color.white,code=function()setting.sddas=(setting.sddas+1)%11 end,up=4,down=19,left=7,right=9},
{x=420,y=260,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr-1)%4 end,up=5,down=19,left=8,right=10},
{x=585,y=260,w=50,h=50,rgb=color.white,code=function()setting.sdarr=(setting.sdarr+1)%4 end,up=6,down=19,left=9,right=14},
--7~10
{x=760,y=90,w=160,h=60,rgb=color.white,code=function()setting.sfx=not setting.sfx end,down=13,left=2,right=12},
{x=940,y=90,w=160,h=60,rgb=color.white,code=function()
BGM()
setting.bgm=not setting.bgm
BGM("blank")
end,down=13,left=6},
{x=850,y=160,w=340,h=60,rgb=color.white,code=function()
setting.vib=(setting.vib+1)%5
VIB(2)
end,up=11,down=14,left=6},
{x=850,y=230,w=340,h=60,rgb=color.white,
code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
love.resize(gc.getWidth(),gc.getHeight())
end
end,
up=13,down=15,left=6
},
{x=850,y=300,w=340,h=60,rgb=color.white,
code=function()
setting.bgblock=not setting.bgblock
if not setting.bgblock then
for i=1,16 do
BGblockList[i].v=3*BGblockList[i].v
end
end
end,
up=14,down=16,left=10
},
{x=850,y=370,w=340,h=60,rgb=color.white,code=function()
setting.frameMul=setting.frameMul+(setting.frameMul<50 and 5 or 10)
if setting.frameMul>100 then setting.frameMul=25 end
end,up=15,down=17},
--11~16
{x=850,y=440,w=340,h=60,rgb=color.green,code=function()gotoScene("setting2")end,up=16,down=18},
{x=850,y=510,w=340,h=60,rgb=color.yellow,code=function()gotoScene("setting3")end,up=17,down=20},
{x=280,y=510,w=200,h=60,rgb=color.red,code=function()
setting.lang=setting.lang%#langName+1
swapLanguage(setting.lang)
end,up=10,down=20,right=18},
{x=640,y=620,w=300,h=70,rgb=color.white,code=back,up=19},
--17~19
},
setting2={--Control setting
{x=840,y=630,w=180,h=60,rgb=color.white,code=back},
},
setting3={--Touch setting
{x=640,y=410,w=170,h=80,code=back},
{x=640,y=210,w=500,h=80,code=function()
setting.virtualkeySwitch=not setting.virtualkeySwitch
end},
{x=450,y=310,w=170,h=80,code=function()
for K=1,#virtualkey do
local b,b0=virtualkey[K],virtualkeySet[defaultSel][K]
b[1],b[2],b[3],b[4]=b0[1],b0[2],b0[3],b0[4]
end--Default virtualkey
defaultSel=defaultSel%5+1
end},
{x=640,y=310,w=170,h=80,code=function()
snapLevel=snapLevel%6+1
end},
{x=830,y=310,w=170,h=80,code=function()
setting.virtualkeyAlpha=(setting.virtualkeyAlpha+1)%6
--Adjust virtualkey alpha
end},
{x=450,y=410,w=170,h=80,code=function()
setting.virtualkeyIcon=not setting.virtualkeyIcon
--Switch virtualkey icon
end},
{x=830,y=410,w=170,h=80,code=function()
if sel then
local b=virtualkey[sel]
b[4]=b[4]+10
if b[4]==150 then b[4]=40 end
b[3]=b[4]^2
end
end},
},
help={
"I think you don't need \"help\".",
"THIS IS ONLY A SMALL BLOCK GAME",
"But just play like playing TOP/C2/KOS/TGM3",
"Game is not public now,so DO NOT DISTIRBUTE",
"",
"Powered by LOVE2D",
"Author:MrZ E-mail:1046101471@qq.com",
"Programe:MrZ Art:MrZ Music:MrZ SFX:MrZ",
"Tool used:VScode,GFIE,Beepbox,Goldwave",
"Special thanks:Farter,Teatube,196,Flyz,T830,[all test staff] and YOU!",
"Any bugs/suggestions to my E-mail.",
{x=640,y=590,w=180,h=60,rgb=color.white,code=back,right=2},
{x=980,y=590,w=230,h=60,rgb=color.white,code=function()sys.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,left=1},
},
stat={
{x=640,y=590,w=180,h=60,rgb=color.white,code=back},
},
sel=nil,--selected button id(integer)
}

164
main.lua
View File

@@ -39,7 +39,7 @@ function setFont(s)
if Fonts[s]then
gc.setFont(Fonts[s])
else
local t=gc.setNewFont("albbph.ttf",s-5)
local t=gc.setNewFont("allph.ttf",s-5)
Fonts[s]=t
gc.setFont(t)
end
@@ -57,8 +57,9 @@ gameEnv0={
sequence="bag7",visible=1,
_20G=false,target=1e99,
freshLimit=15,
virtualkey={},
ospin=true,
reach=null,
bg="none",
bgm="race"
--not all is actually used,some only provide a key
}
@@ -78,37 +79,25 @@ customSel={
loadmode={
sprint=function()
createPlayer(1,340,15)
curBG="game1"
end,
marathon=function()
createPlayer(1,340,15)
curBG="strap"
end,
zen=function()
createPlayer(1,340,15)
curBG="strap"
end,
infinite=function()
createPlayer(1,340,15)
curBG="glow"
end,
solo=function()
createPlayer(1,20,15)--Player
createPlayer(2,660,85,.9,customRange.opponent[3*curMode.lv])--AI
curBG="game2"
end,
death=function()
createPlayer(1,340,15)
curBG="game2"
BGM("push")
createPlayer(1,200,15)
createPlayer(2,830,220,.7,customRange.opponent[3*curMode.lv])
end,
tsd=function()
createPlayer(1,340,15)
curBG="matrix"
end,
blind=function()
createPlayer(1,340,15)
curBG="glow"
end,
dig=function()
createPlayer(1,340,15)
@@ -120,29 +109,24 @@ loadmode={
ins(players[1].task,Event.task.dig_lunatic)
pushSpeed=1
end
curBG="game2"
end,
survivor=function()
createPlayer(1,340,15)
local P=players[1]
ins(players[1].task,Event.task[curMode.lv==1 and"survivor_easy"or curMode.lv==2 and"survivor_normal"or curMode.lv==3 and"survivor_hard"or curMode.lv==4 and"survivor_lunatic"])
pushSpeed=curMode.lv>2 and 2 or 1
curBG="game2"
end,
sudden=function()
tech=function()
createPlayer(1,340,15)
curBG="matrix"
end,
pctrain=function()
createPlayer(1,340,15)
P=players[1]
Event.newPC()
P.freshNext()
curBG="matrix"
end,
pcchallenge=function()
createPlayer(1,340,15)
curBG="matrix"
end,
techmino41=function()
createPlayer(1,340,15)--Player
@@ -164,7 +148,6 @@ loadmode={
end end
--AIs
curBG="game3"
end,
techmino99=function()
createPlayer(1,340,15)--Player
@@ -186,11 +169,9 @@ loadmode={
end end
--AIs
curBG="game3"
end,
drought=function()
createPlayer(1,340,15)
curBG="strap"
end,
hotseat=function()
if curMode.lv==1 then
@@ -206,7 +187,6 @@ loadmode={
createPlayer(3,645,160,.5)
createPlayer(4,955,160,.5)
end
curBG="game2"
end,
custom=function()
for i=1,#customID do
@@ -221,7 +201,6 @@ loadmode={
createPlayer(1,20,15)
createPlayer(2,660,85,.9,modeEnv.opponent)
end
curBG="matrix"
end,
}
mesDisp={
@@ -239,8 +218,8 @@ mesDisp={
mStr(P.cstat.atk,-75,310)
mStr(format("%.2f",2.5*P.cstat.atk/P.cstat.piece),-75,420)
setFont(20)
gc.print("Attack",-98,363)
gc.print("Efficiency",-110,475)
mStr("Attack",-75,363)
mStr("Efficiency",-75,475)
end,
marathon=function()
setFont(50)
@@ -250,14 +229,14 @@ mesDisp={
end,
tsd=function()
setFont(35)
gc.print("TSD",-102,405)
mStr("TSD",-75,405)
setFont(80)
mStr((P.gameEnv.target-1)*.5,-75,330)
mStr(P.cstat.event,-75,330)
end,
blind=function()
setFont(25)
gc.print("Rows",-102,300)
gc.print("Techrash",-123,420)
mStr("Rows",-75,300)
mStr("Techrash",-75,420)
setFont(80)
mStr(P.cstat.row,-75,220)
mStr(P.cstat.techrash,-75,340)
@@ -266,23 +245,23 @@ mesDisp={
setFont(70)
mStr(P.cstat.event,-75,310)
setFont(30)
gc.print("Wave",-112,375)
mStr("Wave",-75,375)
end,
survivor=function()
setFont(70)
mStr(P.cstat.event,-75,310)
setFont(30)
gc.print("Wave",-112,375)
mStr("Wave",-75,375)
end,
pctrain=function()
setFont(25)
gc.print("Perfect Clear",-140,410)
mStr("Perfect Clear",-75,410)
setFont(80)
mStr(P.cstat.pc,-75,330)
end,
pcchallenge=function()
setFont(25)
gc.print("Perfect Clear",-140,430)
mStr("Perfect Clear",-75,430)
setFont(80)
mStr(P.cstat.pc,-75,350)
setFont(50)
@@ -341,6 +320,7 @@ Event={
if modeEnv.royaleMode then
P.rank=1
P.result="WIN"
showText(P,1,"appear",60,120,nil,true)
changeAtk(P)
end
::L::if P.task[1]then
@@ -356,7 +336,7 @@ Event={
P.visTime[i][j]=min(P.visTime[i][j],20)
end
end
showText(P,"WIN","appear",90,nil,nil,true)
showText(P,text.win,"beat",90,nil,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("win")end
ins(P.task,Event.task.win)
end,
@@ -380,11 +360,12 @@ Event={
changeAtk(P)
P.result="K.O."
P.rank=#players.alive+1
showText(P,P.rank,"appear",60,120,nil,true)
P.strength=0
local A=P
::L::
A=A.lastRecv
if A and not A.alive then goto L end
if A and not A.alive and A~=P then goto L end
if A and A~=P then
if P.id==1 or A.id==1 then
throwBadge(P,A,P.badge)
@@ -396,8 +377,28 @@ Event={
A.strength=i
end
end
if P==mostBadge then
mostBadge,secBadge=secBadge
elseif P==secBadge then
secBadge=nil
end
if mostBadge then
if A.badge>mostBadge.badge then
if A~=mostBadge then
mostBadge,secBadge=A,mostBadge
end
elseif secBadge then
if A.badge>secBadge.badge then
secBadge=A
end
else
secBadge=A
end
else
mostBadge=A
end
end
freshMostBadge()
freshMostDangerous()
for i=1,#players.alive do
if players.alive[i].atking==P then
freshTarget(players.alive[i])
@@ -416,7 +417,7 @@ Event={
P.visTime[i][j]=min(P.visTime[i][j],20)
end
end
showText(P,"LOSE","appear",90,nil,nil,true)
showText(P,text.lose,"appear",90,nil,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("fail")end
ins(P.task,Event.task.lose)
if #players.alive==1 then
@@ -449,21 +450,23 @@ Event={
P.gameEnv.lock=rush_lock[t]
P.gameEnv.wait=rush_wait[t]
P.gameEnv.fall=rush_fall[t]
showText(P,"STAGE "..t,"fly",80,-120)
showText(P,text.stage[t],"fly",80,-120)
SFX("reach")
end
end,
marathon_reach_ultimate=function()
if P.gameEnv.target==250 then
if P.cstat.event==5 then
P.cstat.row=250
Event.gameover.win()
else
P.gameEnv.target=P.gameEnv.target+50
local t=P.gameEnv.target/50
local t=P.cstat.event+1
if t==1 then t=2 end
P.gameEnv.target=50*t
P.cstat.event=t
P.gameEnv.lock=death_lock[t]
P.gameEnv.wait=death_wait[t]
P.gameEnv.fall=death_fall[t]
showText(P,"STAGE "..t,"beat",80,-120)
showText(P,text.stage[t],"fly",80,-120)
SFX("reach")
end
end,
@@ -472,18 +475,19 @@ Event={
Event.gameover.lose()
else
P.gameEnv.target=P.gameEnv.target+2
if P.cstat.row%10~=0 then
P.cstat.event=P.cstat.event+1
if #P.field>11 and P.cstat.event%5~=1 then
ins(P.clearing,1)
end
end
end,
sudden_reach=function()
tech_reach=function()
if #P.clearing>0 and P.lastClear<10 then
Event.gameover.lose()
end
end,
sudden_reach_hard=function()
if #P.clearing>0 and P.lastClear<10 and P.lastClear~=74 then
tech_reach_hard=function()
if #P.clearing>0 and P.lastClear<10 or P.lastClear==74 then
Event.gameover.lose()
end
end,
@@ -500,9 +504,9 @@ Event={
P.gameEnv.lock=pc_lock[s]or 20
P.gameEnv.fall=pc_fall[s]or 5
if s==10 then
showText(P,"Max speed","appear",80,-120)
showText(P,text.maxspeed,"appear",80,-140)
else
showText(P,"Speed up","appear",30,-130)
showText(P,text.speedup,"appear",30,-140)
end
end
end
@@ -590,6 +594,7 @@ Event={
if P.counter==max(60,180-2*P.cstat.event)then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1})
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
@@ -604,19 +609,21 @@ Event={
elseif d%4==3 then ins(P.atkBuffer,{rnd(10),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3})
end
P.counter=0
if P.cstat.event==60 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
survivor_hard=function()
local P=players[1]
P.counter=P.counter+1
if P.counter==max(80,150-2*P.cstat.event)then
if rnd()<.33 then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=20,cd0=20,time=0,sent=false,lv=1})
if P.counter==max(60,180-2*P.cstat.event)then
if P.cstat.event%3<2 then
ins(P.atkBuffer,{rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1})
else
ins(P.atkBuffer,{rnd(10),amount=3,countdown=40,cd0=40,time=0,sent=false,lv=2})
ins(P.atkBuffer,{rnd(10),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2})
end
P.counter=0
if P.cstat.event==45 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
@@ -624,9 +631,10 @@ Event={
local P=players[1]
P.counter=P.counter+1
if P.counter==max(90,150-P.cstat.event)then
local t=max(30,90-2*P.cstat.event)
local t=max(60,90-P.cstat.event)
ins(P.atkBuffer,{rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3})
P.counter=0
if P.cstat.event==30 then showText(P,text.maxspeed,"appear",80,-140)end
P.cstat.event=P.cstat.event+1
end
end,
@@ -654,10 +662,10 @@ Event={
}
--Game system Data
setting={
lang=1,
sfx=true,bgm=true,vib=3,
fullscreen=false,
bgblock=true,
lang="eng",
das=10,arr=2,
sddas=0,sdarr=2,
ghost=true,center=true,
@@ -713,17 +721,28 @@ stat={
rotate=0,
spin=0,
}
virtualkey={
{80,720-80,6400,80},--moveLeft
{240,720-80,6400,80},--moveRight
{1280-240,720-80,6400,80},--rotRight
{1280-400,720-80,6400,80},--rotLeft
{1280-240,720-240,6400,80},--rotFlip
{1280-80,720-80,6400,80},--hardDrop
{1280-80,720-240,6400,80},--softDrop
{1280-80,720-400,6400,80},--hold
{80,360,6400,80},--swap
{80,80,6400,80},--restart
--[[
{x=0,y=0,r=0},--toLeft
{x=0,y=0,r=0},--toRight
{x=0,y=0,r=0},--toDown
]]
}
virtualkeyDown={false,false,false,false,false,false,false,false,false,false,false,false,false}
virtualkeyPressTime={0,0,0,0,0,0,0,0,0,0,0,0,0}
--User Data&User Setting
require("toolfunc")
require("gamefunc")
require("list")
require("texture")
require("ai")
require("timer")
require("paint")
require("scene")
require("call&sys")
userData=fs.newFile("userdata")
userSetting=fs.newFile("usersetting")
if fs.getInfo("userdata")then
@@ -733,4 +752,13 @@ if fs.getInfo("usersetting")then
loadSetting()
elseif system=="Android" or system=="iOS"then
setting.virtualkeySwitch=true
end
end
require("gamefunc")
require("ai")
require("timer")
require("paint")
require("call&sys")
require("list")
swapLanguage(setting.lang)
require("texture")

View File

@@ -155,9 +155,14 @@ function drawPixel(y,x,id,alpha)
gc.setColor(1,1,1,alpha)
gc.draw(blockSkin[id],30*x-30,600-30*y)
end
function drawPixelmini(y,x,id)
function drawAtkPointer(x,y)
gc.setColor(0,.6,1,.35+sin(Timer()*20)*.2)
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,25*(1+a),6)
end
function VirtualkeyPreview()
for i=1,#virtualkey do
gc.setColor(1,sel==i and .5 or 1,sel==i and .5 or 1,setting.virtualkeyAlpha*.2)
@@ -196,15 +201,15 @@ Pnt.BG={
end,
game1=function()
gc.setColor(1,1,1)
gc.draw(background[1],640,360,Timer()*.15,12,nil,64,64)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64)
end,
game2=function()
gc.setColor(1,.5,.5)
gc.draw(background[1],640,360,Timer()*.2,12,nil,64,64)
gc.draw(background1,640,360,Timer()*.2,12,nil,64,64)
end,
game3=function()
gc.setColor(.6,.6,1)
gc.draw(background[1],640,360,Timer()*.25,12,nil,64,64)
gc.draw(background1,640,360,Timer()*.25,12,nil,64,64)
end,
rgb=function()
gc.clear(
@@ -216,8 +221,8 @@ Pnt.BG={
strap=function()
gc.setColor(1,1,1)
local x=Timer()%32*40
gc.draw(background[2],x,0,nil,10)
gc.draw(background[2],x-1280,0,nil,10)
gc.draw(background2,x,0,nil,10)
gc.draw(background2,x-1280,0,nil,10)
end,
matrix=function()
for i=0,15 do
@@ -238,9 +243,9 @@ function Pnt.load()
gc.setColor(1,1,1)
gc.rectangle("line",300,330,680,60)
setFont(40)
mStr(Text.load[loading],640,335)
mStr(text.load[loading],640,335)
setFont(25)
mStr("not animation,real loading!",640,400)
mStr(text.loadTip,640,400)
end
function Pnt.intro()
gc.push()
@@ -262,7 +267,7 @@ end
function Pnt.main()
gc.setColor(1,1,1)
setFont(30)
gc.print("Alpha V0.7.8",370,140)
gc.print("Alpha V0.7.9",370,140)
gc.print(system,530,110)
gc.draw(titleImage,30,30)
end
@@ -272,25 +277,25 @@ function Pnt.mode()
mStr(modeLevel[modeID[modeSel]][levelSel],270,215)
setFont(30)
gc.setColor(color.white)
mStr(modeInfo[modeID[modeSel]],270,255)
mStr(text.modeInfo[modeID[modeSel]],270,255)
setFont(80)
gc.setColor(color.grey)
mStr(modeName[modeSel],643,273)
mStr(text.modeName[modeSel],643,273)
for i=modeSel-2,modeSel+2 do
if i>=1 and i<=#modeID then
local f=80-abs(i-modeSel)*20
gc.setColor(i==modeSel and color.white or abs(i-modeSel)==1 and color.grey or color.darkGrey)
setFont(f)
mStr(modeName[i],640,310+70*(i-modeSel)-f*.5)
mStr(text.modeName[i],640,310+70*(i-modeSel)-f*.5)
end
end
end
function Pnt.custom()
setFont(80)
gc.setColor(color.lightGrey)
gc.print("Custom Game",20,20)
gc.print(text.custom,20,20)
gc.setColor(color.white)
gc.print("Custom Game",22,23)
gc.print(text.custom,22,23)
setFont(40)
for i=1,#customID do
local k=customID[i]
@@ -347,7 +352,7 @@ function Pnt.play()
gc.pop()
else
gc.push("transform")
gc.translate(P.x,P.y)gc.scale(P.size)--Scale
gc.translate(P.x,P.y)gc.scale(P.size)
gc.setColor(0,0,0,.6)gc.rectangle("fill",0,0,600,690)--Black Background
gc.setLineWidth(7)
gc.setColor(frameColor[P.strength])gc.rectangle("line",0,0,600,690)--Big frame
@@ -370,7 +375,7 @@ function Pnt.play()
if P.gameEnv.ghost then
for i=1,P.r do for j=1,P.c do
if P.cb[i][j]>0 then
drawPixel(i+P.y_img-1,j+P.cx-1,P.bn,.3)
drawPixel(i+P.y_img-1,j+P.cx-1,P.bc,.3)
end
end end
end--Ghost
@@ -382,7 +387,7 @@ function Pnt.play()
end end--BlockShade(lockdelay indicator)
for i=1,P.r do for j=1,P.c do
if P.cb[i][j]>0 then
drawPixel(i+P.cy-1,j+P.cx-1,P.bn,1)
drawPixel(i+P.cy-1,j+P.cx-1,P.bc,1)
end
end end--Block
if P.gameEnv.center then
@@ -444,7 +449,7 @@ function Pnt.play()
for i=1,#P.hb do
for j=1,#P.hb[1] do
if P.hb[i][j]>0 then
drawPixel(i+17.5-#P.hb*.5,j-2.5-#P.hb[1]*.5,P.holded and 13 or P.hn,1)
drawPixel(i+17.5-#P.hb*.5,j-2.5-#P.hb[1]*.5,P.holded and 13 or P.hid,1)
end
end
end
@@ -517,21 +522,18 @@ function Pnt.play()
gc.draw(badgeIcon,b[1]+(b[3]-b[1])*t,b[2]+(b[4]-b[2])*t,nil,b.size,nil,14,14)
end
P=players[1]
if P.atkMode~=4 then
gc.setLineWidth(5)
gc.setColor(.8,1,0,.2)
else
gc.setLineWidth(9)
gc.setColor(1,.6,.2,.4)
end
gc.setLineWidth(5)
gc.setColor(.8,1,0,.2)
for i=1,#players[1].atker do
local p=players[1].atker[i]
gc.line(p.centerX,p.centerY,P.centerX,P.centerY)
end
if P.atkMode~=4 then
if P.atking then
gc.setColor(0,.5,1,.2+(sin(Timer()*10)+1)*.1)
gc.line(P.centerX,P.centerY,P.atking.centerX,P.atking.centerY)
if P.atking then drawAtkPointer(P.atking.centerX,P.atking.centerY)end
else
for i=1,#players[1].atker do
local p=players[1].atker[i]
drawAtkPointer(p.centerX,p.centerY)
end
end
end
@@ -542,8 +544,8 @@ function Pnt.setting()
mStr("DAS:"..setting.das,288,158)
mStr("ARR:"..setting.arr,503,158)
setFont(18)
mStr("softdropDAS:"..setting.sddas,288,249)
mStr("softdropARR:"..setting.sdarr,503,249)
mStr(text.softdropdas..setting.sddas,288,249)
mStr(text.softdroparr..setting.sdarr,503,249)
end
function Pnt.setting2()
if keyboardSetting then
@@ -562,7 +564,7 @@ function Pnt.setting2()
gc.setColor(1,1,1)
setFont(25)
for y=1,13 do
mStr(actName_show[y],150,40*y)
mStr(text.actName[y],150,40*y)
for x=1,2 do
mStr(setting.keyMap[curBoard+x*8-8][y],200*x+140,40*y-3)
end
@@ -572,8 +574,9 @@ function Pnt.setting2()
gc.line(200*x-160,30,200*x-160,550)
end
gc.line(40,550,640,550)
gc.print("Keyboard | Joystick",335,1)
gc.print("Arrowkey to select/change slot,Enter to change,Esc back",50,620)
gc.print(text.keyboard,335,1)
gc.print(text.joystick,420,1)
gc.print(text.setting2Help,50,620)
setFont(40)
gc.print("< P"..curBoard.."/P8 >",430,570)
end
@@ -595,7 +598,7 @@ function Pnt.help()
setFont(32)
gc.setColor(1,1,1)
for i=1,11 do
gc.printf(Text.help[i],140,15+43*i,1000,"center")
gc.printf(text.help[i],140,15+43*i,1000,"center")
end
gc.draw(titleImage,180,600,.2,.7+.05*sin(Timer()*2),nil,140,100)
end
@@ -603,7 +606,7 @@ function Pnt.stat()
setFont(35)
gc.setColor(1,1,1)
for i=1,10 do
gc.print(Text.stat[i],350,20+40*i)
gc.print(text.stat[i],350,20+40*i)
end
gc.print(stat.run,650,60)

View File

@@ -1,87 +0,0 @@
game={}
function game.load()
scene="load"
curBG="none"
keeprun=true
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar
end
function game.intro()
scene="intro"
curBG="none"
count=0
keeprun=true
end
function game.main()
scene="main"
curBG="none"
keeprun=true
BGM("blank")
collectgarbage()
end
function game.mode()
saveData()
modeSel=modeSel or 1
levelSel=levelSel or 3
scene="mode"
curBG="none"
keeprun=true
BGM("blank")
end
function game.custom()
optSel=optSel or 1
scene="custom"
curBG="matrix"
keeprun=true
BGM("blank")
end
function game.play()
scene="play"
--curBG="game1"
keeprun=false
resetGameData()
sysSFX("ready")
mouseShow=false
end
function game.setting()
scene="setting"
curBG="none"
keeprun=true
BGM("blank")
end
function game.setting2()
scene="setting2"
curBG="none"
keeprun=true
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
BGM("blank")
end--Control settings
function game.setting3()
scene="setting3"
curBG="game1"
keeprun=true
defaultSel=1
sel=nil
snapLevel=1
BGM("blank")
end--Touch setting
function game.help()
scene="help"
curBG="none"
keeprun=true
BGM("blank")
end
function game.stat()
scene="stat"
curBG="none"
keeprun=true
BGM("blank")
end
function game.quit()
love.event.quit()
end

View File

@@ -62,19 +62,19 @@ c:release()
--Dust particles
PTC.attack={}
PTC.attack[1]=gc.newParticleSystem(gc.newImage("/image/mess/atk1.png"),200)
PTC.attack[1]=gc.newParticleSystem(N("/image/mess/atk1.png"),200)
PTC.attack[1]:setParticleLifetime(.25)
PTC.attack[1]:setEmissionRate(0)
PTC.attack[1]:setSpin(10)
PTC.attack[1]:setColors(1,1,1,.7,1,1,1,0)
PTC.attack[2]=gc.newParticleSystem(gc.newImage("/image/mess/atk2.png"),200)
PTC.attack[2]=gc.newParticleSystem(N("/image/mess/atk2.png"),200)
PTC.attack[2]:setParticleLifetime(.3)
PTC.attack[2]:setEmissionRate(0)
PTC.attack[2]:setSpin(8)
PTC.attack[2]:setColors(1,1,1,.7,1,1,1,0)
PTC.attack[3]=gc.newParticleSystem(gc.newImage("/image/mess/atk3.png"),200)
PTC.attack[3]=gc.newParticleSystem(N("/image/mess/atk3.png"),200)
PTC.attack[3]:setParticleLifetime(.4)
PTC.attack[3]:setEmissionRate(0)
PTC.attack[3]:setSpin(6)
@@ -83,14 +83,81 @@ PTC.attack[3]:setColors(1,1,1,.7,1,1,1,0)
gc.setDefaultFilter("linear","linear")
titleImage=N("/image/mess/title.png")
spinCenter=N("/image/mess/spinCenter.png")
dialCircle=N("/image/mess/dialCircle.png")
dialNeedle=N("/image/mess/dialNeedle.png")
badgeIcon=N("/image/mess/badge.png")
spinCenter=N("/image/mess/spinCenter.png")
background1=N("/image/BG/bg1.jpg")
background2=N("/image/BG/bg2.png")
background={
N("/image/BG/bg1.jpg"),
N("/image/BG/bg2.png"),
}
c=nil
gc.setCanvas()
gc.setCanvas()
sceneInit={
load=function()
curBG="none"
keeprun=true
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar(0~1)
end,
intro=function()
curBG="none"
count=0
keeprun=true
end,
main=function()
curBG="none"
keeprun=true
collectgarbage()
end,
mode=function()
saveData()
modeSel=modeSel or 1
levelSel=levelSel or 3
curBG="none"
keeprun=true
end,
custom=function()
optSel=optSel or 1
curBG="matrix"
keeprun=true
end,
play=function()
keeprun=false
resetGameData()
sysSFX("ready")
mouseShow=false
end,
setting=function()
curBG="none"
keeprun=true
end,
setting2=function()
curBG="none"
keeprun=true
curBoard=1
keyboardSet=1
joystickSet=1
keyboardSetting=false
joystickSetting=false
end,--Control settings
setting3=function()
curBG="game1"
keeprun=true
defaultSel=1
sel=nil
snapLevel=1
end,--Touch setting
help=function()
curBG="none"
keeprun=true
end,
stat=function()
curBG="none"
keeprun=true
end,
quit=function()
love.event.quit()
end,
}

View File

@@ -72,7 +72,6 @@ function Tmr.play(dt)
for i=1,3 do
PTC.attack[i]:update(dt)
end
-- Update attack beam
if frame<180 then
if frame==179 then
@@ -110,7 +109,7 @@ function Tmr.play(dt)
P.ai.controlDelay=P.ai.controlDelay0+1
else
AI_getControls(P.ai.controls)
P.ai.controlDelay=2*P.ai.controlDelay0
P.ai.controlDelay=P.ai.controlDelay0+2
end
end
end

View File

@@ -69,7 +69,16 @@ function stencil_field_small()
gc.rectangle("fill",0,0,60,120)
end
--Single-usage funcs
function swapLanguage(l)
text=require("language/"..langID[l])
Buttons.sel=nil
for scene,list in pairs(Buttons)do
for num=1,#list do
list[num].alpha=0
list[num].t=text.ButtonText[scene][num]
end
end
end
function VIB(t)
if setting.vib>0 then
love.system.vibrate(vibrateLevel[setting.vib+t])
@@ -135,7 +144,7 @@ function back()
end
function loadData()
userData:open("r")
--local t=string.splitS(love.math.decompress(userdata,"zlib"),"\r\n")
--local t=string.splitS(love.math.decompress(userdata,"zlib"),"\r\n")
local t=string.splitS(userData:read(),"\r\n")
userData:close()
for i=1,#t do
@@ -170,7 +179,7 @@ function saveData()
end
function loadSetting()
userSetting:open("r")
--local t=string.splitS(love.math.decompress(userdata,"zlib"),"\r\n")
--local t=string.splitS(love.math.decompress(userdata,"zlib"),"\r\n")
local t=string.splitS(userSetting:read(),"\r\n")
userSetting:close()
for i=1,#t do
@@ -181,7 +190,7 @@ function loadSetting()
if t=="sfx"or t=="bgm"or t=="bgblock"then
setting[t]=v=="true"
elseif t=="vib"then
setting.vib=toN(v:match("[0123]"))or 0
setting.vib=toN(v:match("[01234]"))or 0
elseif t=="fullscreen"then
setting.fullscreen=v=="true"
love.window.setFullscreen(setting.fullscreen)
@@ -229,6 +238,8 @@ function loadSetting()
setting[t]=int(v)
elseif t=="ghost"or t=="center"then
setting[t]=v=="true"
elseif t=="lang"then
setting[t]=toN(v:match("[12]"))or 1
end
end
end
@@ -250,6 +261,7 @@ function saveSetting()
lib[i]=table.concat(setting.keyLib[i],",")
end
local t=table.concat({
stringPack("lang=",setting.lang),
stringPack("sfx=",setting.sfx),
stringPack("bgm=",setting.bgm),
stringPack("vib=",setting.vib),