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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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