Compare commits

...

24 Commits

Author SHA1 Message Date
MrZ_26
b354604c77 Alpha V0.7.21 2020-02-04 19:35:09 +08:00
MrZ_26
5eea97dd8b Alpha V0.7.20 2020-02-04 19:34:54 +08:00
MrZ_26
f0a118e714 Alpha V0.7.19 2020-02-04 19:34:43 +08:00
MrZ_26
3019f83999 Alpha V0.7.18 2020-02-04 19:34:16 +08:00
MrZ_26
438046f77f Alpha V0.7.17 2020-02-04 19:34:07 +08:00
MrZ_26
830f0ffbed Alpha V0.7.16 2020-02-04 19:33:52 +08:00
MrZ_26
849e5b586e Alpha V0.7.15 2020-02-04 19:33:41 +08:00
MrZ_26
f82e979f9c Alpha V0.7.14 2020-02-04 19:33:20 +08:00
MrZ_26
c9a3e3ce1b Alpha V0.7.13+ 2020-02-04 19:33:03 +08:00
MrZ_26
72dcb84662 Alpha V0.7.12 2020-02-04 19:32:38 +08:00
MrZ_26
4af2126254 Alpha V0.7.11 2020-02-04 19:32:26 +08:00
MrZ_26
42d7b1be94 Alpha V0.7.10 2020-02-04 19:32:10 +08:00
MrZ_26
a31474c43a Alpha V0.7.9 2020-02-04 19:31:45 +08:00
MrZ_26
75c7955bb5 Alpha V0.7.8 2020-02-04 19:31:31 +08:00
MrZ_26
c35152cf6e Alpha V0.7.7 2020-02-04 19:31:17 +08:00
MrZ_26
1b0ad009b0 Alpha V0.7.6 2020-02-04 19:30:59 +08:00
MrZ_26
e7c797bf14 Alpha V0.7.5 2020-02-04 19:30:42 +08:00
MrZ_26
e281634f72 Alpha V0.7.4 2020-02-04 19:30:30 +08:00
MrZ_26
7eea017c72 Alpha V0.7.3 2020-02-04 19:30:03 +08:00
MrZ_26
f0cca3092a Alpha V0.7.2 2020-02-04 19:29:42 +08:00
MrZ_26
1447893378 Alpha V0.7.1 2020-02-04 19:29:24 +08:00
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
MrZ_26
31fd2c0e72 Alpha V0.6 2020-02-04 19:28:01 +08:00
133 changed files with 5535 additions and 2098 deletions

BIN
BGM/8-bit happiness.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
BGM/cruelty.ogg Normal file

Binary file not shown.

BIN
BGM/end.ogg Normal file

Binary file not shown.

BIN
BGM/final.ogg Normal file

Binary file not shown.

BIN
BGM/infinite.ogg Normal file

Binary file not shown.

BIN
BGM/newera.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
BGM/rockblock.ogg Normal file

Binary file not shown.

BIN
BGM/secret7th.ogg Normal file

Binary file not shown.

BIN
BGM/secret8th.ogg Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,14 +0,0 @@
local count=0
BGblockList={}for i=1,16 do BGblockList[i]={}end
function getNewBlock()
count=count+1
if count==17 then count=1 end
local t=BGblockList[count]
t.bn,t.size=rnd(7),2+3*rnd()
t.b=blocks[t.bn][rnd(0,3)]
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
t.y=-#t.b*30*t.size
t.v=t.size*(1+rnd())
return t
end

BIN
SFX/blip_1.ogg Normal file

Binary file not shown.

BIN
SFX/blip_2.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
SFX/collect.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
SFX/emit.ogg Normal file

Binary file not shown.

BIN
SFX/fail.ogg Normal file

Binary file not shown.

BIN
SFX/lock.ogg Normal file

Binary file not shown.

BIN
SFX/ren_mega.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
SFX/swipe.ogg Normal file

Binary file not shown.

BIN
SFX/win.ogg Normal file

Binary file not shown.

BIN
VOICE/I_1.ogg Normal file

Binary file not shown.

BIN
VOICE/I_2.ogg Normal file

Binary file not shown.

BIN
VOICE/J_1.ogg Normal file

Binary file not shown.

BIN
VOICE/J_2.ogg Normal file

Binary file not shown.

BIN
VOICE/L_1.ogg Normal file

Binary file not shown.

BIN
VOICE/L_2.ogg Normal file

Binary file not shown.

BIN
VOICE/O_1.ogg Normal file

Binary file not shown.

BIN
VOICE/O_2.ogg Normal file

Binary file not shown.

BIN
VOICE/PC_1.ogg Normal file

Binary file not shown.

BIN
VOICE/S_1.ogg Normal file

Binary file not shown.

BIN
VOICE/S_2.ogg Normal file

Binary file not shown.

BIN
VOICE/T_1.ogg Normal file

Binary file not shown.

BIN
VOICE/T_2.ogg Normal file

Binary file not shown.

BIN
VOICE/Z_1.ogg Normal file

Binary file not shown.

BIN
VOICE/Z_2.ogg Normal file

Binary file not shown.

BIN
VOICE/b2b_1.ogg Normal file

Binary file not shown.

BIN
VOICE/b2b_2.ogg Normal file

Binary file not shown.

BIN
VOICE/b2b_3.ogg Normal file

Binary file not shown.

BIN
VOICE/b3b_1.ogg Normal file

Binary file not shown.

BIN
VOICE/double_1.ogg Normal file

Binary file not shown.

BIN
VOICE/double_2.ogg Normal file

Binary file not shown.

BIN
VOICE/double_3.ogg Normal file

Binary file not shown.

BIN
VOICE/lose_1.ogg Normal file

Binary file not shown.

BIN
VOICE/lose_2.ogg Normal file

Binary file not shown.

BIN
VOICE/lose_3.ogg Normal file

Binary file not shown.

BIN
VOICE/mini_1.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_1.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_11.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_12.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_13.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_2.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_21.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_22.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_3.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_31.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_4.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o0.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o1.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o2.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o3.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o4.ogg Normal file

Binary file not shown.

BIN
VOICE/nya_o5.ogg Normal file

Binary file not shown.

BIN
VOICE/single_1.ogg Normal file

Binary file not shown.

BIN
VOICE/single_2.ogg Normal file

Binary file not shown.

BIN
VOICE/single_3.ogg Normal file

Binary file not shown.

BIN
VOICE/spin-_1.ogg Normal file

Binary file not shown.

BIN
VOICE/spin-_2.ogg Normal file

Binary file not shown.

BIN
VOICE/spin_1.ogg Normal file

Binary file not shown.

BIN
VOICE/spin_2.ogg Normal file

Binary file not shown.

BIN
VOICE/spin_3.ogg Normal file

Binary file not shown.

BIN
VOICE/spin_4.ogg Normal file

Binary file not shown.

BIN
VOICE/spin_5.ogg Normal file

Binary file not shown.

BIN
VOICE/triple_1.ogg Normal file

Binary file not shown.

BIN
VOICE/triple_2.ogg Normal file

Binary file not shown.

BIN
VOICE/tts_1.ogg Normal file

Binary file not shown.

BIN
VOICE/win_1.ogg Normal file

Binary file not shown.

BIN
VOICE/win_2.ogg Normal file

Binary file not shown.

Binary file not shown.

131
ai.lua
View File

@@ -1,12 +1,12 @@
--[[ --[[
HighestBlock HighestBlock
HorizontalTransitions HorizontalTransitions
VerticalTransitions VerticalTransitions
BlockedCells BlockedCells
Wells Wells
FilledLines FilledLines
TetrisShape 4deepShape
BlockedWells; BlockedWells;
]] ]]
dirCount={1,1,3,3,3,0,1} dirCount={1,1,3,3,3,0,1}
spinOffset={ spinOffset={
@@ -18,146 +18,157 @@ spinOffset={
{0,0,0},--O {0,0,0},--O
{2,0,1},--I {2,0,1},--I
}for i=1,7 do spinOffset[i][0]=0 end }for i=1,7 do spinOffset[i][0]=0 end
--[[controlname: --[[
controlname:
1~5:mL,mR,rR,rL,rF, 1~5:mL,mR,rR,rL,rF,
6~9:hD,sD,H,R, 6~10:hD,sD,H,A,R,
10~12:LL,RR,DD 11~13:LL,RR,DD
]] ]]
FCL={ FCL={
[1]={ [1]={
{{10},{10,2},{1},{},{2},{2,2},{11,1},{11}}, {{11},{11,2},{1},{},{2},{2,2},{12,1},{12}},
{{10,4},{10,3},{10,2,3},{4},{3},{2,3},{2,2,3},{11,4},{11,3}}, {{11,4},{11,3},{11,2,3},{4},{3},{2,3},{2,2,3},{12,4},{12,3}},
}, },
[3]={ [3]={
{{10},{10,2},{1},{},{2},{2,2},{11,1},{11},}, {{11},{11,2},{1},{},{2},{2,2},{12,1},{12},},
{{3,10},{10,3},{10,2,3},{1,3},{3},{2,3},{2,2,3},{11,1,3},{11,3},}, {{3,11},{11,3},{11,2,3},{1,3},{3},{2,3},{2,2,3},{12,1,3},{12,3},},
{{10,5},{10,2,5},{1,5},{5},{2,5},{2,2,5},{11,1,5},{11,5},}, {{11,5},{11,2,5},{1,5},{5},{2,5},{2,2,5},{12,1,5},{12,5},},
{{10,4},{10,2,4},{1,4},{4},{2,4},{2,2,4},{11,1,4},{11,4},{4,11},}, {{11,4},{11,2,4},{1,4},{4},{2,4},{2,2,4},{12,1,4},{12,4},{4,12},},
}, },
[6]={ [6]={
{{10},{10,2},{1,1},{1},{},{2},{2,2},{11,1},{11},}, {{11},{11,2},{1,1},{1},{},{2},{2,2},{12,1},{12},},
}, },
[7]={ [7]={
{{10},{10,2},{1},{},{2},{11,1},{11},}, {{11},{11,2},{1},{},{2},{12,1},{12},},
{{4,10},{10,4},{10,3},{1,4},{4},{3},{2,3},{11,4},{11,3},{3,11},}, {{4,11},{11,4},{11,3},{1,4},{4},{3},{2,3},{12,4},{12,3},{3,12},},
}, },
} }
FCL[2]=FCL[1] FCL[2]=FCL[1]
FCL[4]=FCL[3] FCL[4]=FCL[3]
FCL[5]=FCL[3] FCL[5]=FCL[3]
clearScore={[0]=0,0,2,4,12}
function ifoverlapAI(f,bk,x,y) function ifoverlapAI(f,bk,x,y)
if y<1 then return true end if y<1 then return true end
if y>#f then return nil end if y>#f then return end
for i=1,#bk do for j=1,#bk[1]do for i=1,#bk do for j=1,#bk[1]do
if f[y+i-1]and bk[i][j]>0 and f[y+i-1][x+j-1]>0 then return true end if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then return true end
end end end end
end end
function resetField(f0,f,start) function resetField(f0,f,start)
while f[start]do ::L::if f[start]then
removeRow(f,start) removeRow(f,start)
goto L
end end
for i=start,#f0 do for i=start,#f0 do
f[i]=getNewRow() f[i]=getNewRow(0)
for j=1,10 do for j=1,10 do
f[i][j]=f0[i][j] f[i][j]=f0[i][j]
end end
end end
end end
function getScore(field,cb,cx,cy) function getScore(field,bn,cb,cx,cy)
local score=0
local highest=0 local highest=0
local height=getNewRow() local height=getNewRow(0)
local rough=0
local clear=0 local clear=0
local hole=0 local hole=0
for i=cy+#cb-1,cy,-1 do for i=cy+#cb-1,cy,-1 do
local f=true
for j=1,10 do for j=1,10 do
if field[i][j]==0 then f=false;break end if field[i][j]==0 then goto L end
end
if f then
removeRow(field,i)
clear=clear+1
end end
removeRow(field,i)
clear=clear+1
::L::
end end
if #field==0 then return 9e99 end--PC best if #field==0 then return 9e99 end--PC best
for x=1,10 do for x=1,10 do
local h=#field local h=#field
while field[h][x]==0 and h>1 do ::L::if field[h][x]==0 and h>1 then
h=h-1 h=h-1
goto L
end end
height[x]=h height[x]=h
if x>3 and x<8 and h>highest then highest=h end if x>3 and x<8 and h>highest then highest=h end
if h>1 then if h>1 then
for h=h-1,1,-1 do for h=h-1,1,-1 do
if field[h][x]==0 then hole=hole+1 if hole>5 then break end end if field[h][x]==0 then
hole=hole+1
if hole==5 then break end
end
end end
end end
end end
local h1,mh1=0,0
for x=1,9 do for x=1,9 do
local dh=abs(height[x]-height[x]) local dh=abs(height[x]-height[x+1])
if dh>1 then if dh==1 then
rough=rough+min(dh^2,10) h1=h1+1
if h1>mh1 then mh1=h1 end
else
h1=0
end end
end end
ins(freeRow,height) ins(freeRow,height)
return score=
-highest*5 #field*20
-rough*15 -cy*35
-cy*20 -#cb*25
-#cb*10 +clearScore[clear]*(8+#field)
+clear^2*4 -hole*50
-hole*15 if #field>6 then score=score-highest*5 end
if mh1>3 then score=score-40-mh1*30 end
return score
end end
function AI_getControls(ctrl) function AI_getControls(ctrl)
local Tfield={}--test field local Tfield={}--test field
local field_org=field local field_org=P.field
for i=1,#field_org do for i=1,#field_org do
Tfield[i]=getNewRow() Tfield[i]=getNewRow(0)
for j=1,10 do for j=1,10 do
Tfield[i][j]=field_org[i][j] Tfield[i][j]=field_org[i][j]
end end
end end
local best={x=1,dir=0,hold=false,score=-9e99} local best={x=1,dir=0,hold=false,score=-9e99}
for ifhold=0,1 do for ifhold=0,P.gameEnv.hold and 1 or 0 do
local bn=ifhold==0 and bn or hn>0 and hn or nxt[1] local bn=ifhold==0 and P.cur.id or P.hold.id>0 and P.hold.id or P.next[1].id
for dir=0,dirCount[bn] do--each dir for dir=0,dirCount[bn] do--each dir
local cb=blocks[bn][dir] local cb=blocks[bn][dir]
for cx=1,11-#cb[1]do--each pos for cx=1,11-#cb[1]do--each pos
local cy=#Tfield+1 local cy=#Tfield+1
while not ifoverlapAI(Tfield,cb,cx,cy-1)do ::L::if not ifoverlapAI(Tfield,cb,cx,cy-1)then
cy=cy-1 cy=cy-1
goto L
end--move to bottom end--move to bottom
for i=1,#cb do for i=1,#cb do
local y=cy+i-1 local y=cy+i-1
if not Tfield[y]then Tfield[y]=getNewRow()end if not Tfield[y]then Tfield[y]=getNewRow(0)end
for j=1,#cb[1]do for j=1,#cb[1]do
if cb[i][j]~=0 then if cb[i][j]then
Tfield[y][cx+j-1]=1 Tfield[y][cx+j-1]=1
end end
end end
end--simulate lock end--simulate lock
local score=getScore(Tfield,cb,cx,cy) local score=getScore(Tfield,bn,cb,cx,cy)
if score>best.score then if score>best.score then
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score} best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
end end
resetField(field_org,Tfield,cy) resetField(field_org,Tfield,cy)
end end
end end
end--ifHold loop end
while #Tfield>0 do ::L::
if #Tfield>0 then
removeRow(Tfield,1) removeRow(Tfield,1)
goto L
end--Release cache end--Release cache
if best.hold then if best.hold then
ins(ctrl,8) ins(ctrl,8)
end end
local l=FCL[best.bn][best.dir+1][best.x] local l=FCL[best.bn][best.dir+1][best.x]
for i=1,#l do for i=1,#l do
ins(ctrl,l[i]) ins(ctrl,l[i])
end end
ins(ctrl,6)
ins(ctrl,6)--harddrop
end end

File diff suppressed because it is too large Load Diff

BIN
cb.ttf

Binary file not shown.

37
class.lua Normal file
View File

@@ -0,0 +1,37 @@
Task={}
metatable_task={__index=Task}
function newTask(code,P,data)
local obj={
code=code,
P=P,
data=data,
}
setmetatable(obj,metatable_task)
ins(Task,obj)
end
function clearTask(opt)
if opt=="all"then
while Task[1]do
rem(Task,i)
end
elseif opt=="play"then
for i=#Task,1,-1 do
if Task[i].P then
rem(Task,i)
end
end
else--Player table
for i=#Task,1,-1 do
if Task[i].P==P then
rem(Task,i)
end
end
end
end
function Task:update()
if(not self.P or self.P and scene=="play")and self:code(self.P,self.data)then
for i=#Task,1,-1 do
if Task[i]==self then rem(Task,i)return end
end--Destroy
end
end

View File

@@ -1,26 +1,26 @@
function love.conf(t) function love.conf(t)
local X=nil local X=nil
t.identity="Techmino"--The name of the save directory (string) t.identity="Techmino"--Save directory name
t.appendidentity=X--Search files in source directory before save directory (boolean) t.appendidentity=X--If search files in source before save directory
t.version="11.1" t.version="11.1"
t.console=X t.console=X
t.accelerometerjoystick=X--Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean) t.accelerometerjoystick=X--If exposing accelerometer on iOS and Android as a Joystick
t.gammacorrect=true t.gammacorrect=X
t.audio.mixwithsystem=true--Switch on to keep background music playing t.audio.mixwithsystem=true--Switch on to keep sysBGM
local W=t.window local W=t.window
W.title="Techmino V0.5" W.title="Techmino V0.7.21"
W.icon="/image/icon.png" W.icon="/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360
W.borderless=X W.borderless=X
W.resizable=true W.resizable=true
W.minwidth,W.minheight=640,360
W.fullscreentype="desktop"--Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string) W.fullscreentype="desktop"--Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string)
W.fullscreen=X W.fullscreen=X
W.vsync=1 W.vsync=0--0→∞fps
W.msaa=X--The number of samples to use with multi-sampled antialiasing (number) W.msaa=X--The number of samples to use with multi-sampled antialiasing (number)
W.depth=X--The number of bits per sample in the depth buffer W.depth=X--Bits per sample in the depth buffer
W.stencil=8--The number of bits per sample in the stencil buffer W.stencil=1--The number of bits per sample in the stencil buffer
W.display=1--Monitor ID W.display=1--Monitor ID
W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean) W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean)
W.x,W.y=nil W.x,W.y=nil

1167
dataList.lua Normal file

File diff suppressed because it is too large Load Diff

BIN
font.ttf Normal file

Binary file not shown.

View File

@@ -1,63 +0,0 @@
game={}
function game.load()
scene="load"
curBG="none"
loading=1--Loading mode
loadnum=1--Loading counter
loadprogress=0--Loading bar
end
function game.intro()
scene="intro"
curBG="none"
end
function game.main()
scene="main"
curBG="none"
BGM("blank")
collectgarbage()
end
function game.mode()
saveData()
modeSel=modeSel or 1
if players then restockRow()end--collectGarbage
scene="mode"
curBG="none"
BGM("blank")
end
function game.play()
scene="play"
--curBG="game1"
resetGameData()
sysSFX("ready")
mouseShow=false
end
function game.setting()
scene="setting"
curBG="none"
BGM("blank")
end--Normal setting
function game.setting2()
scene="setting2"
curBG="none"
keyssetting=nil
BGM("blank")
end--Advanced setting and keyboard&joystick setting
function game.setting3()
scene="setting3"
curBG="game1"
keyssetting=nil
BGM("blank")
end--Touch setting
function game.help()
scene="help"
curBG="none"
BGM("blank")
end
function game.stat()
scene="stat"
curBG="none"
BGM("blank")
end
function game.quit()
love.event.quit()
end

File diff suppressed because it is too large Load Diff

BIN
image/block.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

Some files were not shown because too many files have changed in this diff Show More