Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5eea97dd8b | ||
|
|
f0a118e714 | ||
|
|
3019f83999 | ||
|
|
438046f77f | ||
|
|
830f0ffbed | ||
|
|
849e5b586e | ||
|
|
f82e979f9c | ||
|
|
c9a3e3ce1b | ||
|
|
72dcb84662 | ||
|
|
4af2126254 | ||
|
|
42d7b1be94 | ||
|
|
a31474c43a | ||
|
|
75c7955bb5 | ||
|
|
c35152cf6e | ||
|
|
1b0ad009b0 | ||
|
|
e7c797bf14 | ||
|
|
e281634f72 | ||
|
|
7eea017c72 | ||
|
|
f0cca3092a | ||
|
|
1447893378 |
BIN
BGM/8-bit happiness.ogg
Normal file
BIN
BGM/blank.ogg
BIN
BGM/cruelty.ogg
Normal file
BIN
BGM/end.ogg
Normal file
BIN
BGM/final.ogg
Normal file
BIN
BGM/infinite.ogg
BIN
BGM/newera.ogg
Normal file
BIN
BGM/push.ogg
BIN
BGM/race.ogg
BIN
BGM/reason.ogg
BIN
BGM/rockblock.ogg
Normal file
BIN
BGM/secret7th.ogg
Normal file
BIN
BGM/secret8th.ogg
Normal file
BIN
BGM/way.ogg
BIN
SFX/blip_1.ogg
Normal file
BIN
SFX/blip_2.ogg
Normal file
BIN
SFX/button.ogg
BIN
SFX/collect.ogg
Normal file
BIN
SFX/drop.ogg
BIN
SFX/emit.ogg
Normal file
BIN
SFX/lock.ogg
Normal file
BIN
SFX/ren_mega.ogg
Normal file
BIN
SFX/spin.ogg
BIN
SFX/swipe.ogg
Normal file
BIN
VOICE/I_1.ogg
Normal file
BIN
VOICE/I_2.ogg
Normal file
BIN
VOICE/J_1.ogg
Normal file
BIN
VOICE/J_2.ogg
Normal file
BIN
VOICE/L_1.ogg
Normal file
BIN
VOICE/L_2.ogg
Normal file
BIN
VOICE/O_1.ogg
Normal file
BIN
VOICE/O_2.ogg
Normal file
BIN
VOICE/PC_1.ogg
Normal file
BIN
VOICE/S_1.ogg
Normal file
BIN
VOICE/S_2.ogg
Normal file
BIN
VOICE/T_1.ogg
Normal file
BIN
VOICE/T_2.ogg
Normal file
BIN
VOICE/Z_1.ogg
Normal file
BIN
VOICE/Z_2.ogg
Normal file
BIN
VOICE/b2b_1.ogg
Normal file
BIN
VOICE/b2b_2.ogg
Normal file
BIN
VOICE/b2b_3.ogg
Normal file
BIN
VOICE/b3b_1.ogg
Normal file
BIN
VOICE/double_1.ogg
Normal file
BIN
VOICE/double_2.ogg
Normal file
BIN
VOICE/double_3.ogg
Normal file
BIN
VOICE/lose_1.ogg
Normal file
BIN
VOICE/lose_2.ogg
Normal file
BIN
VOICE/lose_3.ogg
Normal file
BIN
VOICE/mini_1.ogg
Normal file
BIN
VOICE/nya_1.ogg
Normal file
BIN
VOICE/nya_11.ogg
Normal file
BIN
VOICE/nya_12.ogg
Normal file
BIN
VOICE/nya_13.ogg
Normal file
BIN
VOICE/nya_2.ogg
Normal file
BIN
VOICE/nya_21.ogg
Normal file
BIN
VOICE/nya_22.ogg
Normal file
BIN
VOICE/nya_3.ogg
Normal file
BIN
VOICE/nya_31.ogg
Normal file
BIN
VOICE/nya_4.ogg
Normal file
BIN
VOICE/nya_o0.ogg
Normal file
BIN
VOICE/nya_o1.ogg
Normal file
BIN
VOICE/nya_o2.ogg
Normal file
BIN
VOICE/nya_o3.ogg
Normal file
BIN
VOICE/nya_o4.ogg
Normal file
BIN
VOICE/nya_o5.ogg
Normal file
BIN
VOICE/single_1.ogg
Normal file
BIN
VOICE/single_2.ogg
Normal file
BIN
VOICE/single_3.ogg
Normal file
BIN
VOICE/spin-_1.ogg
Normal file
BIN
VOICE/spin-_2.ogg
Normal file
BIN
VOICE/spin_1.ogg
Normal file
BIN
VOICE/spin_2.ogg
Normal file
BIN
VOICE/spin_3.ogg
Normal file
BIN
VOICE/spin_4.ogg
Normal file
BIN
VOICE/spin_5.ogg
Normal file
BIN
VOICE/triple_1.ogg
Normal file
BIN
VOICE/triple_2.ogg
Normal file
BIN
VOICE/tts_1.ogg
Normal file
BIN
VOICE/win_1.ogg
Normal file
BIN
VOICE/win_2.ogg
Normal file
BIN
VOICE/这游戏有问题.ogg
Normal file
131
ai.lua
@@ -1,12 +1,12 @@
|
||||
--[[
|
||||
HighestBlock
|
||||
HorizontalTransitions
|
||||
VerticalTransitions
|
||||
BlockedCells
|
||||
Wells
|
||||
FilledLines
|
||||
TetrisShape
|
||||
BlockedWells;
|
||||
HighestBlock
|
||||
HorizontalTransitions
|
||||
VerticalTransitions
|
||||
BlockedCells
|
||||
Wells
|
||||
FilledLines
|
||||
4deepShape
|
||||
BlockedWells;
|
||||
]]
|
||||
dirCount={1,1,3,3,3,0,1}
|
||||
spinOffset={
|
||||
@@ -18,146 +18,157 @@ spinOffset={
|
||||
{0,0,0},--O
|
||||
{2,0,1},--I
|
||||
}for i=1,7 do spinOffset[i][0]=0 end
|
||||
--[[controlname:
|
||||
--[[
|
||||
controlname:
|
||||
1~5:mL,mR,rR,rL,rF,
|
||||
6~9:hD,sD,H,R,
|
||||
10~12:LL,RR,DD
|
||||
6~10:hD,sD,H,A,R,
|
||||
11~13:LL,RR,DD
|
||||
]]
|
||||
FCL={
|
||||
[1]={
|
||||
{{10},{10,2},{1},{},{2},{2,2},{11,1},{11}},
|
||||
{{10,4},{10,3},{10,2,3},{4},{3},{2,3},{2,2,3},{11,4},{11,3}},
|
||||
{{11},{11,2},{1},{},{2},{2,2},{12,1},{12}},
|
||||
{{11,4},{11,3},{11,2,3},{4},{3},{2,3},{2,2,3},{12,4},{12,3}},
|
||||
},
|
||||
[3]={
|
||||
{{10},{10,2},{1},{},{2},{2,2},{11,1},{11},},
|
||||
{{3,10},{10,3},{10,2,3},{1,3},{3},{2,3},{2,2,3},{11,1,3},{11,3},},
|
||||
{{10,5},{10,2,5},{1,5},{5},{2,5},{2,2,5},{11,1,5},{11,5},},
|
||||
{{10,4},{10,2,4},{1,4},{4},{2,4},{2,2,4},{11,1,4},{11,4},{4,11},},
|
||||
{{11},{11,2},{1},{},{2},{2,2},{12,1},{12},},
|
||||
{{3,11},{11,3},{11,2,3},{1,3},{3},{2,3},{2,2,3},{12,1,3},{12,3},},
|
||||
{{11,5},{11,2,5},{1,5},{5},{2,5},{2,2,5},{12,1,5},{12,5},},
|
||||
{{11,4},{11,2,4},{1,4},{4},{2,4},{2,2,4},{12,1,4},{12,4},{4,12},},
|
||||
},
|
||||
[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]={
|
||||
{{10},{10,2},{1},{},{2},{11,1},{11},},
|
||||
{{4,10},{10,4},{10,3},{1,4},{4},{3},{2,3},{11,4},{11,3},{3,11},},
|
||||
{{11},{11,2},{1},{},{2},{12,1},{12},},
|
||||
{{4,11},{11,4},{11,3},{1,4},{4},{3},{2,3},{12,4},{12,3},{3,12},},
|
||||
},
|
||||
}
|
||||
FCL[2]=FCL[1]
|
||||
FCL[4]=FCL[3]
|
||||
FCL[5]=FCL[3]
|
||||
clearScore={[0]=0,0,2,4,12}
|
||||
function ifoverlapAI(f,bk,x,y)
|
||||
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
|
||||
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
|
||||
function resetField(f0,f,start)
|
||||
while f[start]do
|
||||
::L::if f[start]then
|
||||
removeRow(f,start)
|
||||
goto L
|
||||
end
|
||||
for i=start,#f0 do
|
||||
f[i]=getNewRow()
|
||||
f[i]=getNewRow(0)
|
||||
for j=1,10 do
|
||||
f[i][j]=f0[i][j]
|
||||
end
|
||||
end
|
||||
end
|
||||
function getScore(field,cb,cx,cy)
|
||||
function getScore(field,bn,cb,cx,cy)
|
||||
local score=0
|
||||
local highest=0
|
||||
local height=getNewRow()
|
||||
local rough=0
|
||||
local height=getNewRow(0)
|
||||
local clear=0
|
||||
local hole=0
|
||||
|
||||
for i=cy+#cb-1,cy,-1 do
|
||||
local f=true
|
||||
for j=1,10 do
|
||||
if field[i][j]==0 then f=false;break end
|
||||
end
|
||||
if f then
|
||||
removeRow(field,i)
|
||||
clear=clear+1
|
||||
if field[i][j]==0 then goto L end
|
||||
end
|
||||
removeRow(field,i)
|
||||
clear=clear+1
|
||||
::L::
|
||||
end
|
||||
if #field==0 then return 9e99 end--PC best
|
||||
for x=1,10 do
|
||||
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
|
||||
goto L
|
||||
end
|
||||
height[x]=h
|
||||
if x>3 and x<8 and h>highest then highest=h end
|
||||
if h>1 then
|
||||
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
|
||||
local h1,mh1=0,0
|
||||
for x=1,9 do
|
||||
local dh=abs(height[x]-height[x])
|
||||
if dh>1 then
|
||||
rough=rough+min(dh^2,10)
|
||||
local dh=abs(height[x]-height[x+1])
|
||||
if dh==1 then
|
||||
h1=h1+1
|
||||
if h1>mh1 then mh1=h1 end
|
||||
else
|
||||
h1=0
|
||||
end
|
||||
end
|
||||
ins(freeRow,height)
|
||||
return
|
||||
-highest*5
|
||||
-rough*15
|
||||
-cy*20
|
||||
-#cb*10
|
||||
+clear^2*4
|
||||
-hole*15
|
||||
score=
|
||||
#field*20
|
||||
-cy*35
|
||||
-#cb*25
|
||||
+clearScore[clear]*(8+#field)
|
||||
-hole*50
|
||||
if #field>6 then score=score-highest*5 end
|
||||
if mh1>3 then score=score-40-mh1*30 end
|
||||
return score
|
||||
end
|
||||
function AI_getControls(ctrl)
|
||||
local Tfield={}--test field
|
||||
local field_org=field
|
||||
for i=1,#field_org do
|
||||
Tfield[i]=getNewRow()
|
||||
local field_org=P.field
|
||||
for i=1,#field_org do
|
||||
Tfield[i]=getNewRow(0)
|
||||
for j=1,10 do
|
||||
Tfield[i][j]=field_org[i][j]
|
||||
end
|
||||
end
|
||||
local best={x=1,dir=0,hold=false,score=-9e99}
|
||||
for ifhold=0,1 do
|
||||
local bn=ifhold==0 and bn or hn>0 and hn or nxt[1]
|
||||
for ifhold=0,P.gameEnv.hold and 1 or 0 do
|
||||
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
|
||||
local cb=blocks[bn][dir]
|
||||
for cx=1,11-#cb[1]do--each pos
|
||||
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
|
||||
goto L
|
||||
end--move to bottom
|
||||
for i=1,#cb do
|
||||
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
|
||||
if cb[i][j]~=0 then
|
||||
if cb[i][j]then
|
||||
Tfield[y][cx+j-1]=1
|
||||
end
|
||||
end
|
||||
end--simulate lock
|
||||
local score=getScore(Tfield,cb,cx,cy)
|
||||
local score=getScore(Tfield,bn,cb,cx,cy)
|
||||
if score>best.score then
|
||||
best={bn=bn,x=cx,dir=dir,hold=ifhold==1,score=score}
|
||||
end
|
||||
resetField(field_org,Tfield,cy)
|
||||
end
|
||||
end
|
||||
end--ifHold loop
|
||||
end
|
||||
|
||||
while #Tfield>0 do
|
||||
::L::
|
||||
if #Tfield>0 then
|
||||
removeRow(Tfield,1)
|
||||
goto L
|
||||
end--Release cache
|
||||
|
||||
if best.hold then
|
||||
ins(ctrl,8)
|
||||
end
|
||||
|
||||
local l=FCL[best.bn][best.dir+1][best.x]
|
||||
for i=1,#l do
|
||||
ins(ctrl,l[i])
|
||||
end
|
||||
|
||||
ins(ctrl,6)--harddrop
|
||||
ins(ctrl,6)
|
||||
end
|
||||
923
call&sys.lua
37
class.lua
Normal 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
|
||||
20
conf.lua
@@ -1,26 +1,26 @@
|
||||
function love.conf(t)
|
||||
local X=nil
|
||||
t.identity="Techmino"--The name of the save directory (string)
|
||||
t.appendidentity=X--Search files in source directory before save directory (boolean)
|
||||
t.identity="Techmino"--Save directory name
|
||||
t.appendidentity=X--If search files in source before save directory
|
||||
t.version="11.1"
|
||||
t.console=X
|
||||
t.accelerometerjoystick=X--Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean)
|
||||
t.gammacorrect=true
|
||||
t.audio.mixwithsystem=true--Switch on to keep background music playing
|
||||
t.accelerometerjoystick=X--If exposing accelerometer on iOS and Android as a Joystick
|
||||
t.gammacorrect=X
|
||||
t.audio.mixwithsystem=true--Switch on to keep sysBGM
|
||||
|
||||
local W=t.window
|
||||
W.title="Techmino V0.68"
|
||||
W.title="Techmino V0.7.20"
|
||||
W.icon="/image/icon.png"
|
||||
W.width,W.height=1280,720
|
||||
W.minwidth,W.minheight=640,360
|
||||
W.borderless=X
|
||||
W.resizable=true
|
||||
W.minwidth,W.minheight=640,360
|
||||
W.fullscreentype="desktop"--Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string)
|
||||
W.fullscreen=X
|
||||
W.vsync=X--0 to set ∞fps
|
||||
W.vsync=0--0→∞fps
|
||||
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.stencil=8--The number of bits per sample in the stencil buffer
|
||||
W.depth=X--Bits per sample in the depth buffer
|
||||
W.stencil=1--The number of bits per sample in the stencil buffer
|
||||
W.display=1--Monitor ID
|
||||
W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean)
|
||||
W.x,W.y=nil
|
||||
|
||||
1166
dataList.lua
Normal file
1350
gamefunc.lua
BIN
image/block.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 659 B |
|
Before Width: | Height: | Size: 578 B |
|
Before Width: | Height: | Size: 575 B |
|
Before Width: | Height: | Size: 441 B |
|
Before Width: | Height: | Size: 584 B |
|
Before Width: | Height: | Size: 577 B |
|
Before Width: | Height: | Size: 586 B |