新增舒尔特方格
This commit is contained in:
@@ -375,6 +375,7 @@ local langList={
|
||||
},--LangName added later
|
||||
minigame={
|
||||
p15="15 Puzzle",
|
||||
schulte_G="舒尔特方格",
|
||||
back="返回",
|
||||
},
|
||||
p15={
|
||||
@@ -386,6 +387,13 @@ local langList={
|
||||
revKB="键盘反向",
|
||||
back="返回",
|
||||
},
|
||||
schulte_G={
|
||||
reset="重来",
|
||||
rank="尺寸",
|
||||
blind="盲打",
|
||||
disappear="消失",
|
||||
back="返回",
|
||||
},
|
||||
help={
|
||||
staff="制作人员",
|
||||
his="更新历史",
|
||||
@@ -861,6 +869,7 @@ local langList={
|
||||
},--LangName added later
|
||||
minigame={
|
||||
p15="15 Puzzle",
|
||||
schulte_G="舒尔特方格",
|
||||
back="返回",
|
||||
},
|
||||
p15={
|
||||
@@ -872,6 +881,13 @@ local langList={
|
||||
revKB="键盘反向",
|
||||
back="返回",
|
||||
},
|
||||
schulte_G={
|
||||
reset="重来",
|
||||
rank="尺寸",
|
||||
blind="盲打",
|
||||
disappear="消失",
|
||||
back="返回",
|
||||
},
|
||||
help={
|
||||
staff="制作人员",
|
||||
his="更新历史",
|
||||
@@ -1337,6 +1353,7 @@ local langList={
|
||||
},--LangName added later
|
||||
minigame={
|
||||
p15="15 Puzzle",
|
||||
schulte_G="Schulte Grid",
|
||||
back="Back",
|
||||
},
|
||||
p15={
|
||||
@@ -1348,6 +1365,13 @@ local langList={
|
||||
revKB="Reverse",
|
||||
back="Back",
|
||||
},
|
||||
schulte_G={
|
||||
reset="Reset",
|
||||
rank="Size",
|
||||
blind="Blind",
|
||||
disappear="Hide",
|
||||
back="Back",
|
||||
},
|
||||
help={
|
||||
staff="Staff",
|
||||
his="History",
|
||||
@@ -1811,6 +1835,7 @@ local langList={
|
||||
},--LangName added later
|
||||
minigame={
|
||||
p15="15 Puzzle",
|
||||
schulte_G="Schulte Grid",
|
||||
back="X",
|
||||
},
|
||||
p15={
|
||||
@@ -1822,6 +1847,13 @@ local langList={
|
||||
revKB="Reverse",
|
||||
back="X",
|
||||
},
|
||||
schulte_G={
|
||||
reset="!@#$%",
|
||||
rank="←?→",
|
||||
blind="???",
|
||||
disappear="=X=",
|
||||
back="X",
|
||||
},
|
||||
help={
|
||||
staff="Orz",
|
||||
his="_&_",
|
||||
@@ -2299,6 +2331,7 @@ local langList={
|
||||
},--LangName added later
|
||||
minigame={
|
||||
p15="15 Puzzle",
|
||||
schulte_G="舒尔特方格",
|
||||
back="返回",
|
||||
},
|
||||
p15={
|
||||
@@ -2310,6 +2343,13 @@ local langList={
|
||||
revKB="键盘反向",
|
||||
back="返回",
|
||||
},
|
||||
schulte_G={
|
||||
reset="重开",
|
||||
rank="尺寸",
|
||||
blind="盲",
|
||||
disappear="消失",
|
||||
back="返回",
|
||||
},
|
||||
help={
|
||||
staff="制作人员",
|
||||
his="更新历史",
|
||||
|
||||
@@ -466,6 +466,7 @@ local Widgets={
|
||||
},
|
||||
minigame={
|
||||
newButton({name="p15", x=640, y=100,w=350,h=120,color="white",font=40,code=goScene("p15")}),
|
||||
newButton({name="schulte_G",x=640, y=250,w=350,h=120,color="white",font=40,code=goScene("schulte_G")}),
|
||||
newButton({name="back", x=1140, y=640,w=180,h=80,color="white", font=35,code=BACK}),
|
||||
},
|
||||
p15={
|
||||
@@ -477,6 +478,11 @@ local Widgets={
|
||||
newSwitch({name="revKB", x=200,y=600,w=60, font=40,disp=function()return sceneTemp.revKB end,code=pressKey("r"),hide=function()return sceneTemp.state==1 end}),
|
||||
newButton({name="back", x=1140,y=640,w=180,h=80,color="white", font=35,code=BACK}),
|
||||
},
|
||||
schulte_G={
|
||||
newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("r"),hide=function()return sceneTemp.state==0 end}),
|
||||
newSlider({name="rank", x=130,y=250,w=150,unit=3,show=false, font=40,disp=function()return sceneTemp.rank-3 end,code=function(v)sceneTemp.rank=v+3 end,hide=function()return sceneTemp.state>0 end}),
|
||||
newSwitch({name="blind", x=160,y=330,w=60, font=40,disp=function()return sceneTemp.blind end,code=pressKey("b"),hide=function()return sceneTemp.state==1 end}),
|
||||
newSwitch({name="disappear",x=160,y=410,w=60, font=40,disp=function()return sceneTemp.disappear end,code=pressKey("d"),hide=function()return sceneTemp.state==1 end}),
|
||||
newButton({name="back", x=1140,y=640,w=180,h=80,color="white", font=35,code=BACK}),
|
||||
},
|
||||
help={
|
||||
|
||||
144
parts/scenes.lua
144
parts/scenes.lua
@@ -145,7 +145,7 @@ end
|
||||
do--minigame
|
||||
function sceneInit.minigame()
|
||||
BG.set("space")
|
||||
BGM.play()
|
||||
BGM.stop()
|
||||
end
|
||||
end
|
||||
do--p15
|
||||
@@ -448,6 +448,148 @@ do--p15
|
||||
gc.rectangle("line",x*160+173,y*160-107,134,134,50)
|
||||
end
|
||||
end
|
||||
do--schulte_G
|
||||
function sceneInit.schulte_G()
|
||||
BGM.play("way")
|
||||
sceneTemp={
|
||||
board={},
|
||||
rank=3,
|
||||
blind=false,
|
||||
disappear=false,
|
||||
|
||||
startTime=0,
|
||||
time=0,
|
||||
error=0,
|
||||
state=0,
|
||||
target=0,
|
||||
}
|
||||
end
|
||||
|
||||
local function newBoard()
|
||||
local S=sceneTemp
|
||||
local L={}
|
||||
for i=1,S.rank^2 do
|
||||
L[i]=i
|
||||
end
|
||||
for i=1,S.rank^2 do
|
||||
S.board[i]=rem(L,rnd(#L))
|
||||
end
|
||||
end
|
||||
local function tapBoard(x,y)
|
||||
local S=sceneTemp
|
||||
if x>320 and x<960 and y>40 and y<680 then
|
||||
if S.state==0 then
|
||||
newBoard()
|
||||
S.state=1
|
||||
S.startTime=Timer()
|
||||
S.target=1
|
||||
elseif S.state==1 then
|
||||
x=S.rank*(int((y-40)/640*S.rank))+int((x-320)/640*S.rank)+1
|
||||
if S.board[x]==S.target then
|
||||
S.target=S.target+1
|
||||
if S.target<=S.rank^2 then
|
||||
SFX.play("lock")
|
||||
else
|
||||
S.time=Timer()-S.startTime+S.error
|
||||
S.state=2
|
||||
SFX.play("reach")
|
||||
end
|
||||
else
|
||||
SFX.play("finesseError")
|
||||
S.error=S.error+1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mouseDown.schulte_G(x,y,k)
|
||||
tapBoard(x,y)
|
||||
end
|
||||
function touchDown.schulte_G(id,x,y)
|
||||
tapBoard(x,y)
|
||||
end
|
||||
function keyDown.schulte_G(key)
|
||||
local S=sceneTemp
|
||||
if key=="space"or key=="r"then
|
||||
if sceneTemp.state>0 then
|
||||
S.board={}
|
||||
S.time=0
|
||||
S.error=0
|
||||
S.state=0
|
||||
S.target=0
|
||||
end
|
||||
elseif key=="z"or key=="x"then
|
||||
tapBoard(ms.getPosition())
|
||||
elseif key=="b"then
|
||||
if S.state==0 then
|
||||
S.blind=not S.blind
|
||||
end
|
||||
elseif key=="d"then
|
||||
if S.state==0 then
|
||||
S.disappear=not S.disappear
|
||||
end
|
||||
elseif key=="3"or key=="4"or key=="5"or key=="6"then
|
||||
if S.state==0 then
|
||||
S.rank=tonumber(key)
|
||||
end
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
|
||||
function Tmr.schulte_G()
|
||||
local S=sceneTemp
|
||||
if S.state==1 then
|
||||
S.time=Timer()-S.startTime+S.error
|
||||
end
|
||||
end
|
||||
|
||||
local fontSize={nil,nil,120,100,80,60}
|
||||
function Pnt.schulte_G()
|
||||
local S=sceneTemp
|
||||
|
||||
setFont(40)
|
||||
gc.setColor(1,1,1)
|
||||
gc.print(format("%.3f",S.time),1026,80)
|
||||
gc.print(S.error,1026,150)
|
||||
|
||||
setFont(70)
|
||||
mStr(S.state==1 and S.target or S.state==0 and"Ready"or S.state==2 and"Win",1130,300)
|
||||
|
||||
if S.state==1 then gc.setColor(.9,.9,.9) --game
|
||||
elseif S.state==0 then gc.setColor(.2,.8,.2)--ready
|
||||
elseif S.state==2 then gc.setColor(.9,.9,0) --win
|
||||
end
|
||||
gc.setLineWidth(10)
|
||||
gc.rectangle("line",310,30,660,660)
|
||||
|
||||
local rank=S.rank
|
||||
local width=640/rank
|
||||
local blind=S.state==0 or S.blind and(S.state==2 or S.target>1)
|
||||
gc.setLineWidth(4)
|
||||
local f=fontSize[rank]
|
||||
setFont(f)
|
||||
for i=1,rank do
|
||||
for j=1,rank do
|
||||
local N=S.board[rank*(i-1)+j]
|
||||
if not(S.state==1 and S.disappear and N<S.target)then
|
||||
gc.setColor(.6,.4,.4)
|
||||
gc.rectangle("fill",320+(j-1)*width,(i-1)*width+40,width,width)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",320+(j-1)*width,(i-1)*width+40,width,width)
|
||||
if not blind then
|
||||
local x,y=320+(j-.5)*width,40+(i-.5)*width-f*.67
|
||||
gc.setColor(.1,.1,.1)
|
||||
mStr(N,x-3,y-1)
|
||||
mStr(N,x-1,y-3)
|
||||
gc.setColor(1,1,1)
|
||||
mStr(N,x,y)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
do--load
|
||||
function sceneInit.load()
|
||||
sceneTemp={
|
||||
|
||||
Reference in New Issue
Block a user