Compare commits

...

1 Commits

Author SHA1 Message Date
MrZ_26
4652be7067 0.8.14 2020-04-30 01:23:11 +08:00
14 changed files with 286 additions and 169 deletions

View File

@@ -1,4 +1,4 @@
gameVersion="Alpha V0.8.13"
gameVersion="Alpha V0.8.14"
function love.conf(t)
t.identity="Techmino"--SaveDir name
t.version="11.1"

View File

@@ -11,7 +11,8 @@ setting={
--game
ghost=true,center=true,
smo=true,grid=false,
smooth=true,grid=false,
lockFX=2,
dropFX=3,
shakeFX=2,
atkFX=3,

View File

@@ -243,7 +243,8 @@ return{
center="旋转中心",
bg="背景",
bgspace="星空背景",
smo="平滑下落",
smooth="平滑下落",
lockFX="锁定特效等级",
dropFX="下落特效等级",
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
@@ -279,7 +280,8 @@ return{
prev5="",next5="",spin5="R",
prev6="",next6="",spin6="R",
prev7="",next7="",spin7="R",
reset="重置方向",
skinR="重置配色",
faceR="重置方向",
back=BK,
},
setting_touch={

View File

@@ -240,7 +240,8 @@ return{
center="旋转中心",
bg="背景",
bgspace="星空背景",
smo="平滑下落",
smooth="平滑下落",
lockFX="锁定特效等级",
dropFX="下落特效等级",
shakeFX="晃动特效等级",
atkFX="攻击特效等级",
@@ -276,7 +277,8 @@ return{
prev5="",next5="",spin5="",
prev6="",next6="",spin6="",
prev7="",next7="",spin7="",
reset="重置方向",
skinR="重置配色",
faceR="重置方向",
back=BK,
},
setting_touch={

View File

@@ -239,7 +239,8 @@ Lib used:
center="Center",
bg="Background",
bgspace="BG space",
smo="Smoooth drop",
smooth="Smooth drop",
lockFX="Lock FX level",
dropFX="Drop FX level",
shakeFX="Shake FX level",
atkFX="ATK FX level",
@@ -275,7 +276,8 @@ Lib used:
prev5="",next5="",spin5="R",
prev6="",next6="",spin6="R",
prev7="",next7="",spin7="R",
reset="reset Dir",
skinR="reset Color",
faceR="reset Dir",
back=BK,
},
setting_touch={

View File

@@ -178,6 +178,16 @@ local touchDown,touchUp,touchMove={},{},{}
local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{}
function mouseDown.load()
sceneTemp.skip=true
end
function keyDown.load()
sceneTemp.skip=true
end
function touchDown.load()
sceneTemp.skip=true
end
function mouseDown.intro(x,y,k)
if k==2 then
VOICE("bye")
@@ -729,9 +739,9 @@ function wheelMoved.history(x,y)
end
function keyDown.history(key)
if key=="up"then
sceneTemp[2]=max(sceneTemp[2]-10,1)
sceneTemp[2]=max(sceneTemp[2]-3,1)
elseif key=="down"then
sceneTemp[2]=min(sceneTemp[2]+10,#sceneTemp[1]-22)
sceneTemp[2]=min(sceneTemp[2]+3,#sceneTemp[1]-22)
elseif key=="escape"then
scene.back()
end
@@ -813,7 +823,7 @@ local function widgetControl_gamepad(i)
end
end
end
local lastX,lastY--last clickDown pos
local lastX,lastY=0,0--last clickDown pos
function love.mousepressed(x,y,k,t,num)
if t then return end
mouseShow=true
@@ -830,8 +840,7 @@ function love.mousepressed(x,y,k,t,num)
widgetPress(widget_sel,mx,my)
end
end
lastX=mx
lastY=my
lastX,lastY=mx,my
end
function love.mousemoved(x,y,dx,dy,t)
if t then return end
@@ -1284,6 +1293,7 @@ function love.errorhandler(msg)
local function _(_)CAP=gc.newImage(_)end
gc.captureScreenshot(_)
gc.present()
setting.sfx=setting.voc--only for error "voice" played with voice volume,not saved
if SFX.list.error then SFX.play("error",.8)end
local BGcolor=rnd()>.026 and{.3,.5,.9},{.62,.3,.926}
local needDraw=true
@@ -1311,6 +1321,7 @@ function love.errorhandler(msg)
setFont(38)gc.printf(text.errorMsg,100,200,1280-100)
setFont(20)
gc.print(system.."-"..gameVersion,100,660)
gc.print("scene:"..scene.cur,400,660)
gc.printf(err[1],626,360,1260-626)
gc.print("TRACEBACK",626,426)
for i=4,#err-2 do

View File

@@ -51,7 +51,7 @@ return{
end
end
end,
bg="game4",bgm="way",
bg="game4",bgm="shining terminal",
},
pauseLimit=true,
load=function()

View File

@@ -28,13 +28,15 @@ if setting.lang==1 then
"使用love2d引擎制作",
"有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~",
"不要按F8",
"不要按F10",
"秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"按键/点击以全力加载,跳过动画",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
}
elseif setting.lang==2 then
L={
@@ -65,13 +67,15 @@ elseif setting.lang==2 then
"使用love2d引擎制作",
"有疑问?先看设置有没有你想要的",
"有建议的话可以把信息反馈给作者~",
"不要按F8",
"不要按F10",
"秘密数字:626",
"CLASSIC SEXY RUSSIAN BLOCKS",
"戴上耳机以获得最佳体验",
"少女祈祷中",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"(第一次才准)今日幸运数字:"..math.random(100,626),
"按键/点击以全力加载,跳过动画",
"LrL,RlR LLr,RRl RRR/LLL F!!",
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
}
elseif setting.lang==3 then
L={
@@ -102,13 +106,16 @@ elseif setting.lang==3 then
"Powered by love2d",
"Find out what's in the setting!",
"Any suggestions to author!",
"DO NOT PRESS F8",
"DO NOT PRESS F10",
"Secret num:626",
"Techmino=Technique+Tetromino",
"CLASSIC SEXY RUSSIAN BLOCKS",
"Headphones for better experience",
"少女祈禱中",
"LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI
"any-key/click to skip loading animation",
"RUR'U'R'FR2U'R'U'RUR'F'",
"Am G F G",
"LrL,RlR LLr,RRl RRR/LLL F!!",
}
end
return L[math.random(#L)]

View File

@@ -1,13 +1,3 @@
local O,_=true,false
local L={
{{_,O,O},{O,O,_}}, --Z
{{O,O,_},{_,O,O}}, --S
{{O,O,O},{_,_,O}}, --L
{{O,O,O},{O,_,_}}, --J
{{O,O,O},{_,O,_}}, --T
{{O,O},{O,O}}, --O
{{O,O,O,O}}, --I
}
local function RotCW(B)
local N={}
local r,c=#B,#B[1]--row,col
@@ -19,14 +9,16 @@ local function RotCW(B)
end
return N
end
-- [1,1,1]
-- [0,0,1]--r=2,c=3
-- ↓ (Y inv)
-- [1,1]
-- [1,0]
-- [1,0]
local O,_=true,false
local L={
{{_,O,O},{O,O,_}}, --Z
{{O,O,_},{_,O,O}}, --S
{{O,O,O},{_,_,O}}, --L
{{O,O,O},{O,_,_}}, --J
{{O,O,O},{_,O,_}}, --T
{{O,O},{O,O}}, --O
{{O,O,O,O}}, --I
}
for i=1,#L do
local B=L[i]
L[i]={[0]=B}

View File

@@ -12,7 +12,10 @@ local gameEnv0={
sddas=2,sdarr=2,
quickR=true,swap=true,
ghost=true,center=true,
grid=false,swap=true,
smooth=false,grid=false,
lockFX=3,dropFX=3,
shakeFX=3,
_20G=false,bone=false,
drop=60,lock=60,
wait=0,fall=0,
@@ -31,6 +34,7 @@ local gameEnv0={
fine=false,fineKill=false,
target=1e99,dropPiece=NULL,
mindas=0,minarr=0,minsdarr=0,
bg="none",bgm="race"
}
local comboAtk={0,0,1,1,2,2,2,3,3,4,3}--2 else
@@ -180,7 +184,7 @@ local function Pdraw_norm(P)
end
end
else--field block only
local dy,stepY=0,setting.smo and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local dy,stepY=0,P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local A=P.falling/P.gameEnv.fall
local h,H=1,#P.field
for j=int(P.fieldBeneath/30+1),H do
@@ -200,15 +204,25 @@ local function Pdraw_norm(P)
end
gc.translate(0,dy)
end--Field with falling animation
for i=1,#P.shade do
local S=P.shade[i]
gc.setColor(1,1,1,S[1]*.12)
for x=S[3],S[5]do
for y=S[6],S[4]do
drawPixel(y,x,S[2])
for i=1,#P.lockFX do
local _=P.lockFX[i]
if _[3]<.5 then
gc.setColor(1,1,1,2*_[3])
gc.rectangle("fill",_[1],_[2],60*_[3],30)
else
gc.setColor(1,1,1,2-2*_[3])
gc.rectangle("fill",_[1]+30,_[2],60*_[3]-60,30)
end
end--lockFX
for i=1,#P.dropFX do
local _=P.dropFX[i]
gc.setColor(1,1,1,_[1]*.12)
for x=_[3],_[5]do
for y=_[6],_[4]do
drawPixel(y,x,_[2])
end
end
end--shade FX
end--dropFX
if P.waiting==-1 then
if P.gameEnv.ghost then
gc.setColor(1,1,1,.3)
@@ -218,9 +232,9 @@ local function Pdraw_norm(P)
end
end end
end--Ghost
-- local dy=setting.smo and(P.y_img~=P.curY and or 1)^4*30 or 0
-- local dy=setting.smooth and(P.y_img~=P.curY and or 1)^4*30 or 0
local dy
if setting.smo then
if P.gameEnv.smooth then
if P.y_img~=P.curY then
dy=(min(P.dropDelay,1e99)/P.gameEnv.drop-1)*30
else
@@ -438,7 +452,7 @@ local function Pdraw_demo(P)
end
end
else--field block only
local dy,stepY=0,setting.smo and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local dy,stepY=0,P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^2.5*30 or 30
local A=P.falling/P.gameEnv.fall
local h,H=1,#P.field
for j=int(P.fieldBeneath/30+1),H do
@@ -458,15 +472,25 @@ local function Pdraw_demo(P)
end
gc.translate(0,dy)
end--Field with falling animation
for i=1,#P.shade do
local S=P.shade[i]
for i=1,#P.lockFX do
local _=P.lockFX[i]
if _[3]<.5 then
gc.setColor(1,1,1,3*_[3])
gc.rectangle("fill",_[1],_[2],60*_[3],30)
else
gc.setColor(1,1,1,3-3*_[3])
gc.rectangle("fill",_[1]+30,_[2],60*_[3]-60,30)
end
end--lockFX
for i=1,#P.dropFX do
local S=P.dropFX[i]
gc.setColor(1,1,1,S[1]*.12)
for x=S[3],S[5]do
for y=S[6],S[4]do
drawPixel(y,x,S[2])
end
end
end--shade FX
end--dropFX
if P.waiting==-1 then
gc.setColor(1,1,1,.3)
for i=1,P.r do for j=1,P.c do
@@ -515,22 +539,31 @@ local function updateFXs(P,dt)
P.score1=int(min(P.score1*.9+P.stat.score*.1+1))
end
end
for i=#P.shade,1,-1 do
local S=P.shade[i]
S[1]=S[1]-1+setting.dropFX*.15
if S[1]<=0 then
rem(P.shade,i)
for i=#P.lockFX,1,-1 do
local _=P.lockFX[i]
_[3]=_[3]+_[4]
if _[3]>1 then
rem(P.lockFX,i)
end
end
end--lockFX
for i=#P.dropFX,1,-1 do
local S=P.dropFX[i]
S[1]=S[1]-1+P.gameEnv.dropFX*.15
if S[1]<=0 then
rem(P.dropFX,i)
end
end--dropFX
if setting.shakeFX>0 then
if P.gameEnv.shakeFX then
local O=P.fieldOff
O.vx,O.vy=O.vx*.8-abs(O.x)^1.2*(O.x>0 and .1 or -.1),O.vy*.8-abs(O.y)^1.2*(O.y>0 and .1 or -.1)
O.x,O.y=O.x+O.vx,O.y+O.vy
if abs(O.x)<.3 then O.x=0 end
if abs(O.y)<.3 then O.y=0 end
end--field shaking
updateText(P.bonus)
if P.bonus then
updateText(P.bonus)
end
for i=#P.atkBuffer,1,-1 do
local A=P.atkBuffer[i]
A.time=A.time+1
@@ -609,8 +642,8 @@ local function Pupdate_alive(P,dt)
P.act.moveLeft(P,true)
end
end
if P:ifoverlap(P.cur.bk,P.curX-1,P.curY) and not P.small then
P.fieldOff.vx=-setting.shakeFX*.5
if P.gameEnv.shakeFX and P:ifoverlap(P.cur.bk,P.curX-1,P.curY)then
P.fieldOff.vx=-P.gameEnv.shakeFX*.5
end
P.moving=-moving-1
else
@@ -642,8 +675,8 @@ local function Pupdate_alive(P,dt)
P.act.moveRight(P,true)
end
end
if P:ifoverlap(P.cur.bk,P.curX+1,P.curY) and not P.small then
P.fieldOff.vx=setting.shakeFX*.5
if P.gameEnv.shakeFX and P:ifoverlap(P.cur.bk,P.curX+1,P.curY)then
P.fieldOff.vx=P.gameEnv.shakeFX*.5
end
P.moving=moving+1
else
@@ -661,8 +694,8 @@ local function Pupdate_alive(P,dt)
else
P.act.insDown(P)
end
if not P.small then
P.fieldOff.vy=setting.shakeFX*.3
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.3
end
end
else
@@ -733,7 +766,7 @@ local function Pupdate_alive(P,dt)
end
local function Pupdate_dead(P,dt)
if P.timing then P.stat.time=P.stat.time+dt end
if not P.small then
if P.keyRec then
P.keySpeed=P.keySpeed*.96+P.stat.key/P.stat.time*60*.04
P.dropSpeed=P.dropSpeed*.96+P.stat.piece/P.stat.time*60*.04
--Final average speeds
@@ -764,13 +797,33 @@ player={}local player=player
----------------------------<FX>----------------------------
local textFX=textFX
function player.showText(P,text,dx,dy,font,style,spd,stop)
if not P.small then
if P.bonus then
P.bonus[#P.bonus+1]=getTEXT(text,150+dx,300+dy,font*P.size,style,spd,stop)
end
end
local function without(L,e)
for i=1,#L do
if L[i]==e then return end
end
return true
end
function player.createLockFX(P)
local BK=P.cur.bk
local t=.1-P.gameEnv.lockFX*.02
for i=1,P.r do
local y=P.curY+i-1
if without(P.clearedRow,y)then
for j=1,P.c do
if BK[i][j]then
ins(P.lockFX,{30*(P.curX+j-2),600-30*y,0,t})
end
end
end
end
end
function player.createShade(P,x1,y1,x2,y2)--x1<x2,y1>y2!
if P.gameEnv.block and y1>=y2 then
P.shade[#P.shade+1]={5,P.cur.color,x1,y1,x2,y2}
P.dropFX[#P.dropFX+1]={5,P.cur.color,x1,y1,x2,y2}
end
end
function player.createBeam(P,R,send,time,target,color,clear,spin,mini,combo)
@@ -783,7 +836,7 @@ function player.createBeam(P,R,send,time,target,color,clear,spin,mini,combo)
end
local radius,corner
local a,r,g,b=1,unpack(P.color[color])
local a,r,g,b=1,unpack(skin.libColor[color])
if clear>10 then
radius=10+3*send+100/(target+4)
local t=clear%10
@@ -932,7 +985,7 @@ function player.garbageRelease(P)
::L::
local A=P.atkBuffer[n]
if A and A.countdown<=0 and not A.sent then
P:garbageRise(8+A.lv,A.amount,A.pos)
P:garbageRise(12+A.lv,A.amount,A.pos)
P.atkBuffer.sum=P.atkBuffer.sum-A.amount
A.sent,A.time=true,0
P.stat.pend=P.stat.pend+A.amount
@@ -958,9 +1011,13 @@ function player.garbageRise(P,color,amount,pos)
for i=1,#P.clearingRow do
P.clearingRow[i]=P.clearingRow[i]+amount
end
for i=1,#P.shade do
local S=P.shade[i]
S[4],S[6]=S[4]+amount,S[6]+amount
for i=1,#P.lockFX do
local _=P.lockFX[i]
_[2]=_[2]-30*amount--calculated pos!Must *=-30
end
for i=1,#P.dropFX do
local _=P.dropFX[i]
_[4],_[6]=_[4]+amount,_[6]+amount
end
if #P.field>40 then P:lose()end
end
@@ -1019,11 +1076,11 @@ function player.freshgho(P)
P.spinLast=false
end
if P.curY>P.y_img then
if not P.small then
if setting.dropFX>0 then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
P.fieldOff.vy=setting.shakeFX*.5
if P.gameEnv.dropFX then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5
end
P.curY=P.y_img
end
@@ -1112,7 +1169,7 @@ function player.spin(P,d,ifpre)
end
do return end
::spin::
if not P.small and setting.dropFX>0 then
if P.gameEnv.dropFX then
P:createShade(P.curX,P.curY+P.r-1,P.curX+P.c-1,P.curY)
end
local y0=P.curY
@@ -1243,9 +1300,11 @@ function player.drop(P)--Place piece
end--卡块
end
--消行
if P.clearedRow[1]then P.clearedRow={}end
--锁定
P:lock()
--清空消行列表
if P.clearedRow[1]then P.clearedRow={}end
--消行
local cc=0
for i=0,P.r-1 do
local h=P.curY+i
@@ -1270,6 +1329,15 @@ function player.drop(P)--Place piece
end
if P.clearingRow[1]then P.falling=P.gameEnv.fall end
--处理锁定特效
if P.gameEnv.lockFX then
if cc==0 then
P:createLockFX()
elseif P.lockFX[1]then
P.lockFX={}
end
end
--spin结算
if P.spinLast then
if cc>0 then
@@ -1289,38 +1357,41 @@ function player.drop(P)--Place piece
else
dospin=false
end
--极简判定:遮挡判断法
local finesse
if P.curY<=18 then
local y0=P.curY
local x,c=P.curX,P.c
local B=P.cur.bk
for x=1,c do
local y
for i=#B,1,-1 do
if B[i][x]then y=i;goto L1 end
end
goto L2
::L1::
if y then
x=P.curX+x-1
for y=y0+y,#P.field do
if solid(P,x,y)then
finesse=true
goto L2
end--有遮挡视为最简
end
end
end
end
::L2::
--移除消去的行
for i=cc,1,-1 do
_=P.clearedRow[i]
freeRow.discard(rem(P.field,_))
freeRow.discard(rem(P.visTime,_))
end
--极简判定:
--遮挡判断法
if P.curY>18 then
goto finesse
else
local y0=P.curY
local x,c=P.curX,P.c
local B=P.cur.bk
for x=1,c do
local y
for i=#B,1,-1 do
if B[i][x]then y=i;goto L2 end
end
goto L1
::L2::
if y then
x=P.curX+x-1
for y=y0+y,#P.field do
if solid(P,x,y)then goto finesse end--有遮挡视为最简
end
end
end
::L1::
end
do--操作判断法
if not finesse then--极简判定:操作判断法
if dospin then P.ctrlCount=P.ctrlCount-2 end--对无遮挡spin宽松两步
local id=P.cur.id
local dir=P.dir+1
@@ -1339,7 +1410,6 @@ function player.drop(P)--Place piece
--非最简
end
end
::finesse::
if cc>0 then
cmb=cmb+1
@@ -1846,15 +1916,13 @@ function player.act.hardDrop(P)
P.keyPressing[6]=false
elseif P.control and P.waiting==-1 then
if P.curY~=P.y_img then
if not P.small then
if setting.dropFX>0 then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
if P.gameEnv.dropFX then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
P.curY=P.y_img
P.spinLast=false
if not P.small then
P.fieldOff.vy=setting.shakeFX*.6
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.6
end
if P.human then
SFX.play("drop",nil,getBlockPosition(P))
@@ -1900,7 +1968,7 @@ function player.act.insLeft(P,auto)
local x0,y0=P.curX,P.curY
while not P:ifoverlap(P.cur.bk,P.curX-1,P.curY)do
P.curX=P.curX-1
if not P.small and setting.dropFX>0 then
if P.gameEnv.dropFX then
P:createShade(P.curX+P.c,P.curY+P.r-1,P.curX+P.c,P.curY)
end
P:freshgho()
@@ -1908,8 +1976,8 @@ function player.act.insLeft(P,auto)
if x0~=P.curX then
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
end
if not P.small then
P.fieldOff.vx=-setting.shakeFX*.5
if P.gameEnv.shakeFX then
P.fieldOff.vx=-P.gameEnv.shakeFX*.5
end
if auto then
if P.ctrlCount==0 then P.ctrlCount=1 end
@@ -1922,7 +1990,7 @@ function player.act.insRight(P,auto)
local x0,y0=P.curX,P.curY
while not P:ifoverlap(P.cur.bk,P.curX+1,P.curY)do
P.curX=P.curX+1
if not P.small and setting.dropFX>0 then
if P.gameEnv.dropFX then
P:createShade(P.curX-1,P.curY+P.r-1,P.curX-1,P.curY)
end
P:freshgho()
@@ -1930,8 +1998,8 @@ function player.act.insRight(P,auto)
if x0~=P.curX then
if P.gameEnv.easyFresh or y0~=P.curY then P:freshLockDelay()end
end
if not P.small then
P.fieldOff.vx=setting.shakeFX*.5
if P.gameEnv.shakeFX then
P.fieldOff.vx=P.gameEnv.shakeFX*.5
end
if auto then
if P.ctrlCount==0 then P.ctrlCount=1 end
@@ -1941,11 +2009,11 @@ function player.act.insRight(P,auto)
end
function player.act.insDown(P)
if P.curY~=P.y_img then
if not P.small then
if setting.dropFX>0 then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
P.fieldOff.vy=setting.shakeFX*.5
if P.gameEnv.dropFX then
P:createShade(P.curX,P.curY+1,P.curX+P.c-1,P.y_img+P.r-1)
end
if P.gameEnv.shakeFX then
P.fieldOff.vy=P.gameEnv.shakeFX*.5
end
P.curY,P.lockDelay,P.spinLast=P.y_img,P.gameEnv.lock,false
end
@@ -2041,8 +2109,11 @@ function newDemoPlayer(id,x,y,size)
das=10,arr=2,
sddas=2,sdarr=2,
quickR=true,swap=true,
ghost=true,center=true,
grid=false,swap=true,
ghost=setting.ghost,center=setting.center,
smooth=setting.smooth,grid=setting.grid,
lockFX=setting.lockFX,dropFX=setting.dropFX,
shakeFX=setting.shakeFX,
_20G=false,bone=false,
drop=1e99,lock=1e99,
wait=10,fall=20,
@@ -2062,9 +2133,13 @@ function newDemoPlayer(id,x,y,size)
target=1e99,dropPiece=NULL,
mindas=0,minarr=0,minsdarr=0,
}
local ENV=P.gameEnv
if ENV.lockFX==0 then ENV.lockFX=nil end
if ENV.dropFX==0 then ENV.dropFX=nil end
if ENV.shakeFX==0 then ENV.shakeFX=nil end
P.color={}
for _=1,7 do
P.color[_]=skin.libColor[P.gameEnv.skin[_]]
P.color[_]=skin.libColor[ENV.skin[_]]
end
P.cur={bk={{}},id=0,color=0,name=0}
P.sc,P.dir,P.r,P.c={0,0},0,0,0
@@ -2084,9 +2159,9 @@ function newDemoPlayer(id,x,y,size)
P:getNext(rem(bag1,rnd(#bag1)))
end
P.newNext=freshMethod.bag7
if P.gameEnv.sequence==1 then P.bag={}
elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end
elseif P.gameEnv.sequence==3 then
if ENV.sequence==1 then P.bag={}
elseif ENV.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end
elseif ENV.sequence==3 then
end
P.human=false
@@ -2122,7 +2197,7 @@ function newDemoPlayer(id,x,y,size)
P.combo,P.b2b=0,0
P.fieldBeneath=0
P.score1,P.b2b1=0,0
P.shade={}
P.dropFX,P.lockFX={},{}
P.bonus={}
P.dust=clearDust:clone()
P.dust:start()
@@ -2132,24 +2207,25 @@ end
function newPlayer(id,x,y,size,AIdata)
players[id]={id=id}
local P=players[id]
for k,v in next,player do P[k]=v end--Class function
for k,v in next,player do P[k]=v end--inherit functions of player class
players.alive[#players.alive+1]=P
P.x,P.y,P.size=x,y,size or 1
P.fieldOff={x=0,y=0,vx=0,vy=0}--for shake FX
P.small=P.size<.1--if draw in small mode
P.keyRec=not P.small--if calculate keySpeed
if P.small then
P.centerX,P.centerY=P.x+300*P.size,P.y+600*P.size
P.canvas=love.graphics.newCanvas(60,120)
P.frameWait=rnd(30,120)
P.draw=Pdraw_small
else
P.keyRec=true--if calculate keySpeed
P.centerX,P.centerY=P.x+300*P.size,P.y+370*P.size
P.absFieldX=P.x+150*P.size
P.absFieldY=P.y+60*P.size
P.draw=Pdraw_norm
P.dust=clearDust:clone()
P.dust:start()
P.bonus={}--texts
end
P.update=Pupdate_alive
@@ -2178,18 +2254,18 @@ function newPlayer(id,x,y,size,AIdata)
--Royale-related
P.gameEnv={}--Current game setting environment
local ENV=P.gameEnv
for k,v in next,gameEnv0 do
if modeEnv[k]~=nil then
v=modeEnv[k]
elseif setting[k]~=nil then
v=setting[k]
end
P.gameEnv[k]=v
ENV[k]=v
end--load game settings
P.gameEnv.das=max(P.gameEnv.das,P.gameEnv.mindas)
P.gameEnv.arr=max(P.gameEnv.arr,P.gameEnv.minarr)
P.gameEnv.sdarr=max(P.gameEnv.sdarr,P.gameEnv.minsdarr)
if not AIdata then P.gameEnv.next=min(P.gameEnv.next,setting.maxNext)end--AIdata is not human
ENV.das=max(ENV.das,ENV.mindas)
ENV.arr=max(ENV.arr,ENV.minarr)
ENV.sdarr=max(ENV.sdarr,ENV.minsdarr)
P.cur={bk={{}},id=0,color=0,name=0}--shape,shapeID,colorID,nameID
P.sc,P.dir,P.r,P.c={0,0},0,0,0--spinCenter,direction,row,col
@@ -2198,14 +2274,14 @@ function newPlayer(id,x,y,size,AIdata)
P.holded=false
P.next={}
P.dropDelay,P.lockDelay=P.gameEnv.drop,P.gameEnv.lock
P.dropDelay,P.lockDelay=ENV.drop,ENV.lock
P.freshTime=0
P.spinLast,P.lastClear=false,nil
P.spinSeq=0--for Ospin,each digit mean a spin
P.ctrlCount=0--key press time,for finesse check
P.his={rnd(7),rnd(7),rnd(7),rnd(7)}
local s=P.gameEnv.sequence
local s=ENV.sequence
if s=="bag7"or s=="his4"then
local bag1={1,2,3,4,5,6,7}
for _=1,7 do
@@ -2228,10 +2304,10 @@ function newPlayer(id,x,y,size,AIdata)
end
end
P.newNext=freshMethod[P.gameEnv.sequence]
if P.gameEnv.sequence==1 then P.bag={}--Bag7
elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4
elseif P.gameEnv.sequence==3 then--Pure random
P.newNext=freshMethod[ENV.sequence]
if ENV.sequence==1 then P.bag={}--Bag7
elseif ENV.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4
elseif ENV.sequence==3 then--Pure random
end
if AIdata then
@@ -2240,12 +2316,12 @@ function newPlayer(id,x,y,size,AIdata)
P.AI_stage=1
P.AI_needFresh=false
P.AI_keys={}
P.AI_delay=min(int(P.gameEnv.drop*.8),2*AIdata.delta)
P.AI_delay=min(int(ENV.drop*.8),2*AIdata.delta)
P.AI_delay0=AIdata.delta
P.AIdata={
next=AIdata.next,
hold=AIdata.hold,
_20G=P.gameEnv._20G,
_20G=ENV._20G,
bag7=AIdata.bag7=="bag7",
node=AIdata.node,
}
@@ -2266,21 +2342,31 @@ function newPlayer(id,x,y,size,AIdata)
P.RS=kickList.TRS
P.AI_keys={}
end
P.gameEnv.face={0,0,0,0,0,0,0}
P.gameEnv.skin={1,5,2,8,10,3,7}
ENV.face={0,0,0,0,0,0,0}
ENV.skin={1,5,2,8,10,3,7}
else
P.human=true
P.RS=kickList.TRS
players.human=players.human+1
ENV.next=min(ENV.next,setting.maxNext)
end
if P.small then
ENV.lockFX=nil
ENV.dropFX=nil
ENV.shakeFX=nil
else
if ENV.lockFX==0 then ENV.lockFX=nil end
if ENV.dropFX==0 then ENV.dropFX=nil end
if ENV.shakeFX==0 then ENV.shakeFX=nil end
end
P.color={}
for _=1,7 do
P.color[_]=skin.libColor[P.gameEnv.skin[_]]
P.color[_]=skin.libColor[ENV.skin[_]]
end
P.showTime=visible_opt[P.gameEnv.visible]
P.keepVisible=P.gameEnv.visible=="show"
P.showTime=visible_opt[ENV.visible]
P.keepVisible=ENV.visible=="show"
P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end
@@ -2291,8 +2377,7 @@ function newPlayer(id,x,y,size,AIdata)
P.fieldBeneath=0
P.score1,P.b2b1=0,0
P.shade={}
P.bonus={}--texts
P.dropFX,P.lockFX={},{}
P.endCounter=0--used after gameover
P.result=nil--string:"WIN"/"K.O."

View File

@@ -19,6 +19,7 @@ local sceneInit={
1,--Loading counter
#voiceName,--Loading bar lenth(current)
require("parts/getTip"),--tip
skip=false,--if skipping
}
end,
intro=function()

View File

@@ -82,6 +82,7 @@ function Tmr.load()
scene.swapTo("intro","none")
end
end
if L.skip and not scene.swapping then goto R end
end
function Tmr.intro()
sceneTemp=sceneTemp+1

View File

@@ -1,6 +1,5 @@
local S=[=[
"Patron"(rmb10+)(ordered by first char):
10元
八零哥
Fireboos
gggf127
@@ -16,6 +15,7 @@ local S=[=[
心痕
蕴空之灵
yyangdid
10元
?[D*a]
Thanks!
@@ -32,7 +32,6 @@ Future outlook:
Shifting field
Other:
bag sep-line switch
more drop fx,like light on locked block
game recording
(powerinfo switch)
new virtualWidgets like joysticks
@@ -42,14 +41,26 @@ Future outlook:
Encrypt source code(compile to byte code)
new AI:task-Z
CC smarter(think of garbage buffer)
0.8.14:
new:
click/tap/any-key to skip loading animation
lock animation
changed:
display scene info when error
//many optimization
fixed:
error when attack
error garbage line color
error in finesse checking
some times error when touch screen
0.8.13:
new:
a independent page to set DAS/ARR,with an animation for preview
changed:
new virtualkey animation
freer drawing mode(Incompatible with old ver.)
score of spins little changed
combo&b3b attack changed
score of spins little changed
fixed:
wrong behavior in pause scene
ospin error in 0.8.12

View File

@@ -255,18 +255,19 @@ local Widget={
sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"),
game= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"ghost"),
ghost= newSwitch(310,180,35, SETval("ghost"), SETrev("ghost"), nil,"center"),
center= newSwitch(580,180,35, SETval("center"), SETrev("center"), nil,"smo"),
smo= newSwitch(310,260,25, SETval("smo"), SETrev("smo"), nil,"grid"),
grid= newSwitch(580,260,30, SETval("grid"), SETrev("grid"), nil,"dropFX"),
dropFX= newSlider(310,350,373,5,35,nil, SETval("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
shakeFX=newSlider(310,430,373,5,35,nil, SETval("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
atkFX= newSlider(310,510,373,5,35,nil, SETval("atkFX"), SETsto("atkFX"), nil,"frame"),
frame= newSlider(310,590,373,10,35,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"),
center= newSwitch(580,180,35, SETval("center"), SETrev("center"), nil,"smooth"),
smooth= newSwitch(310,260,25, SETval("smooth"), SETrev("smooth"), nil,"grid"),
grid= newSwitch(580,260,30, SETval("grid"), SETrev("grid"), nil,"lockFX"),
lockFX= newSlider(310,340,373,3,35,nil, SETval("lockFX"), SETsto("lockFX"), nil,"dropFX"),
dropFX= newSlider(310,410,373,5,35,nil, SETval("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
shakeFX=newSlider(310,480,373,5,35,nil, SETval("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
atkFX= newSlider(310,550,373,5,35,nil, SETval("atkFX"), SETsto("atkFX"), nil,"frame"),
frame= newSlider(310,620,373,10,35,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"),
fullscreen=newSwitch(990,180,40,SETval("fullscreen"),function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
if not setting.fullscreen then
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end
end,nil,"bg"),
bg= newSwitch(990,250,35,SETval("bg"),SETrev("bg"),nil,"bgspace"),
@@ -331,7 +332,8 @@ local Widget={
--spin6=newButton(825,550,90,65,C.white,30,nextDir(6)),--O cannot rotate
spin7= newButton(965,550,90,65,C.white,30,nextDir(7)),
reset= newButton(200,650,180,80,C.lightRed,35,function()for i=1,7 do setting.face[i]=0 end SFX.play("rotate")end),
skinR= newButton(200,650,180,80,C.lightPurple,35,function()setting.skin={1,5,2,8,10,3,7}SFX.play("hold")end),
faceR= newButton(480,650,180,80,C.lightRed,35,function()setting.face={0,0,0,0,0,0,0}SFX.play("rotate")end),
back= newButton(1140,650,200,80,C.white,40,scene.back),
},
setting_touch={