Compare commits

..

2 Commits
v0.6 ... v0.6.8

Author SHA1 Message Date
MrZ_26
bdee7fba03 Alpha V0.6.8 2020-02-04 19:28:44 +08:00
MrZ_26
d8cbfa72ac Alpha V0.6.5 2020-02-04 19:28:33 +08:00
12 changed files with 140 additions and 86 deletions

BIN
BGM/infinite.ogg Normal file

Binary file not shown.

BIN
SFX/fail.ogg Normal file

Binary file not shown.

BIN
SFX/win.ogg Normal file

Binary file not shown.

View File

@@ -245,10 +245,10 @@ function love.touchpressed(id,x,y)
if scene=="play"and setting.virtualkeySwitch then
local t=onVirtualkey(x,y)
if t then
pressKey(t)
pressKey(t,players[1])
end
elseif scene=="setting3"then
sel=nil
x,y=convert(x,y)
for K=1,#virtualkey do
local b=virtualkey[K]
if (x-b[1])^2+(y-b[2])^2<b[3]then
@@ -276,10 +276,10 @@ function love.touchreleased(id,x,y)
end
elseif scene=="setting3"and sel then
x,y=convert(x,y)
dx,dy=dx*screenK,dy*screenK
if sel then
local b=virtualkey[sel]
b[1],b[2]=int(b[1]/snapLevelValue[snapLevel]+.5)*40,int(b[2]/snapLevelValue[snapLevel]+.5)*snapLevelValue[snapLevel]
local k=snapLevelValue[snapLevel]
b[1],b[2]=int(b[1]/k+.5)*k,int(b[2]/k+.5)*k
end
end
end

View File

@@ -9,7 +9,7 @@ function love.conf(t)
t.audio.mixwithsystem=true--Switch on to keep background music playing
local W=t.window
W.title="Techmino V0.5"
W.title="Techmino V0.68"
W.icon="/image/icon.png"
W.width,W.height=1280,720
W.borderless=X

View File

@@ -132,17 +132,17 @@ function throwBadge(s,r,amount)--Player id
ins(FX.badge,{x1,y1,x2,y2,t=0,size=(10+min(amount,10))*.1})
end
function freshgho()
if not P.gameEnv._20G then
P.y_img=P.cy>#field+1 and #field+1 or P.cy
while not ifoverlap(cb,cx,y_img-1)do
P.y_img=P.y_img-1
end
else
if P.gameEnv._20G or keyPressing[7]and gameEnv.sdarr==0 then
while not ifoverlap(cb,cx,cy-1)do
P.cy=P.cy-1
P.spinLast=false
end
P.y_img=P.cy
else
P.y_img=P.cy>#field+1 and #field+1 or P.cy
while not ifoverlap(cb,cx,y_img-1)do
P.y_img=P.y_img-1
end
end
end
function freshLockDelay()
@@ -221,7 +221,7 @@ function pressKey(i,player)
ins(keyTime,1,frame)rem(keyTime,11)
cstat.key=cstat.key+1
if not player then stat.key=stat.key+1 end
if player.id==1 then stat.key=stat.key+1 end
--Key count
end
-- if playmode=="recording"then ins(rec,{i,frame})end
@@ -321,24 +321,25 @@ function drop()
P.combo=P.combo+1--combo=0 is under
if cc==4 then
if b2b>480 then
if b2b>500 then
showText("Tetris B2B2B","fly",70)
csend=6
exblock=exblock+2
sendTime=80
exblock=exblock+1
elseif b2b>=100 then
showText("Tetris B2B","drive",70)
sendTime=70
csend=5
exblock=exblock+1
else
showText("Tetris","stretch",80)
sendTime=60
csend=4
end
P.b2b=P.b2b+100
sendTime=60
P.cstat.tetris=P.cstat.tetris+1
elseif cc>0 then
if dospin then
if b2b>480 then
if b2b>500 then
showText(spinName[cc][bn].." B2B2B","spin",40)
csend=b2bATK[cc]+1
exblock=exblock+1
@@ -372,7 +373,7 @@ function drop()
if dospin then
showText(spinName[0][bn],"appear",50)
SFX("spin_0")
P.b2b=b2b+40
P.b2b=b2b+30
end
end
@@ -382,7 +383,9 @@ function drop()
exblock=exblock+2
sendTime=sendTime+30
SFX("perfectclear")
P.b2b=b2b+150
if cstat.piece>10 then
P.b2b=600
end
end
csend=csend+(renATK[combo]or 4)
@@ -403,8 +406,8 @@ function drop()
csend=int(csend)
--Buffs
stat.atk=stat.atk+csend
P.cstat.atk=P.cstat.atk+csend
if P.id==1 then stat.atk=stat.atk+csend end
--ATK statistics
while csend>0 and P.atkBuffer[1]do
@@ -423,14 +426,19 @@ function drop()
end
end
if csend>0 then
showText(csend,"appear",30,50)
showText(csend,"zoomout",25,70)
if #players.alive>1 then
garbageSend(P.id,csend,sendTime)
end
end
elseif cc==0 then
if P.b2b>450 then
P.b2b=max(b2b-2,450)
elseif P.b2b>100 then
P.b2b=max(b2b-5,100)
end
garbageRelease()
end--Send attack
end
if id==1 then
stat.piece,stat.row=stat.piece+1,stat.row+cc
end

View File

@@ -73,7 +73,7 @@ end
sfx={
"button",
"ready","start",
"ready","start","win","fail",
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"drop","fall",
@@ -89,6 +89,7 @@ bgm={
"race",
"push",
"reason",
"infinite",
}
prevMenu={
@@ -108,15 +109,17 @@ prevMenu={
main="quit",
}
modeID={"sprint","marathon","zen","solo","death","blind","tetris41","asymsolo","gmroll","p2","p3","p4"}
modeName={"Sprint","Marathon","Zen","1v1","Death","Blind","Tetris 41","Asymmetry solo","GM roll","2P","3P","4P"}
modeID={"sprint","marathon","zen","infinite","solo","death","blind","puzzle","tetris41","asymsolo","gmroll","p2","p3","p4"}
modeName={"Sprint","Marathon","Zen","Infinite","1v1","Death","Blind","Puzzle","Tetris 41","Asymmetry solo","GM roll","2P","3P","4P"}
modeInfo={
sprint="Clear 40 Lines",
marathon="Clear 200 Lines",
zen="Clear 200 Lines without gravity",
infinite="Infinite game,infinite happiness",
solo="Beat AI",
death="Survive under terrible speed",
blind="Invisible board!",
puzzle="Your keyboard broke",
tetris41="Melee fight with 40 AIs",
asymsolo=" See-->",
gmroll="Who want to be the grand master?",
@@ -138,10 +141,10 @@ ren_n={"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","
percent0to5={[0]="0%","20%","40%","60%","80%","100%",}
marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0}
death_lock={10,9,8,7,6}
death_wait={6,5,4,3,2}
death_fall={10,8,7,6,5}
snapLevelValue={1,10,20,40,80}
death_lock={10,9,9,8,8}
death_wait={6,6,5,5,4}
death_fall={10,9,8,7,6}
snapLevelValue={1,10,20,40,60,80}
snapLevelName={"Free pos","Snap-10","Snap-20","Snap-40","Snap-60","Snap-80"}
act={
@@ -190,8 +193,18 @@ act={
count=60+26--Althour'z neim
end,
insDown=function()if cy~= y_img then P.cy,P.lockDelay,P.spinLast=y_img,gameEnv.lock,false end end,
insLeft=function()while not ifoverlap(cb,cx-1,cy)do P.cx,P.lockDelay=cx-1,gameEnv.lock;freshgho()end end,
insRight=function()while not ifoverlap(cb,cx+1,cy)do P.cx,P.lockDelay=cx+1,gameEnv.lock;freshgho()end end,
insLeft=function()
while not ifoverlap(cb,cx-1,cy)do
P.cx,P.lockDelay=cx-1,gameEnv.lock
freshgho()
end
end,
insRight=function()
while not ifoverlap(cb,cx+1,cy)do
P.cx,P.lockDelay=cx+1,gameEnv.lock
freshgho()
end
end,
down1=function()if cy~=y_img then P.cy=cy-1 end end,
down4=function()for i=1,4 do if cy~=y_img then P.cy=cy-1 else break end end end,
quit=function()Event.gameover.lose()end,
@@ -227,8 +240,8 @@ TRS={
[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}},
[31]={{0,0},{0,-1},{0,1},{1,0},{-1,0},{0,2}},
[13]={{0,0},{0,-1},{0,1},{-1,0},{1,0},{0,2}},
[31]={{0,0},{0,1},{0,-1},{1,0},{-1,0},{0,2}},
},
[2]={
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
@@ -241,8 +254,8 @@ TRS={
[03]={{0,0},{1,0},{1,1},{0,-2},{1,-2},{0,1}},
[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}},
[31]={{0,0},{0,1},{0,-1},{-1,0},{1,0},{0,2}},
[13]={{0,0},{0,1},{0,-1},{1,0},{-1,0},{0,2}},
[31]={{0,0},{0,-1},{0,1},{-1,0},{1,0},{0,2}},
},
[5]={
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2}},
@@ -262,8 +275,8 @@ TRS={
[01]={{0,0},{1,0},{-2,0},{-2,-1},{1,2}},
[10]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
[12]={{0,0},{-1,0},{2,0},{-1,2},{2,-1}},
[21]={{0,0},{-2,0},{1,0},{-2,1},{1,-2}},
[23]={{0,0},{2,0},{-1,0},{2,1},{-1,-2}},
[21]={{0,0},{-2,0},{1,0},{1,-2},{-2,1}},
[23]={{0,0},{2,0},{-1,0},{-1,-2},{2,1}},
[32]={{0,0},{-2,0},{1,0},{-2,-1},{1,2}},
[30]={{0,0},{1,0},{-2,0},{1,-2},{-2,1}},
[03]={{0,0},{-1,0},{2,0},{2,-1},{-1,2}},
@@ -322,7 +335,7 @@ Buttons={
code=function()
setting.bgblock=not setting.bgblock
if not setting.bgblock then
for i=1,116 do
for i=1,16 do
BGblockList[i].v=3*BGblockList[i].v
end
end
@@ -355,7 +368,7 @@ Buttons={
end--Reset virtualkey
end},
{x=640,y=310,w=170,h=80,t=function()return snapLevelName[snapLevel]end,code=function()
snapLevel=snapLevel%5+1
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

View File

@@ -114,7 +114,18 @@ loadmode={
}
createPlayer(1,340,15)
curBG="strap"
BGM("reason")
BGM("infinite")
end,
infinite=function()
modeEnv={
drop=1e99,
lock=1e99,
wait=1,
fall=1,
}
createPlayer(1,340,15)
curBG="glow"
BGM("infinite")
end,
gmroll=function()
modeEnv={
@@ -160,10 +171,28 @@ loadmode={
curBG="game2"
BGM("push")
end,
puzzle=function()
modeEnv={
hold=false,
das=0,
arr=0,
_20G=true,
drop=0,
lock=1e99,
wait=1,
fall=10,
target=40,
reach=Event.gameover.win,
}
createPlayer(1,340,15)
curBG="glow"
BGM("way")
end,
tetris41=function()
modeEnv={
wait=1,
fall=1,
freshLimit=15,
}
royaleMode=true
createPlayer(1,340,15)--Player
@@ -227,7 +256,7 @@ loadmode={
p2=function()
modeEnv={
wait=1,
fall=30,
fall=1,
freshLimit=15,
}
createPlayer(1,20,15)
@@ -239,7 +268,7 @@ loadmode={
p3=function()
modeEnv={
wait=1,
fall=30,
fall=1,
freshLimit=15,
}
createPlayer(1,20,100,.65)
@@ -252,7 +281,7 @@ loadmode={
p4=function()
modeEnv={
wait=1,
fall=30,
fall=1,
freshLimit=15,
}
createPlayer(1,25,150,.5)
@@ -279,6 +308,7 @@ Event={
end
end
showText("WIN","appear",100,nil,true)
if P.id==1 and players[2]and players[2].ai then SFX("win")end
ins(task,Event.task.win)
end,
lose=function()
@@ -312,6 +342,7 @@ Event={
visTime[i][j]=min(visTime[i][j],20)
end
end
if P.id==1 and players[2]and players[2].ai then SFX("fail")end
ins(task,Event.task.lose)
end,
},
@@ -393,6 +424,14 @@ mesDisp={
setFont(75)
mStr(max(200-P.cstat.row,0),-75,280)
end,
infinite=function()
setFont(50)
mStr(cstat.atk,-75,320)
mStr(format("%.2f",2.5*cstat.atk/cstat.piece),-75,430)
setFont(20)
gc.print("Attack",-103,360)
gc.print("Efficiency",-114,472)
end,
gmroll=function()
setFont(35)
gc.print("Tetris",-120,390)
@@ -411,6 +450,10 @@ mesDisp={
mStr(gameEnv.target,-75,380)
gc.line(-120,377,-30,377)
end,
puzzle=function()
setFont(75)
mStr(max(40-P.cstat.row,0),-75,280)
end,
tetris41=function()
gc.draw(badgeIcon,-120,150,nil,1.5)
setFont(50)
@@ -503,7 +546,7 @@ stat={
spin=0,
}
--User Data&User Setting
--------------------------------Warning!_G is __indexed to players[n] when changing any player's data!
--------------------------------Wrning!_G __index Ply[n] when chng any playr's elments!
require("list")
require("texture")
require("ai")
@@ -512,7 +555,7 @@ require("sysfunc")
require("gamefunc")
require("timer")
require("paint")
require("game_scene")
require("scene")
require("call&sys")
userData=fs.newFile("userdata")

View File

@@ -81,6 +81,16 @@ FX={
gc.setColor(1,1,1,a*(rnd()+.5))
mStr(t.text,150,250-t.font*.5+t.dy)
end,
zoomout=function(t,a)
gc.push("transform")
setFont(t.font)
gc.translate(150,290+t.dy)
gc.setColor(1,1,1,a)
local k=t.t^.5*.2+1
gc.scale(k,k)
mStr(t.text,0,-t.font*.5)
gc.pop()
end
}
function drawButton()
@@ -195,7 +205,7 @@ end
function Pnt.main()
gc.setColor(1,1,1)
setFont(30)
gc.print("Alpha V0.6",370,150)
gc.print("Alpha V0.68",370,150)
gc.print(system,530,110)
gc.draw(titleImage,30,30)
end
@@ -243,28 +253,8 @@ function Pnt.play()
drawPixel(j,i,field[j][i],min(visTime[j][i],20)*.05)
end
end
else
gc.setColor(1,1,1,falling/gameEnv.fall)
gc.rectangle("fill",0,600-30*j,320,30)
end
end--Field
if not P.result then
if gameEnv.ghost then
for i=1,r do for j=1,c do
if cb[i][j]>0 then
drawPixel(i+y_img-1,j+cx-1,bn,.3)
end
end end
end--Ghost
if waiting<=0 then
gc.setColor(1,1,1)
for i=1,r do for j=1,c do
if cb[i][j]>0 then
drawPixel(i+cy-1,j+cx-1,bn,1)
end
end end--Block
end
end
gc.setColor(1,1,1)
gc.draw(PTC.dust[p])--Draw game field
gc.setStencilTest()--In-playField mask
@@ -283,13 +273,13 @@ function Pnt.play()
if not a.sent then
if a.countdown>0 then
gc.setColor(attackColor[a.lv][1])
gc.rectangle("fill",305,600-h,8,-bar+5)
gc.rectangle("fill",315,600-h,8,-bar+5)
gc.setColor(attackColor[a.lv][2])
gc.rectangle("fill",305,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
gc.rectangle("fill",315,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
--Timing
else
attackColor.animate[a.lv]((sin((Timer()-i)*20)+1)*.5)
gc.rectangle("fill",305,600-h,8,-bar+5)
gc.rectangle("fill",315,600-h,8,-bar+5)
--Warning
end
end
@@ -367,31 +357,31 @@ function Pnt.play()
end
if a.countdown>0 then
gc.setColor(attackColor[a.lv][1])
gc.rectangle("fill",305,600-h,8,-bar+5)
gc.rectangle("fill",308,600-h,8,-bar+5)
gc.setColor(attackColor[a.lv][2])
gc.rectangle("fill",305,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
gc.rectangle("fill",308,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
--Timing
else
attackColor.animate[a.lv]((sin((Timer()-i)*20)+1)*.5)
gc.rectangle("fill",305,600-h,8,-bar+5)
gc.rectangle("fill",308,600-h,8,-bar+5)
--Warning
end
else
gc.setColor(attackColor[a.lv][1])
bar=bar*(20-a.time)*.05
gc.rectangle("fill",305,600-h,8,-bar+5)
gc.rectangle("fill",308,600-h,8,-bar+5)
--Disappear
end
h=h+bar
if h>600 then break end
end--Buffer line
gc.setColor(b2b<100 and color.white or b2b<=480 and color.lightRed or color.lightBlue)
gc.rectangle("fill",-15,600,10,-b2b1)
gc.setColor(b2b<100 and color.white or b2b<=500 and color.lightRed or color.lightBlue)
gc.rectangle("fill",-17,600,10,-b2b1)
gc.setColor(color.red)
gc.rectangle("fill",-20,600-100,16,5)
gc.rectangle("fill",-23,600-100,16,5)
gc.setColor(color.blue)
gc.rectangle("fill",-20,600-480,16,5)
gc.rectangle("fill",-23,600-500,16,5)
--B2B bar
setFont(40)
@@ -432,7 +422,7 @@ function Pnt.play()
gc.setColor(1,1,1)
setFont(40)
gc.print(format("%0.2f",time),-125,530)--Draw time
gc.print(format("%.2f",time),-130,530)--Draw time
if mesDisp[gamemode]then mesDisp[gamemode]()end--Draw other message
setFont(15)

View File

@@ -13,7 +13,7 @@ function sysSFX(s,v)
end
end
function SFX(s,v)
if setting.sfx then
if setting.sfx and not P.ai then
local n=1
while sfx[s][n]:isPlaying()do
n=n+1
@@ -23,10 +23,6 @@ function SFX(s,v)
break
end
end
if P.id>1 then
v=1/(#players.alive-1)
-- if v<.02 then return nil end
end
sfx[s][n]:setVolume(v or 1)
sfx[s][n]:play()
end

View File

@@ -106,7 +106,7 @@ function Tmr.play(dt)
v=0 for i=2,10 do v=v+i*(i-1)*7.2/(frame-dropTime[i])end P.dropSpeed=dropSpeed*.99+v*.1
--Update speeds
if P.ai then
if P.ai and waiting<=0 then
P.ai.controlDelay=P.ai.controlDelay-1
if P.ai.controlDelay==0 then
if #P.ai.controls>0 then
@@ -189,8 +189,12 @@ function Tmr.play(dt)
end
end
P.b2b1=P.b2b1*.93+P.b2b*.07
if P.b2b>480 then P.b2b=P.b2b-1 end
--ALive
if P.b2b>500 then
P.b2b=P.b2b-.2
elseif P.b2b>100 then
P.b2b=P.b2b-.15
end
--Alive
else
P.keySpeed=keySpeed*.96+cstat.key/time*60*.04
P.dropSpeed=dropSpeed*.96+cstat.piece/time*60*.04