自定义场地第一页影响拼图模式有效性
This commit is contained in:
@@ -62,19 +62,14 @@ return{
|
|||||||
else
|
else
|
||||||
modeEnv.mission=nil
|
modeEnv.mission=nil
|
||||||
end
|
end
|
||||||
local clearmode
|
modeEnv.dropPiece=PLY.check_lineReach
|
||||||
if FIELD[1]then
|
for y=1,20 do
|
||||||
for y=1,20 do
|
if notAir(FIELD[1][y])then
|
||||||
if notAir(FIELD[1][y])then
|
--Switch clear mode on
|
||||||
clearmode=true
|
modeEnv.dropPiece=checkClear
|
||||||
end
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if clearmode then
|
|
||||||
modeEnv.dropPiece=checkClear
|
|
||||||
else
|
|
||||||
modeEnv.dropPiece=PLY.check_lineReach
|
|
||||||
end
|
|
||||||
PLY.newPlayer(1,340,15)
|
PLY.newPlayer(1,340,15)
|
||||||
local L=modeEnv.opponent
|
local L=modeEnv.opponent
|
||||||
if L~=0 then
|
if L~=0 then
|
||||||
|
|||||||
@@ -5,11 +5,23 @@ local Timer=love.timer.getTime
|
|||||||
local int=math.floor
|
local int=math.floor
|
||||||
local find,sub=string.find,string.sub
|
local find,sub=string.find,string.sub
|
||||||
|
|
||||||
|
local function notAir(L)
|
||||||
|
for i=1,10 do
|
||||||
|
if L[i]>0 then return true end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local customEnv=customEnv
|
local customEnv=customEnv
|
||||||
function sceneInit.customGame()
|
function sceneInit.customGame()
|
||||||
destroyPlayers()
|
destroyPlayers()
|
||||||
BG.set(customEnv.bg)
|
BG.set(customEnv.bg)
|
||||||
BGM.play(customEnv.bgm)
|
BGM.play(customEnv.bgm)
|
||||||
|
sceneInit={initField=false}
|
||||||
|
for y=1,20 do
|
||||||
|
if notAir(FIELD[1][y])then
|
||||||
|
sceneTemp.initField=true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function keyDown.customGame(key)
|
function keyDown.customGame(key)
|
||||||
@@ -27,7 +39,13 @@ function keyDown.customGame(key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
SCN.push()
|
SCN.push()
|
||||||
loadGame((key=="return2"or kb.isDown("lalt","lctrl","lshift"))and"custom_puzzle"or"custom_clear",true)
|
if key=="return2"or kb.isDown("lalt","lctrl","lshift")then
|
||||||
|
if sceneTemp.initField then
|
||||||
|
loadGame("custom_puzzle",true)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
loadGame("custom_clear",true)
|
||||||
|
end
|
||||||
elseif key=="f"then
|
elseif key=="f"then
|
||||||
SCN.go("custom_field","swipeD")
|
SCN.go("custom_field","swipeD")
|
||||||
elseif key=="s"then
|
elseif key=="s"then
|
||||||
@@ -83,28 +101,30 @@ end
|
|||||||
|
|
||||||
function Pnt.customGame()
|
function Pnt.customGame()
|
||||||
--Field content
|
--Field content
|
||||||
gc.push("transform")
|
if sceneTemp.initField then
|
||||||
gc.translate(95,290)
|
gc.push("transform")
|
||||||
gc.scale(.5)
|
gc.translate(95,290)
|
||||||
gc.setColor(1,1,1)
|
gc.scale(.5)
|
||||||
gc.setLineWidth(3)
|
gc.setColor(1,1,1)
|
||||||
gc.rectangle("line",-2,-2,304,604)
|
gc.setLineWidth(3)
|
||||||
local F=FIELD[1]
|
gc.rectangle("line",-2,-2,304,604)
|
||||||
local cross=puzzleMark[-1]
|
local F=FIELD[1]
|
||||||
local texture=SKIN.curText
|
local cross=puzzleMark[-1]
|
||||||
for y=1,20 do for x=1,10 do
|
local texture=SKIN.curText
|
||||||
local B=F[y][x]
|
for y=1,20 do for x=1,10 do
|
||||||
if B>0 then
|
local B=F[y][x]
|
||||||
gc.draw(texture[B],30*x-30,600-30*y)
|
if B>0 then
|
||||||
elseif B==-1 then
|
gc.draw(texture[B],30*x-30,600-30*y)
|
||||||
gc.draw(cross,30*x-30,600-30*y)
|
elseif B==-1 then
|
||||||
end
|
gc.draw(cross,30*x-30,600-30*y)
|
||||||
end end
|
end
|
||||||
gc.pop()
|
end end
|
||||||
|
gc.pop()
|
||||||
|
end
|
||||||
|
|
||||||
--Field
|
--Field
|
||||||
setFont(40)
|
setFont(40)
|
||||||
if #FIELD>1 then
|
if sceneTemp.initField and #FIELD>1 then
|
||||||
gc.setColor(1,1,int(Timer()*6.26)%2)
|
gc.setColor(1,1,int(Timer()*6.26)%2)
|
||||||
gc.print("+",275,300)
|
gc.print("+",275,300)
|
||||||
gc.print(#FIELD-1,300,300)
|
gc.print(#FIELD-1,300,300)
|
||||||
@@ -117,6 +137,7 @@ function Pnt.customGame()
|
|||||||
gc.print(#BAG,360,545)
|
gc.print(#BAG,360,545)
|
||||||
end
|
end
|
||||||
setFont(30)
|
setFont(30)
|
||||||
|
gc.setColor(1,1,1)
|
||||||
gc.print(customEnv.sequence,330,510)
|
gc.print(customEnv.sequence,330,510)
|
||||||
|
|
||||||
--Sequence
|
--Sequence
|
||||||
@@ -152,7 +173,7 @@ WIDGET.init("customGame",{
|
|||||||
WIDGET.newButton({name="copy", x=1070, y=310,w=310,h=70,color="lRed", font=25,code=WIDGET.lnk.pressKey("cC")}),
|
WIDGET.newButton({name="copy", x=1070, y=310,w=310,h=70,color="lRed", font=25,code=WIDGET.lnk.pressKey("cC")}),
|
||||||
WIDGET.newButton({name="paste", x=1070, y=390,w=310,h=70,color="lBlue", font=25,code=WIDGET.lnk.pressKey("cV")}),
|
WIDGET.newButton({name="paste", x=1070, y=390,w=310,h=70,color="lBlue", font=25,code=WIDGET.lnk.pressKey("cV")}),
|
||||||
WIDGET.newButton({name="clear", x=1070, y=470,w=310,h=70,color="lYellow",font=35,code=WIDGET.lnk.pressKey("return")}),
|
WIDGET.newButton({name="clear", x=1070, y=470,w=310,h=70,color="lYellow",font=35,code=WIDGET.lnk.pressKey("return")}),
|
||||||
WIDGET.newButton({name="puzzle",x=1070, y=550,w=310,h=70,color="lMagenta",font=35,code=WIDGET.lnk.pressKey("return2")}),
|
WIDGET.newButton({name="puzzle",x=1070, y=550,w=310,h=70,color="lMagenta",font=35,code=WIDGET.lnk.pressKey("return2"),hide=function()return not sceneTemp.initField end}),
|
||||||
|
|
||||||
--More
|
--More
|
||||||
WIDGET.newKey({name="advance", x=730, y=190,w=220,h=90,color="red", font=35,code=WIDGET.lnk.goScene("custom_advance")}),
|
WIDGET.newKey({name="advance", x=730, y=190,w=220,h=90,color="red", font=35,code=WIDGET.lnk.goScene("custom_advance")}),
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ local max,min,int=math.max,math.min,math.floor
|
|||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
local sub=string.sub
|
local sub=string.sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local FIELD=FIELD
|
local FIELD=FIELD
|
||||||
function sceneInit.custom_field()
|
function sceneInit.custom_field()
|
||||||
sceneTemp={
|
sceneTemp={
|
||||||
|
|||||||
Reference in New Issue
Block a user