整 理 代 码

(应该没有改到字符串里面的东西吧…)起码不直接影响运行
This commit is contained in:
MrZ_26
2022-10-01 11:32:11 +08:00
parent 6e00ff96ec
commit 06f4bb4e1a
236 changed files with 2087 additions and 2114 deletions

View File

@@ -16,7 +16,7 @@ end
scene.touchDown=scene.mouseDown
function scene.keyDown(key)
if key=='space'then
if key=='space' then
loadGame('stack_e',true)
else
return true

View File

@@ -11,8 +11,8 @@ local move,push,state
local color,invis='color1'
local slide,pathVis,revKB
local function ifGaming()return state==1 end
local colorSelector=WIDGET.newSelector{name='color',x=150,y=240,w=200,list={'color1','rainbow','color2','gray','black'},color='lY',disp=function()return color end,code=function(v)if state~=1 then color=v end end,hideF=ifGaming}
local function ifGaming() return state==1 end
local colorSelector=WIDGET.newSelector{name='color',x=150,y=240,w=200,list={'color1','rainbow','color2','gray','black'},color='lY',disp=function() return color end,code=function(v) if state~=1 then color=v end end,hideF=ifGaming}
function scene.sceneInit()
BG.set('rainbow2')
@@ -117,7 +117,7 @@ local function tapBoard(x,y,key)
state=1
startTime=TIME()
end
if checkBoard(b)then
if checkBoard(b) then
state=2
time=TIME()-startTime
SFX.play('win')
@@ -129,43 +129,43 @@ local function tapBoard(x,y,key)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='up'then
if key=='up' then
tapBoard(cx,cy-(revKB and 1 or -1),true)
elseif key=='down'then
elseif key=='down' then
tapBoard(cx,cy+(revKB and 1 or -1),true)
elseif key=='left'then
elseif key=='left' then
tapBoard(cx-(revKB and 1 or -1),cy,true)
elseif key=='right'then
elseif key=='right' then
tapBoard(cx+(revKB and 1 or -1),cy,true)
elseif key=='space'then
elseif key=='space' then
shuffleBoard()
state=0
time=0
move,push=0,0
elseif key=='q'then
elseif key=='q' then
if state~=1 then
colorSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
colorSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1)
end
elseif key=='w'then
elseif key=='w' then
if state==0 then
invis=not invis
end
elseif key=='e'then
elseif key=='e' then
if state==0 then
slide=not slide
if not slide then
pathVis=false
end
end
elseif key=='r'then
elseif key=='r' then
if state==0 and slide then
pathVis=not pathVis
end
elseif key=='t'then
elseif key=='t' then
if state==0 then
revKB=not revKB
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
@@ -286,7 +286,7 @@ function scene.draw()
for j=1,4 do
if cx~=j or cy~=i then
local N=board[i][j]
local C=mono and'gray'or color
local C=mono and 'gray' or color
gc.setColor(backColor[C][N])
gc.rectangle('fill',j*160+163,i*160-117,154,154,8)
@@ -310,10 +310,10 @@ end
scene.widgetList={
WIDGET.newButton{name='reset', x=160, y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'space'},
colorSelector,
WIDGET.newSwitch{name='invis', x=240, y=330,lim=200,font=40,disp=function()return invis end, code=pressKey'w',hideF=ifGaming},
WIDGET.newSwitch{name='slide', x=240, y=420,lim=200,font=40,disp=function()return slide end, code=pressKey'e',hideF=ifGaming},
WIDGET.newSwitch{name='pathVis',x=240, y=510,lim=200,font=40,disp=function()return pathVis end,code=pressKey'r',hideF=function()return state==1 or not slide end},
WIDGET.newSwitch{name='revKB', x=240, y=600,lim=200,font=40,disp=function()return revKB end, code=pressKey't',hideF=ifGaming},
WIDGET.newSwitch{name='invis', x=240, y=330,lim=200,font=40,disp=function() return invis end, code=pressKey'w',hideF=ifGaming},
WIDGET.newSwitch{name='slide', x=240, y=420,lim=200,font=40,disp=function() return slide end, code=pressKey'e',hideF=ifGaming},
WIDGET.newSwitch{name='pathVis',x=240, y=510,lim=200,font=40,disp=function() return pathVis end,code=pressKey'r',hideF=function() return state==1 or not slide end},
WIDGET.newSwitch{name='revKB', x=240, y=600,lim=200,font=40,disp=function() return revKB end, code=pressKey't',hideF=ifGaming},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -65,7 +65,7 @@ local tileFont={
local tileName={[0]="X","2","4","8","16","32","64","128","256","512","1024","2048","4096","8192","16384","32768","65536","131072","262144","524288","2^20"}
local function airExist()
for i=1,16 do
if not board[i]then
if not board[i] then
return true
end
end
@@ -73,7 +73,7 @@ end
local function newTile()
--Select position & generate number
nextPos=(nextPos+6)%16+1
while board[nextPos]do
while board[nextPos] do
nextPos=(nextPos-4)%16+1
end
board[nextPos]=nextTile
@@ -89,23 +89,23 @@ local function newTile()
if nextCD>0 then
nextTile=1
else
nextTile=MATH.roll(.9)and 2 or MATH.roll(.9)and 3 or 4
nextTile=MATH.roll(.9) and 2 or MATH.roll(.9) and 3 or 4
nextCD=rnd(8,12)
end
--Check if board is full
if airExist()then return end
if airExist() then return end
--Check if board is locked in all-directions
for i=1,12 do
if board[i]==board[i+4]then
if board[i]==board[i+4] then
return
end
end
for i=1,13,4 do
if
board[i+0]==board[i+1]or
board[i+1]==board[i+2]or
board[i+0]==board[i+1] or
board[i+1]==board[i+2] or
board[i+2]==board[i+3]
then
return
@@ -114,7 +114,7 @@ local function newTile()
--Die.
state=2
SFX.play(maxTile>=10 and'win'or'fail')
SFX.play(maxTile>=10 and 'win' or 'fail')
end
local function freshMaxTile()
maxTile=maxTile+1
@@ -129,7 +129,7 @@ local function squash(L)
local moved=false
while true do
p2=p1+1
while not L[p2]and p2<5 do
while not L[p2] and p2<5 do
p2=p2+1
end
if p2==5 then
@@ -139,10 +139,10 @@ local function squash(L)
p1=p1+1
end
else
if not L[p1]then--air←2
if not L[p1] then--air←2
L[p1],L[p2]=L[p2],false
moved=true
elseif L[p1]==L[p2]then--2←2
elseif L[p1]==L[p2] then--2←2
L[p1],L[p2]=L[p1]+1,false
if L[p1]>maxTile then
freshMaxTile()
@@ -214,7 +214,7 @@ local function moveRight()
end
local function skip()
if state==1 and skipper.cd==0 then
if airExist()then
if airExist() then
skipper.cd=1024
skipper.used=true
newTile()
@@ -242,10 +242,10 @@ function scene.mouseDown(x,y,k)
skip()
else
local dx,dy=x-640,y-360
if abs(dx)<320 and abs(dy)<320 and(abs(dx)>60 or abs(dy)>60)then
if abs(dx)<320 and abs(dy)<320 and (abs(dx)>60 or abs(dy)>60) then
scene.keyDown(abs(dx)-abs(dy)>0 and
(dx>0 and'right'or'left')or
(dy>0 and'down'or'up')
(dx>0 and 'right' or 'left') or
(dy>0 and 'down' or 'up')
)
end
end
@@ -279,7 +279,7 @@ local function playRep(n)
autoPressing=false
end
if move~=move0 then
if repeater.seq[n]~=repeater.last[n]then
if repeater.seq[n]~=repeater.last[n] then
repeater.last[n]=repeater.seq[n]
move=move0+#repeater.seq[n]/3+1
else
@@ -290,14 +290,14 @@ local function playRep(n)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='up'or key=='down'or key=='left'or key=='right'then
if key=='up' or key=='down' or key=='left' or key=='right' then
if repeater.focus then
local f=repeater.focus
if #repeater.seq[f]<24 then
repeater.seq[f]=repeater.seq[f]..arrows[key]
end
else
if moveFunc[key]()then
if moveFunc[key]() then
if state==0 then
startTime=TIME()
state=1
@@ -316,21 +316,21 @@ function scene.keyDown(key,isRep)
end
end
end
elseif key=='space'then skip()
elseif key=='r'then reset()
elseif key=='q'then if state==0 then invis=not invis end
elseif key=='w'then if state==0 then tapControl=not tapControl end
elseif key=='1'or key=='2'then(kb.isDown('lshift','lctrl','lalt')and playRep or setFocus)(key=='1'and 1 or 2)
elseif key=='c1'then playRep(1)
elseif key=='c2'then playRep(2)
elseif key=='return'then
elseif key=='space' then skip()
elseif key=='r' then reset()
elseif key=='q' then if state==0 then invis=not invis end
elseif key=='w' then if state==0 then tapControl=not tapControl end
elseif key=='1' or key=='2' then (kb.isDown('lshift','lctrl','lalt') and playRep or setFocus)(key=='1' and 1 or 2)
elseif key=='c1' then playRep(1)
elseif key=='c2' then playRep(2)
elseif key=='return' then
if repeater.focus then
repeater.focus=false
end
elseif key=='escape'then
elseif key=='escape' then
if repeater.focus then
repeater.focus=false
elseif tryBack()then
elseif tryBack() then
SCN.back()
end
end
@@ -363,13 +363,13 @@ function scene.draw()
setFont(25)
for i=1,2 do
setColor(COLOR[
repeater.focus==i and(
repeater.focus==i and (
TIME()%.5>.25 and
'R'or
'R' or
'Y'
)or(
repeater.seq[i]==repeater.last[i]and
'H'or
) or (
repeater.seq[i]==repeater.last[i] and
'H' or
'Z'
)
])
@@ -399,12 +399,12 @@ function scene.draw()
--Board
for i=1,16 do
if board[i]then
if board[i] then
local x,y=1+(i-1)%4,int((i+3)/4)
local N=board[i]
if i~=prevPos or prevSpawnTime==1 then
if not invis or i==prevPos then
setColor(tileColor[N]or COLOR.D)
setColor(tileColor[N] or COLOR.D)
rectangle('fill',x*160+163,y*160-117,154,154,15)
if N>=0 then
setColor(N<3 and COLOR.D or COLOR.Z)
@@ -480,18 +480,18 @@ end
scene.widgetList={
WIDGET.newButton{name='reset', x=155, y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'r'},
WIDGET.newSwitch{name='invis', x=240, y=300,lim=200,font=40,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapControl',x=240, y=370,lim=200,font=40,disp=function()return tapControl end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='invis', x=240, y=300,lim=200,font=40,disp=function() return invis end,code=pressKey'q',hideF=function() return state==1 end},
WIDGET.newSwitch{name='tapControl',x=240, y=370,lim=200,font=40,disp=function() return tapControl end,code=pressKey'w',hideF=function() return state==1 end},
WIDGET.newKey{name='up', x=155, y=460,w=100,fText="",font=50, color='Y',code=pressKey'up', hideF=function()return tapControl end},
WIDGET.newKey{name='down', x=155, y=660,w=100,fText="",font=50, color='Y',code=pressKey'down', hideF=function()return tapControl end},
WIDGET.newKey{name='left', x=55, y=560,w=100,fText="",font=50, color='Y',code=pressKey'left', hideF=function()return tapControl end},
WIDGET.newKey{name='right', x=255, y=560,w=100,fText="",font=50,color='Y',code=pressKey'right', hideF=function()return tapControl end},
WIDGET.newKey{name='skip', x=155, y=400,w=100,font=20, color='Y',code=pressKey'space', hideF=function()return state~=1 or not skipper.cd or skipper.cd>0 end},
WIDGET.newKey{name='record1', x=1100,y=390,w=220,h=50,fText="", color='H',code=pressKey'1', hideF=function()return state==2 end},
WIDGET.newKey{name='record2', x=1100,y=450,w=220,h=50,fText="", color='H',code=pressKey'2', hideF=function()return state==2 end},
WIDGET.newKey{name='replay1', x=1245,y=390,w=50,fText="!", color='G',code=pressKey'c1', hideF=function()return state==2 or #repeater.seq[1]==0 end},
WIDGET.newKey{name='replay2', x=1245,y=450,w=50,fText="!", color='G',code=pressKey'c2', hideF=function()return state==2 or #repeater.seq[2]==0 end},
WIDGET.newKey{name='up', x=155, y=460,w=100,fText="",font=50, color='Y',code=pressKey'up', hideF=function() return tapControl end},
WIDGET.newKey{name='down', x=155, y=660,w=100,fText="",font=50, color='Y',code=pressKey'down', hideF=function() return tapControl end},
WIDGET.newKey{name='left', x=55, y=560,w=100,fText="",font=50, color='Y',code=pressKey'left', hideF=function() return tapControl end},
WIDGET.newKey{name='right', x=255, y=560,w=100,fText="",font=50,color='Y',code=pressKey'right', hideF=function() return tapControl end},
WIDGET.newKey{name='skip', x=155, y=400,w=100,font=20, color='Y',code=pressKey'space', hideF=function() return state~=1 or not skipper.cd or skipper.cd>0 end},
WIDGET.newKey{name='record1', x=1100,y=390,w=220,h=50,fText="", color='H',code=pressKey'1', hideF=function() return state==2 end},
WIDGET.newKey{name='record2', x=1100,y=450,w=220,h=50,fText="", color='H',code=pressKey'2', hideF=function() return state==2 end},
WIDGET.newKey{name='replay1', x=1245,y=390,w=50,fText="!", color='G',code=pressKey'c1', hideF=function() return state==2 or #repeater.seq[1]==0 end},
WIDGET.newKey{name='replay2', x=1245,y=450,w=50,fText="!", color='G',code=pressKey'c2', hideF=function() return state==2 or #repeater.seq[2]==0 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -46,7 +46,7 @@ function scene.keyDown(key,isRep)
if isRep then return end
if #key==1 then
if state<2 and frameKeyCount<3 then
if key:upper():byte()==targetString:byte(progress)then
if key:upper():byte()==targetString:byte(progress) then
progress=progress+1
frameKeyCount=frameKeyCount+1
TEXT.show(key:upper(),rnd(320,960),rnd(100,240),90,'score',2.6)
@@ -64,16 +64,16 @@ function scene.keyDown(key,isRep)
SFX.play('finesseError')
end
end
elseif key=='left'or key=='right'then
elseif key=='left' or key=='right' then
if state==0 then
scene.widgetList.level:scroll(key=='left'and -1 or 1)
scene.widgetList.level:scroll(key=='left' and -1 or 1)
end
elseif key=='space'then
elseif key=='space' then
progress=1
mistake=0
time=0
state=0
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
@@ -104,7 +104,7 @@ function scene.draw()
end
FONT.set(100)
GC.mStr(state==1 and #targetString-progress+1 or state==0 and"Ready"or state==2 and"Win",640,200)
GC.mStr(state==1 and #targetString-progress+1 or state==0 and "Ready" or state==2 and "Win",640,200)
gc.setColor(COLOR.Z)
gc.print(targetString:sub(progress,progress),120,280,0,2)
@@ -116,9 +116,9 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newSelector{name='level', x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function()return levelName end,code=function(i)levelName=i;targetString=levels[i]end,hideF=function()return state>0 end},
WIDGET.newSelector{name='level', x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function() return levelName end,code=function(i) levelName=i; targetString=levels[i] end,hideF=function() return state>0 end},
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'space'},
WIDGET.newButton{name='keyboard',x=160,y=210,w=180,h=100,code=function()love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1)end,hide=not MOBILE},
WIDGET.newButton{name='keyboard',x=160,y=210,w=180,h=100,code=function() love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1) end,hide=not MOBILE},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -49,7 +49,7 @@ local function checkBoard(b,p)
end
local function full(L)
for i=1,9 do
if not L[i]then
if not L[i] then
return false
end
end
@@ -61,30 +61,30 @@ local function place(X,x)
lastX,lastx=X,x
curX,curx=nil
placeTime=TIME()
if checkBoard(board[X],round)then
if checkBoard(board[X],round) then
score[X]=round
if checkBoard(score,round)then
if checkBoard(score,round) then
gameover=round
SFX.play('win')
return
else
if full(score)then
if full(score) then
gameover=true
return
end
end
SFX.play('reach')
else
if full(board[X])then
if full(board[X]) then
SFX.play('emit')
score[X]=true
if full(score)then
if full(score) then
gameover=true
return
end
end
end
if score[x]then
if score[x] then
target=false
else
target=x
@@ -108,9 +108,9 @@ function scene.mouseMove(x,y)
y<0 or y>8 or
curX<1 or curX>9 or
curx<1 or curx>9 or
score[curX]or
not(target==curX or not target)or
board[curX][curx]or
score[curX] or
not (target==curX or not target) or
board[curX][curx] or
gameover
then
curX,curx=nil
@@ -154,7 +154,7 @@ function scene.draw()
gc.setLineWidth(.8)
for X=1,9 do
if score[X]then
if score[X] then
if score[X]==0 then
gc.setColor(.5,0,0)
elseif score[X]==1 then

View File

@@ -116,8 +116,8 @@ local levels={
local a=rnd(17,int(s/2))
return{COLOR.J,b16(a),COLOR.Z,"+",COLOR.J,b16(s-a)},s
end,nil,nil,
function()timing=false return "Coming S∞n"..(rnd()<.5 and""or" "),1e99 end,
}setmetatable(levels,{__index=function(self,k)return self[k-1]end})
function() timing=false return "Coming S∞n"..(rnd()<.5 and "" or " "),1e99 end,
}setmetatable(levels,{__index=function(self,k) return self[k-1] end})
local level
@@ -160,17 +160,17 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key:sub(1,2)=="kp"then key=key:sub(3)end
if #key==1 and("0123456789"):find(key,nil,true)then
if key:sub(1,2)=="kp" then key=key:sub(3) end
if #key==1 and ("0123456789"):find(key,nil,true) then
if #input<8 then
input=input..key
inputTime=1
check(tonumber(input))
SFX.play('touch')
end
elseif key=='-'then
elseif key=='-' then
if #input<8 then
if input:find("-")then
if input:find("-") then
input=input:sub(2)
else
input="-"..input
@@ -179,13 +179,13 @@ function scene.keyDown(key,isRep)
check(tonumber(input))
SFX.play('hold')
end
elseif key=='backspace'then
elseif key=='backspace' then
input=""
inputTime=0
elseif key=='r'then
elseif key=='r' then
reset()
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
SCN.back()
end
end
@@ -209,7 +209,7 @@ function scene.draw()
GC.mStr("["..level.."]",640,30)
FONT.set(80)
if type(question)=='table'then gc.setColor(1,1,1)end
if type(question)=='table' then gc.setColor(1,1,1) end
GC.mStr(question,640,60)
FONT.set(80)

View File

@@ -35,26 +35,26 @@ end
scene.mouseDown=NULL
function scene.keyDown(key)
if kb.isDown('lshift','rshift')then
if key=='='then
if kb.isDown('lshift','rshift') then
if key=='=' then
scene.keyDown('+')
return
elseif kb.isDown('lshift','rshift')and key=='8'then
elseif kb.isDown('lshift','rshift') and key=='8' then
scene.keyDown('*')
return
end
elseif key:sub(1,2)=='kp'then
elseif key:sub(1,2)=='kp' then
scene.keyDown(key:sub(3))
return
end
if keySounds[key]then
if keySounds[key] then
Snd('bell',keySounds[key])
end
if key=='.'then
if sym=="="then
if key=='.' then
if sym=="=" then
sym,reg=false,false
val="0."
elseif not(val:find(".",nil,true)or val:find("e"))then
elseif not (val:find(".",nil,true) or val:find("e")) then
if sym and not reg then
reg=val
val="0."
@@ -62,38 +62,38 @@ function scene.keyDown(key)
val=val.."."
end
end
elseif key=='e'then
if sym=="="then
elseif key=='e' then
if sym=="=" then
sym,reg=false
val="0e"
elseif not val:find("e")then
elseif not val:find("e") then
val=val.."e"
end
elseif key=='backspace'then
if sym=="="then
elseif key=='backspace' then
if sym=="=" then
val=""
elseif sym then
sym=false
else
val=val:sub(1,-2)
end
if val==""then
if val=="" then
val="0"
end
elseif key=='+'then
elseif key=='+' then
_autoReturn()
sym="+"
elseif key=='*'then
elseif key=='*' then
_autoReturn()
sym="*"
elseif key=='-'then
elseif key=='-' then
_autoReturn()
sym="-"
elseif key=='/'then
elseif key=='/' then
_autoReturn()
sym="/"
elseif key:byte()>=48 and key:byte()<=57 then
if sym=="="then
if sym=="=" then
val=key
sym=false
elseif sym and not reg then
@@ -101,35 +101,35 @@ function scene.keyDown(key)
val=key
else
if #val<14 then
if val=="0"then
if val=="0" then
val=""
end
val=val..key
end
end
elseif key=='return'then
elseif key=='return' then
scene.keyDown('calculate')
elseif key=='calculate'then
elseif key=='calculate' then
val=val:gsub("e$","")
if sym and reg then
reg=reg:gsub("e$","")
val=
sym=="+"and tostring((tonumber(reg)or 0)+tonumber(val))or
sym=="-"and tostring((tonumber(reg)or 0)-tonumber(val))or
sym=="*"and tostring((tonumber(reg)or 0)*tonumber(val))or
sym=="/"and tostring((tonumber(reg)or 0)/tonumber(val))or
sym=="+" and tostring((tonumber(reg) or 0)+tonumber(val)) or
sym=="-" and tostring((tonumber(reg) or 0)-tonumber(val)) or
sym=="*" and tostring((tonumber(reg) or 0)*tonumber(val)) or
sym=="/" and tostring((tonumber(reg) or 0)/tonumber(val)) or
"-1"
end
sym="="
reg=false
elseif key=='escape'then
if val~="0"then
elseif key=='escape' then
if val~="0" then
reg,sym=false,false
val="0"
else
SCN.back()
end
elseif key=='delete'then
elseif key=='delete' then
val="0"
end
end
@@ -141,9 +141,9 @@ function scene.draw()
gc.setLineWidth(2)
gc.rectangle('line',100,80,650,150,5)
FONT.set(45)
if reg then gc.printf(reg,0,100,720,'right')end
if val then gc.printf(val,0,150,720,'right')end
if sym then FONT.set(50)gc.print(sym,126,150)end
if reg then gc.printf(reg,0,100,720,'right') end
if val then gc.printf(val,0,150,720,'right') end
if sym then FONT.set(50)gc.print(sym,126,150) end
end
scene.widgetList={

View File

@@ -19,7 +19,7 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='space'or key=='return'then
if key=='space' or key=='return' then
if state==0 then
state=1
elseif state==1 then
@@ -27,8 +27,8 @@ function scene.keyDown(key,isRep)
vx=pow*cos(ang)/2.6
vy=pow*sin(ang)/2.6
end
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
SCN.back()
end
end
@@ -110,7 +110,7 @@ function scene.draw()
gc.setColor(1,1,.6)
gc.print("x"..combo,300,80)
end
gc.setColor(COLOR[scoreColor[int(score/20)+1]or'D'])
gc.setColor(COLOR[scoreColor[int(score/20)+1] or 'D'])
gc.print(score,300,30)
--Cannon ball

View File

@@ -6,7 +6,7 @@ local C=COLOR
local inputBox=WIDGET.newInputBox{name='input',x=40,y=650,w=1200,h=50,fType='mono'}
local outputBox=WIDGET.newTextBox{name='output',x=40,y=30,w=1200,h=610,font=25,fType='mono',lineH=25,fix=true}
local function log(str)outputBox:push(str)end
local function log(str) outputBox:push(str) end
_SCLOG=log
log{C.lP,"Techmino Console"}
@@ -17,7 +17,7 @@ local history,hisPtr={"?"}
local sumode=false
local the_secret=(0xe^2*10)..(2*0xb)
local commands={}do
local commands={} do
--[[
format of elements in table 'commands':
key: the command name
@@ -34,12 +34,12 @@ local commands={}do
code=function(arg)
if #arg>0 then
--help [command]
if commands[arg]then
if commands[arg] then
if commands[arg].description then
log{C.H,("%s"):format(commands[arg].description)}
end
if commands[arg].details then
for _,v in ipairs(commands[arg].details)do log(v)end
for _,v in ipairs(commands[arg].details) do log(v) end
else
log{C.Y,("No details for command '%s'"):format(arg)}
end
@@ -93,7 +93,7 @@ local commands={}do
},
}commands.quit="exit"
commands.echo={
code=function(str)if str~=""then log(str)end end,
code=function(str) if str~="" then log(str) end end,
description="Print a message",
details={
"Print a message to this window.",
@@ -102,7 +102,7 @@ local commands={}do
},
}
commands.cls={
code=function()outputBox:clear()end,
code=function() outputBox:clear() end,
description="Clear the window",
details={
"Clear the log output.",
@@ -115,9 +115,9 @@ local commands={}do
do--tree
local function tree(path,name,depth)
local info=love.filesystem.getInfo(path..name)
if info.type=='file'then
if info.type=='file' then
log(("\t\t"):rep(depth)..name)
elseif info.type=='directory'then
elseif info.type=='directory' then
log(("\t\t"):rep(depth)..name..">")
local L=love.filesystem.getDirectoryItems(path..name)
for _,subName in next,L do
@@ -146,7 +146,7 @@ local commands={}do
end
do--del
local function delFile(name)
if love.filesystem.remove(name)then
if love.filesystem.remove(name) then
log{C.Y,("Deleted: '%s'"):format(name)}
else
log{C.R,("Failed to delete: '%s'"):format(name)}
@@ -154,7 +154,7 @@ local commands={}do
end
local function delDir(name)
if #love.filesystem.getDirectoryItems(name)==0 then
if love.filesystem.remove(name)then
if love.filesystem.remove(name) then
log{C.Y,("Directory deleted: '%s'"):format(name)}
else
log{C.R,("Failed to delete directory '%s'"):format(name)}
@@ -166,7 +166,7 @@ local commands={}do
local function recursiveDelDir(dir)
local containing=love.filesystem.getDirectoryItems(dir)
if #containing==0 then
if love.filesystem.remove(dir)then
if love.filesystem.remove(dir) then
log{C.Y,("Succesfully deleted directory '%s'"):format(dir)}
else
log{C.R,("Failed to delete directory '%s'"):format(dir)}
@@ -176,9 +176,9 @@ local commands={}do
local path=dir.."/"..name
local info=love.filesystem.getInfo(path)
if info then
if info.type=='file'then
if info.type=='file' then
delFile(path)
elseif info.type=='directory'then
elseif info.type=='directory' then
recursiveDelDir(path)
else
log("Unknown item type: %s (%s)"):format(name,info.type)
@@ -195,16 +195,16 @@ local commands={}do
name=name:sub(4)
end
if name~=""then
if name~="" then
local info=love.filesystem.getInfo(name)
if info then
if info.type=='file'then
if info.type=='file' then
if not recursive then
delFile(name)
else
log{C.R,("'%s' is not a directory."):format(name)}
end
elseif info.type=='directory'then
elseif info.type=='directory' then
(recursive and recursiveDelDir or delDir)(name)
else
log("Unknown item type: %s (%s)"):format(name,info.type)
@@ -244,7 +244,7 @@ local commands={}do
--Check file exist
local info
info=love.filesystem.getInfo(arg[1])
if not(info and info.type=='file')then
if not (info and info.type=='file') then
log{C.R,("'%s' is not a file!"):format(arg[1])}
return
end
@@ -257,19 +257,19 @@ local commands={}do
--Read file
local data,err1=love.filesystem.read('data',arg[1])
if not data then
log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or"Unknown error")}
log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or "Unknown error")}
return
end
--Write file
local res,err2=love.filesystem.write(arg[2],data)
if not res then
log{C.R,("Failed to write file: "):format(err2 or"Unknown error")}
log{C.R,("Failed to write file: "):format(err2 or "Unknown error")}
return
end
--Delete file
if not love.filesystem.remove(arg[1])then
if not love.filesystem.remove(arg[1]) then
log{C.R,("Failed to delete old file ''"):format(arg[1])}
return
end
@@ -288,12 +288,12 @@ local commands={}do
}commands.ren="mv"
commands.print={
code=function(name)
if name~=""then
if name~="" then
local info=love.filesystem.getInfo(name)
if info then
if info.type=='file'then
if info.type=='file' then
log{COLOR.lC,"/* "..name.." */"}
for l in love.filesystem.lines(name)do
for l in love.filesystem.lines(name) do
log(l)
end
log{COLOR.lC,"/* END */"}
@@ -317,16 +317,16 @@ local commands={}do
--System
commands.crash={
code=function()error("ERROR")end,
code=function() error("ERROR") end,
description="Manually crash the game",
}
commands.mes={
code=function(arg)
if
arg=='check'or
arg=='info'or
arg=='broadcast'or
arg=='warn'or
arg=='check' or
arg=='info' or
arg=='broadcast' or
arg=='warn' or
arg=='error'
then
MES.new(arg,"Test message",6)
@@ -359,7 +359,7 @@ local commands={}do
}
commands.openurl={
code=function(url)
if url~=""then
if url~="" then
local res,err=pcall(love.system.openURL,url)
if not res then
log{C.R,"[ERR] ",C.Z,err}
@@ -377,7 +377,7 @@ local commands={}do
}
commands.scrinfo={
code=function()
for _,v in next,SCR.info()do
for _,v in next,SCR.info() do
log(v)
end
end,
@@ -390,9 +390,9 @@ local commands={}do
}
commands.wireframe={
code=function(bool)
if bool=="on"or bool=="off"then
if bool=="on" or bool=="off" then
gc.setWireframe(bool=="on")
log("Wireframe: "..(gc.isWireframe()and"on"or"off"))
log("Wireframe: "..(gc.isWireframe() and "on" or "off"))
else
log{C.A,"Usage: wireframe <on|off>"}
end
@@ -406,9 +406,9 @@ local commands={}do
}
commands.gammacorrect={
code=function(bool)
if bool=="on"or bool=="off"then
if bool=="on" or bool=="off" then
love._setGammaCorrect(bool=="on")
log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off"))
log("GammaCorrect: "..(gc.isGammaCorrect() and "on" or "off"))
else
log{C.A,"Usage: gammacorrect <on|off>"}
end
@@ -422,7 +422,7 @@ local commands={}do
}
commands.fn={
code=function(n)
if tonumber(n)then
if tonumber(n) then
n=math.floor(tonumber(n))
if n>=1 and n<=12 then
love.keypressed("f"..n)
@@ -441,9 +441,9 @@ local commands={}do
}
commands.playbgm={
code=function(bgm)
if bgm~=""then
if bgm~="" then
if bgm~=BGM.getPlaying()[1] then
if BGM.play(bgm)then
if BGM.play(bgm) then
log("Now playing: "..bgm)
else
log("No BGM called "..bgm)
@@ -475,9 +475,9 @@ local commands={}do
}
commands.setbg={
code=function(name)
if name~=""then
if name~="" then
if name~=BG.cur then
if BG.set(name)then
if BG.set(name) then
log(("Background set to '%s'"):format(name))
else
log(("No background called '%s'"):format(name))
@@ -498,8 +498,8 @@ local commands={}do
}
commands.theme={
code=function(name)
if name~=""then
if THEME.set(name)then
if name~="" then
if THEME.set(name) then
log("Theme set to: "..name)
else
log("No theme called "..name)
@@ -529,7 +529,7 @@ local commands={}do
commands.support={
code=function(arg)
if FNNS then
if arg:find"pl"and arg:find"fk"then
if arg:find"pl" and arg:find"fk" then
SCN.go('support','none')
else
love.system.openURL("https://www.bilibili.com/video/BV1uT4y1P7CX?secretcode=fkpl")
@@ -665,11 +665,11 @@ local commands={}do
}
commands.app={
code=function(name)
if name=="-list"then
if name=="-list" then
for i=1,#APPs do
log(("$1 $2 $3"):repD(APPs[i].code,("·"):rep(10-#APPs[i].code),APPs[i].description))
end
elseif name~=""then
elseif name~="" then
for i=1,#APPs do
if APPs[i].code==name then
SCN.go(APPs[i].scene)
@@ -695,12 +695,12 @@ local commands={}do
end
commands.resetall={
code=function(arg)
if arg=="sure"then
if arg=="sure" then
log"FINAL WARNING!"
log"Please remember that resetting everything will delete all saved data. Delete the saved data anyway?"
log"Once the data has been deleted, there is no way to recover it."
log"Type: resetall really"
elseif arg=="really"then
elseif arg=="really" then
WIDGET.unFocus(true)inputBox.hide=true
BGM.stop()
commands.cls.code()
@@ -709,7 +709,7 @@ local commands={}do
local button=WIDGET.newButton{name='bye',x=640,y=615,w=426,h=100,code=function()
TASK.new(function()
WIDGET.active.bye.hide=true
for _=1,30 do coroutine.yield()end
for _=1,30 do coroutine.yield() end
log{C.R,"Deleting all data in 10..."}SFX.play('ready')SFX.play('clear_1')TEST.yieldN(60)
log{C.R,"Deleting all data in 9..."}SFX.play('ready')SFX.play('clear_1')TEST.yieldN(60)
log{C.R,"Deleting all data in 8..."}SFX.play('ready')SFX.play('clear_1')TEST.yieldN(60)
@@ -742,7 +742,7 @@ local commands={}do
if sumode then
log{C.Y,"You are already in su mode. Use # to run any lua code"}
log{C.Y,"已经进入最高权限模式了, 请使用 # 执行任意lua代码"}
elseif code=="7126"then
elseif code=="7126" then
sumode=true
log{C.Y,"* SU MODE ON - DO NOT RUN ANY CODES IF YOU DO NOT KNOW WHAT THEY DO *"}
log{C.Y,"* Use the _SCLOG(message) function to print into this console *"}
@@ -781,7 +781,7 @@ local commands={}do
commands.rmrecord={
code=function(modeName)
if #modeName>0 then
if MODES[modeName]then
if MODES[modeName] then
MODES[modeName].records={}
log{C.Y,("Succesfully erased records of "..modeName)}
love.filesystem.remove("record/"..modeName..".rec")
@@ -802,9 +802,9 @@ local commands={}do
}
commands.unlockall={
code=function(bool)
if bool=="sure"then
if bool=="sure" then
for name,M in next,MODES do
if type(name)=='string'and not RANKS[name]and M.x then
if type(name)=='string' and not RANKS[name] and M.x then
if M.x then
RANKS[name]=0
end
@@ -827,9 +827,9 @@ local commands={}do
}
commands.play={
code=function(m)
if MODES[m]then
if MODES[m] then
loadGame(m,true)
elseif m~=""then
elseif m~="" then
log{C.R,"No mode called "..m}
else
log{C.A,"Usage: play [modeName]"}
@@ -844,7 +844,7 @@ local commands={}do
}
commands.tas={
code=function(bool)
if bool=="on"or bool=="off"then
if bool=="on" or bool=="off" then
SETTING.allowTAS=bool=="on"
saveSettings()
log("Allow TAS: "..bool)
@@ -873,7 +873,7 @@ local commands={}do
commands.switchhost={
code=function(arg)
arg=arg:split(" ")
if arg[1]and #arg<=3 then
if arg[1] and #arg<=3 then
WS.switchHost(unpack(arg))
log{C.Y,"Host switched"}
else
@@ -912,15 +912,15 @@ local commands={}do
log{C.R,"Format error"}
end
end
function commands.m_connInfo()WS.send('game',JSON.encode{action=10})end
function commands.m_playMgrInfo()WS.send('game',JSON.encode{action=11})end
function commands.m_streamMgrInfo()WS.send('game',JSON.encode{action=12})end
function commands.m_connInfo() WS.send('game',JSON.encode{action=10}) end
function commands.m_playMgrInfo() WS.send('game',JSON.encode{action=11}) end
function commands.m_streamMgrInfo() WS.send('game',JSON.encode{action=12}) end
for cmd,body in next,commands do
if type(body)=='function'then
if type(body)=='function' then
commands[cmd]={code=body}
end
if type(body)~='string'then
if type(body)~='string' then
ins(cmdList,cmd)
end
end
@@ -967,11 +967,11 @@ local userG={
}
function userG.print(...)
local args,L={...},{}
for k,v in next,args do ins(L,{k,v})end
table.sort(L,function(a,b)return a[1]<b[1]end)
for k,v in next,args do ins(L,{k,v}) end
table.sort(L,function(a,b) return a[1]<b[1] end)
local i=1
while L[1]do
if i==L[1][1]then
while L[1] do
if i==L[1][1] then
log(tostring(L[1][2]))
rem(L,1)
else
@@ -986,7 +986,7 @@ TABLE.complete(string,userG.string)userG.string.dump=nil
TABLE.complete(table,userG.table)
TABLE.complete(bit,userG.bit)
TABLE.complete(coroutine,userG.coroutine)
local dangerousLibMeta={__index=function()error("No way.")end}
local dangerousLibMeta={__index=function() error("No way.") end}
setmetatable(userG.debug,dangerousLibMeta)
setmetatable(userG.package,dangerousLibMeta)
setmetatable(userG.io,dangerousLibMeta)
@@ -998,7 +998,7 @@ local fleg={
pw=the_secret,
supw=7126,
second_box="Coming soon",
}setmetatable(fleg,{__tostring=function()return"The fl\97g."end})
}setmetatable(fleg,{__tostring=function() return"The fl\97g." end})
function userG.the_box(k)
if k~=first_key then
log"Usage:"log"*The box is locked*"
@@ -1024,13 +1024,13 @@ function scene.wheelMoved(_,y)
end
function scene.keyDown(key)
if key=='return' or key=='kpenter'then
if key=='return' or key=='kpenter' then
local input=STRING.trim(inputBox:getText())
if input==""then return end
if input=="" then return end
--Write History
ins(history,input)
if history[27]then
if history[27] then
rem(history,1)
end
hisPtr=nil
@@ -1068,12 +1068,12 @@ function scene.keyDown(key)
local cmd,arg
if p then
cmd=input:sub(1,p-1):lower()
arg=input:sub(input:find("%S",p+1)or -1)
arg=input:sub(input:find("%S",p+1) or -1)
else
cmd=input
arg=""
end
if commands[cmd]then
if commands[cmd] then
commands[cmd].code(arg)
else
log{C.R,"No command called "..cmd}
@@ -1083,7 +1083,7 @@ function scene.keyDown(key)
--Insert empty line
log""
elseif key=='up'then
elseif key=='up' then
if not hisPtr then
hisPtr=#history
if hisPtr>0 then
@@ -1093,19 +1093,19 @@ function scene.keyDown(key)
hisPtr=hisPtr-1
inputBox:setText(history[hisPtr])
end
elseif key=='down'then
elseif key=='down' then
if hisPtr then
hisPtr=hisPtr+1
if history[hisPtr]then
if history[hisPtr] then
inputBox:setText(history[hisPtr])
else
hisPtr=nil
inputBox:clear()
end
end
elseif key=='tab'then
elseif key=='tab' then
local str=inputBox:getText()
if str~=""and not str:find("%s")then
if str~="" and not str:find("%s") then
local res={}
for c in next,commands do
if c:find(str,nil,true)==1 then
@@ -1116,26 +1116,26 @@ function scene.keyDown(key)
if #res>1 then
log(">Commands that start with '"..str.."' :")
table.sort(res)
for i=1,#res do log{COLOR.lH,res[i]}end
for i=1,#res do log{COLOR.lH,res[i]} end
elseif #res==1 then
inputBox:setText(res[1])
end
end
elseif key=='scrollup'then outputBox:scroll(-5)
elseif key=='scrolldown'then outputBox:scroll(5)
elseif key=='pageup'then outputBox:scroll(-25)
elseif key=='pagedown'then outputBox:scroll(25)
elseif key=='home'then outputBox:scroll(-1e99)
elseif key=='end'then outputBox:scroll(1e99)
elseif combKey[key]and kb.isDown('lctrl','rctrl')then combKey[key]()
elseif key=='escape'then
if not WIDGET.isFocus(inputBox)then
elseif key=='scrollup' then outputBox:scroll(-5)
elseif key=='scrolldown' then outputBox:scroll(5)
elseif key=='pageup' then outputBox:scroll(-25)
elseif key=='pagedown' then outputBox:scroll(25)
elseif key=='home' then outputBox:scroll(-1e99)
elseif key==' end' then outputBox:scroll(1e99)
elseif combKey[key] and kb.isDown('lctrl','rctrl') then combKey[key]()
elseif key=='escape' then
if not WIDGET.isFocus(inputBox) then
WIDGET.focus(inputBox)
else
SCN.back()
end
else
if not WIDGET.isFocus(inputBox)then
if not WIDGET.isFocus(inputBox) then
WIDGET.focus(inputBox)
end
return true

View File

@@ -27,7 +27,7 @@ local score
local sunH,color,rot
local function near(o,t)
return o>t and max(o-.01,t)or o<t and min(o+.01,t)or o
return o>t and max(o-.01,t) or o<t and min(o+.01,t) or o
end
local function hurt(i)
life=life-i
@@ -46,8 +46,8 @@ end
local scene={}
function scene.sceneInit()
cubesX={}for i=1,40 do cubesX[i]=rnd()*16-8 end
cubesY={}for i=1,40 do cubesY[i]=i/40*9 end
cubesX={} for i=1,40 do cubesX[i]=rnd()*16-8 end
cubesY={} for i=1,40 do cubesY[i]=i/40*9 end
lastCube=1
player,moveDir=0,0
life,life1,inv=0,0,false
@@ -95,16 +95,16 @@ function scene.touchUp(x)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='escape'then
if key=='escape' then
SCN.back()
elseif play then
if key=='left'or key=='a'then
if key=='left' or key=='a' then
moveDir=-1
elseif key=='right'or key=='d'then
elseif key=='right' or key=='d' then
moveDir=1
end
else
if key=='space'and ct==60 then
if key=='space' and ct==60 then
menu=-1
speed=1
level=1
@@ -113,10 +113,10 @@ function scene.keyDown(key,isRep)
end
function scene.keyUp(key)
if play then
if key=='left'or key=='a'then
moveDir=kb.isDown('right','d')and 1 or 0
elseif key=='right'or key=='d'then
moveDir=kb.isDown('left','a')and -1 or 0
if key=='left' or key=='a' then
moveDir=kb.isDown('right','d') and 1 or 0
elseif key=='right' or key=='d' then
moveDir=kb.isDown('left','a') and -1 or 0
end
end
end
@@ -196,7 +196,7 @@ function scene.update(dt)
menu=false
end
elseif menu==-1 then
for i=1,3 do color[i]=near(color[i],cubeColor[1][i])end
for i=1,3 do color[i]=near(color[i],cubeColor[1][i]) end
for i=1,40 do cubesY[i]=cubesY[i]-(70-ct)*.003 end
if sunH>0 then
sunH=max(sunH*.85-1,0)
@@ -204,11 +204,11 @@ function scene.update(dt)
ct=ct-1
if ct==0 then
local t=love.system.getClipboardText()
if type(t)=='string'then
if type(t)=='string' then
t=t:lower():match("^s=(%d+)$")
t=t and tonumber(t)and tonumber(t)>0 and tonumber(t)<=8000 and int(tonumber(t))
t=t and tonumber(t) and tonumber(t)>0 and tonumber(t)<=8000 and int(tonumber(t))
end
score=type(t)=='number'and t or 0
score=type(t)=='number' and t or 0
life=1000
play,menu=true,false
inv=90
@@ -312,7 +312,7 @@ function scene.draw()
mStr("Score : "..score,0,-350)
end
mStr(MOBILE and"Touch to Start"or"Press space to Start",0,-160)
mStr(MOBILE and "Touch to Start" or "Press space to Start",0,-160)
end
gc.pop()
end

View File

@@ -42,8 +42,8 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='space'or key=='return'then
if state=='move'then
if key=='space' or key=='return' then
if state=='move' then
if floor>0 then
if move.x<base.x then
move.x=move.x+10
@@ -53,16 +53,16 @@ function scene.keyDown(key,isRep)
end
SFX.play('hold')
state='drop'
elseif state=='dead'then
elseif state=='dead' then
move.x,move.y,move.l=1e99,0,0
base.x,base.y,base.l=1e99,0,0
state='scroll'
elseif state=='menu'then
elseif state=='menu' then
restart()
state='move'
end
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
SCN.back()
end
end
@@ -77,13 +77,13 @@ function scene.touchDown()
end
function scene.update()
if state=='move'then
if state=='move' then
move.x=move.x+speed
if speed<0 and move.x<=0 or speed>0 and move.x+move.l>=1280 then
SFX.play('lock')
speed=-speed
end
elseif state=='drop'then
elseif state=='drop' then
move.y=move.y+18
if move.y>=660 then
if move.x>base.x+base.l or move.x+move.l<base.x then
@@ -98,7 +98,7 @@ function scene.update()
state='shorten'
end
end
elseif state=='shorten'then
elseif state=='shorten' then
if move.x>base.x+base.l or move.x+move.l<base.x then
state='die'
elseif move.x<base.x then
@@ -109,7 +109,7 @@ function scene.update()
else
state='climb'
end
elseif state=='climb'then
elseif state=='climb' then
if base.y<720 then
move.y=move.y+3
base.y=base.y+3
@@ -140,14 +140,14 @@ function scene.update()
move.y=rnd(max(260-floor*4,60),max(420-floor*5,100))
state='move'
end
elseif state=='die'then
elseif state=='die' then
move.y=move.y+18
if move.y>1000 then
highScore=max(score,highScore)
highFloor=max(floor,floor)
state='dead'
end
elseif state=='scroll'then
elseif state=='scroll' then
camY=camY-floor/4
if camY<1000 then camY=camY-1 end
if camY<500 then camY=camY-1 end
@@ -177,16 +177,16 @@ setmetatable(backColor,backColor)
function scene.draw()
--Background
local lv,height=int(camY/700),camY%700
gc.setColor(backColor[lv+1]or COLOR.D)
gc.setColor(backColor[lv+1] or COLOR.D)
gc.rectangle('fill',0,720,1280,height-700)
gc.setColor(backColor[lv+2]or COLOR.D)
gc.setColor(backColor[lv+2] or COLOR.D)
gc.rectangle('fill',0,height+20,1280,-height-20)
if height-680>0 then
gc.setColor(backColor[lv+3]or COLOR.D)
gc.setColor(backColor[lv+3] or COLOR.D)
gc.rectangle('fill',0,height-680,1280,680-height)
end
if state=='menu'or state=='dead'then
if state=='menu' or state=='dead' then
setFont(100)
gc.setColor(COLOR.rainbow_light(TIME()*2.6))
mStr("DROPPER",640,120)
@@ -199,12 +199,12 @@ function scene.draw()
gc.setColor(COLOR.D)
setFont(35)
mStr(MOBILE and"Touch to Start"or"Press space to Start",640,570)
mStr(MOBILE and "Touch to Start" or "Press space to Start",640,570)
setFont(20)
gc.print("Original CX-CAS version by MrZ",740,235)
gc.print("Ported / Rewritten / Balanced by MrZ",740,260)
end
if state~='menu'then
if state~='menu' then
--High floor
gc.setColor(COLOR.Z)
gc.setLineWidth(2)

View File

@@ -39,14 +39,14 @@ local modeSelector=WIDGET.newSelector{name='mode',x=150,y=220,w=290,
"Dense_Handstream",
"Light_Quadstream",
"Quadstream",
},disp=function()return mode end,code=function(m)mode=m reset()end
},disp=function() return mode end,code=function(m) mode=m reset() end
}
local bgmSelector=WIDGET.newSelector{name='bgm',x=150,y=290,w=290,list=BGM.getList(),disp=function()return bgm end,code=function(i)bgm=i BGM.play(i)end}
local bgmSelector=WIDGET.newSelector{name='bgm',x=150,y=290,w=290,list=BGM.getList(),disp=function() return bgm end,code=function(i) bgm=i BGM.play(i) end}
local colorSelector=WIDGET.newSelector{name='color',x=150,y=360,w=290,
list={"black","dGray","gray","lGray","dRed","red","lRed","dFire","fire","lFire","dOrange","orange","lOrange","dYellow","yellow","lYellow","dLime","lime","lLime","dJade","jade","lJade","dGreen","green","lGreen","dAqua","aqua","lAqua","dCyan","cyan","lCyan","dNavy","navy","lNavy","dSea","sea","lSea","dBlue","blue","lBlue","dViolet","violet","lViolet","dPurple","purple","lPurple","dMagenta","magenta","lMagenta","dWine","wine","lWine"},
disp=function()return tileColor end,code=function(m)tileColor=m end
disp=function() return tileColor end,code=function(m) tileColor=m end
}
local arcadeSwitch=WIDGET.newSwitch{name='arcade',x=240,y=430,lim=200,font=40,disp=function()return arcade end,code=pressKey'e'}
local arcadeSwitch=WIDGET.newSwitch{name='arcade',x=240,y=430,lim=200,font=40,disp=function() return arcade end,code=pressKey'e'}
local function freshSelectors()
local f=state~=0
modeSelector.hide=f
@@ -66,7 +66,7 @@ local function get1(prev)
else
while true do
local r=rnd(4)
if not string.find(prev,r)then return r end
if not string.find(prev,r) then return r end
end
end
end
@@ -75,13 +75,13 @@ local function get2(prev)
local i=rnd(4)
local r=rnd(3)
if r>=i then r=r+1 end
if not(string.find(prev,r)or string.find(prev,i))then
if not (string.find(prev,r) or string.find(prev,i)) then
return 10*i+r
end
end
end
local function get3(prev)
if prev==0 then prev=rnd(4)end
if prev==0 then prev=rnd(4) end
if prev==1 then return 234
elseif prev==2 then return 134
elseif prev==3 then return 124
@@ -95,22 +95,22 @@ local generator={
ins(pos,rnd(4))
end,
Split=function()
if #pos==0 then ins(pos,rnd(4))end
ins(pos,pos[#pos]<=2 and rnd(3,4)or rnd(2))
if #pos==0 then ins(pos,rnd(4)) end
ins(pos,pos[#pos]<=2 and rnd(3,4) or rnd(2))
end,
Short=function()
if #pos<2 then ins(pos,rnd(4))ins(pos,rnd(4))end
if #pos<2 then ins(pos,rnd(4))ins(pos,rnd(4)) end
local r
if pos[#pos]==pos[#pos-1]then
if pos[#pos]==pos[#pos-1] then
r=rnd(3)
if r>=pos[#pos]then r=r+1 end
if r>=pos[#pos] then r=r+1 end
ins(pos,r)
else
ins(pos,rnd(4))
end
end,
Stairs=function()
local r=get1(pos[#pos]or 0)
local r=get1(pos[#pos] or 0)
local dir=r==1 and 1 or r==4 and -1 or rnd()<.5 and 1 or -1
local count=rnd(3,5)
while count>0 do
@@ -132,48 +132,48 @@ local generator={
ins(pos,r)
end,
Singlestream=function()
ins(pos,get1(pos[#pos]or 0))
ins(pos,get1(pos[#pos] or 0))
end,
Light_Jumpstream=function()--2111
ins(pos,get2(pos[#pos]or 0))
ins(pos,get2(pos[#pos] or 0))
ins(pos,get1(pos[#pos]))
ins(pos,get1(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
Dense_Jumpstream=function()--2121
ins(pos,get2(pos[#pos]or 0))
ins(pos,get2(pos[#pos] or 0))
ins(pos,get1(pos[#pos]))
ins(pos,get2(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
Light_Handstream=function()--3111
ins(pos,get3(pos[#pos]or 0))
ins(pos,get3(pos[#pos] or 0))
ins(pos,get1(pos[#pos]))
ins(pos,get1(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
Dense_Handstream=function()--3121
ins(pos,get3(pos[#pos]or 0))
ins(pos,get3(pos[#pos] or 0))
ins(pos,get1(pos[#pos]))
ins(pos,get2(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
Light_Quadstream=function()--4111
ins(pos,1234)
ins(pos,get1(pos[#pos-1]or 0))
ins(pos,get1(pos[#pos-1] or 0))
ins(pos,get1(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
Quadstream=function()--4121
ins(pos,1234)
ins(pos,get1(pos[#pos-1]or 0))
ins(pos,get1(pos[#pos-1] or 0))
ins(pos,get2(pos[#pos]))
ins(pos,get1(pos[#pos]))
end,
}
function reset()
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
keyTime={} for i=1,40 do keyTime[i]=-1e99 end
speed,maxSpeed=0,0
progress={}
state=0
@@ -182,15 +182,15 @@ function reset()
score=0
local t=love.system.getClipboardText()
if type(t)=='string'then
if type(t)=='string' then
t=t:lower():match("^s=(.+)")
t=t and tonumber(t)and tonumber(t)*2
t=t and tonumber(t) and tonumber(t)*2
t=t and tonumber(t)>=0 and tonumber(t)<=60 and t
end
rollSpeed=type(t)=='number'and t or 6.26
rollSpeed=type(t)=='number' and t or 6.26
pos={}
while #pos<7 do generator[mode]()end
while #pos<7 do generator[mode]() end
height=0
diePos=false
end
@@ -218,11 +218,11 @@ local function touch(n)
SFX.play('lock')
else
rem(pos,1)
while #pos<7 do generator[mode]()end
while #pos<7 do generator[mode]() end
ins(keyTime,1,TIME())
keyTime[21]=nil
score=score+1
if not arcade and targets[score]then
if not arcade and targets[score] then
ins(progress,("%s - %.3fs"):format(score,TIME()-startTime))
if score==2600 then
for i=1,#pos do
@@ -247,23 +247,23 @@ local function touch(n)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='r'or key=='space'then reset()
elseif key=='escape'then SCN.back()
if key=='r' or key=='space' then reset()
elseif key=='escape' then SCN.back()
elseif state~=2 then
if key=='d'or key=='c'then touch(1)
elseif key=='f'or key=='v'then touch(2)
elseif key=='j'or key=='n'then touch(3)
elseif key=='k'or key=='m'then touch(4)
if key=='d' or key=='c' then touch(1)
elseif key=='f' or key=='v' then touch(2)
elseif key=='j' or key=='n' then touch(3)
elseif key=='k' or key=='m' then touch(4)
elseif state==0 then
if key=='tab'then
if key=='tab' then
local mode1=mode
modeSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
if mode1~=mode then reset()end
elseif key=='q'then
bgmSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
elseif key=='w'then
colorSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
elseif key=='e'then
modeSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1)
if mode1~=mode then reset() end
elseif key=='q' then
bgmSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1)
elseif key=='w' then
colorSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1)
elseif key=='e' then
arcade=not arcade
end
end
@@ -285,7 +285,7 @@ function scene.update(dt)
local t=TIME()
time=t-startTime
local v=0
for i=2,20 do v=v+i*(i-1)*.3/(t-keyTime[i])end
for i=2,20 do v=v+i*(i-1)*.3/(t-keyTime[i]) end
speed=MATH.expApproach(speed,v,dt)
if speed>maxSpeed then maxSpeed=speed end
@@ -302,7 +302,7 @@ function scene.update(dt)
end
end
local function boardStencil()gc.rectangle('fill',300,0,680,720)end
local function boardStencil() gc.rectangle('fill',300,0,680,720) end
function scene.draw()
setFont(50)
if arcade then

View File

@@ -111,7 +111,7 @@ local function newGame()
end
local function addPoint(list,x,y)
local l=#list
if x~=list[l-1]or y~=list[l]then
if x~=list[l-1] or y~=list[l] then
list[l+1]=x
list[l+2]=y
end
@@ -122,12 +122,12 @@ local function checkLink(x1,y1,x2,y2)
do
if x1>x2 then x1,y1,x2,y2=x2,y2,x1,y1 end
local luy,ldy,ruy,rdy=y1,y1,y2,y2
while luy>1 and not field[luy-1][x1]do luy=luy-1 end
while ldy<field.r and not field[ldy+1][x1]do ldy=ldy+1 end
while ruy>1 and not field[ruy-1][x2]do ruy=ruy-1 end
while rdy<field.r and not field[rdy+1][x2]do rdy=rdy+1 end
for y=max(luy,ruy),min(ldy,rdy)do
for x=x1+1,x2-1 do if field[y][x]then goto CONTINUE_nextRow end end
while luy>1 and not field[luy-1][x1] do luy=luy-1 end
while ldy<field.r and not field[ldy+1][x1] do ldy=ldy+1 end
while ruy>1 and not field[ruy-1][x2] do ruy=ruy-1 end
while rdy<field.r and not field[rdy+1][x2] do rdy=rdy+1 end
for y=max(luy,ruy),min(ldy,rdy) do
for x=x1+1,x2-1 do if field[y][x] then goto CONTINUE_nextRow end end
do
local len=abs(x1-x2)+abs(y-y1)+abs(y-y2)
if len<bestLen then
@@ -145,12 +145,12 @@ local function checkLink(x1,y1,x2,y2)
do
if y1>y2 then x1,y1,x2,y2=x2,y2,x1,y1 end
local ulx,urx,dlx,drx=x1,x1,x2,x2
while ulx>1 and not field[y1][ulx-1]do ulx=ulx-1 end
while urx<field.c and not field[y1][urx+1]do urx=urx+1 end
while dlx>1 and not field[y2][dlx-1]do dlx=dlx-1 end
while drx<field.c and not field[y2][drx+1]do drx=drx+1 end
for x=max(ulx,dlx),min(urx,drx)do
for y=y1+1,y2-1 do if field[y][x]then goto CONTINUE_nextCol end end
while ulx>1 and not field[y1][ulx-1] do ulx=ulx-1 end
while urx<field.c and not field[y1][urx+1] do urx=urx+1 end
while dlx>1 and not field[y2][dlx-1] do dlx=dlx-1 end
while drx<field.c and not field[y2][drx+1] do drx=drx+1 end
for x=max(ulx,dlx),min(urx,drx) do
for y=y1+1,y2-1 do if field[y][x] then goto CONTINUE_nextCol end end
do
local len=abs(y1-y2)+abs(x-x1)+abs(x-x2)
if len<bestLen then
@@ -172,7 +172,7 @@ local function tap(x,y)
state=1
startTime=TIME()
elseif state==1 then
if selX and(x~=selX or y~=selY)and field[y][x]==field[selY][selX]then
if selX and (x~=selX or y~=selY) and field[y][x]==field[selY][selX] then
local line=checkLink(x,y,selX,selY)
if line then
ins(lines,{time=0,line=line})
@@ -208,11 +208,11 @@ local function tap(x,y)
end
ins(progress,
noComboBreak and
("%s [FC] %.2fs"):format(level,TIME()-startTime)or
("%s [FC] %.2fs"):format(level,TIME()-startTime) or
("%s - %.2fs"):format(level,TIME()-startTime)
)
level=level+1
if levels[level]then
if levels[level] then
resetBoard()
SFX.play('reach')
else
@@ -221,8 +221,8 @@ local function tap(x,y)
end
else
SFX.play(
combo<50 and'clear_1'or
combo<100 and'clear_2'or
combo<50 and 'clear_1' or
combo<100 and 'clear_2' or
'clear_3',.8
)
end
@@ -232,7 +232,7 @@ local function tap(x,y)
SFX.play('lock',.9)
end
else
if field[y][x]and(x~=selX or y~=selY)then
if field[y][x] and (x~=selX or y~=selY) then
selX,selY=x,y
SFX.play('lock',.8)
end
@@ -251,18 +251,18 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='r'then
if state~=1 or tryReset()then
if key=='r' then
if state~=1 or tryReset() then
newGame()
end
elseif key=='z'or key=='x'then
elseif key=='z' or key=='x' then
love.mousepressed(ms.getPosition())
elseif key=='escape'then
if state~=1 or tryBack()then
elseif key=='escape' then
if state~=1 or tryBack() then
SCN.back()
end
elseif state==0 then
if key=='q'then
if key=='q' then
invis=not invis
end
end
@@ -272,10 +272,10 @@ local function touch(x,y)
y=int((y-field.y)/field.h*field.r+1)
tap(x,y)
end
function scene.mouseDown(x,y,k)if k==1 or k==2 or not k then touch(x,y)end end
function scene.mouseMove(x,y)if(msIsDown(1)or kbIsDown('z','x'))then touch(x,y)end end
function scene.touchDown(x,y)touch(x,y)end
function scene.touchMove(x,y)touch(x,y)end
function scene.mouseDown(x,y,k) if k==1 or k==2 or not k then touch(x,y) end end
function scene.mouseMove(x,y) if (msIsDown(1) or kbIsDown('z','x')) then touch(x,y) end end
function scene.touchDown(x,y) touch(x,y) end
function scene.touchMove(x,y) touch(x,y) end
function scene.update(dt)
if state==1 then
@@ -309,7 +309,7 @@ function scene.draw()
gc_setColor(COLOR.dH)
for y=1,field.r do
for x=1,field.c do
if field[y][x]then
if field[y][x] then
gc_rectangle('fill',x-1,y-1,1,1)
end
end
@@ -370,7 +370,7 @@ function scene.draw()
--Progress time list
setFont(15)gc.setColor(.6,.6,.6)
for i=1,#progress do gc.print(progress[i],1140,40+20*i)end
for i=1,#progress do gc.print(progress[i],1140,40+20*i) end
--Combo Rectangle
if comboTime>0 then
@@ -397,8 +397,8 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newButton{name='reset',x=80,y=60,w=110,h=60,color='lG',fText=CHAR.icon.retry_spin,code=pressKey'r',hideF=function()return state==0 end},
WIDGET.newSwitch{name='invis',x=100,y=140,lim=80,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newButton{name='reset',x=80,y=60,w=110,h=60,color='lG',fText=CHAR.icon.retry_spin,code=pressKey'r',hideF=function() return state==0 end},
WIDGET.newSwitch{name='invis',x=100,y=140,lim=80,disp=function() return invis end,code=pressKey'q',hideF=function() return state==1 end},
WIDGET.newButton{name='back',x=1200,y=660,w=110,font=45,sound='back',fText=CHAR.icon.back,code=pressKey'escape'},
}

View File

@@ -13,7 +13,7 @@ for i=1,9 do
ins(deck0,'m'..i)
ins(deck0,'p'..i)
ins(deck0,'s'..i)
if i<=7 then ins(deck0,'z'..i)end
if i<=7 then ins(deck0,'z'..i) end
end
end
-- deck0[TABLE.find(deck0,'m5')]='m0'
@@ -58,7 +58,7 @@ local cardText={
z5={COLOR.D,CHAR.mahjong.haku},
z6={COLOR.G,CHAR.mahjong.hatsu},
z7={COLOR.R,CHAR.mahjong.chun},
}for _,v in next,cardText do ins(v,COLOR.D)ins(v,CHAR.mahjong.frameComb) end
} for _,v in next,cardText do ins(v,COLOR.D)ins(v,CHAR.mahjong.frameComb) end
local deck,hand,pool
local selected
@@ -81,7 +81,7 @@ local function _newGame()
deck=TABLE.shift(deck0)
hand={}
pool={}
for _=1,14 do ins(hand,(TABLE.popRandom(deck)))end
for _=1,14 do ins(hand,(TABLE.popRandom(deck))) end
table.sort(hand)
end
@@ -92,7 +92,7 @@ local function _checkWin()
end
local function _throwCard()
if hand[selected]and #pool<40 then
if hand[selected] and #pool<40 then
ins(pool,rem(hand,selected))
table.sort(hand)
SFX.play('hold')
@@ -124,29 +124,29 @@ end
function scene.mouseDown()
_throwCard()
end
function scene.touchMove(x,y)scene.mouseMove(x,y)end
function scene.touchDown(x,y)scene.mouseMove(x,y)end
function scene.touchClick(x,y)scene.mouseDown(x,y)end
function scene.touchMove(x,y) scene.mouseMove(x,y) end
function scene.touchDown(x,y) scene.mouseMove(x,y) end
function scene.touchClick(x,y) scene.mouseDown(x,y) end
function scene.keyDown(key)
if key=='left'then
if key=='left' then
if selected then
selected=max(selected-1,1)
else
selected=1
end
elseif key=='right'then
elseif key=='right' then
if selected then
selected=min(selected+1,#hand)
else
selected=#hand
end
elseif key=='space'then
elseif key=='space' then
_throwCard()
elseif key=='r'then
elseif key=='r' then
_newGame()
elseif key=='return'then
elseif key=='return' then
_checkWin()
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
@@ -172,7 +172,7 @@ function scene.draw()
end
gc_setColor(1,1,1)
GC.mStr(cardText[c],x+w/2,y-17)
if i==selected then gc_translate(0,10)end
if i==selected then gc_translate(0,10) end
end
for i=1,#pool do
local c=pool[i]

View File

@@ -12,7 +12,7 @@ local scene={}
local function newNum(lv)
local num=""
for _=1,4+lv^.66 do num=num..math.random(0,9)end
for _=1,4+lv^.66 do num=num..math.random(0,9) end
return num
end
@@ -40,15 +40,15 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='escape'then
if tryBack()then
if key=='escape' then
if tryBack() then
SCN.back()
end
elseif key=='r'then
elseif key=='r' then
_reset()
elseif state==0 then
if key:sub(1,2)=="kp"then key=key:sub(3)end
if #key==1 and("0123456789"):find(key,nil,true)then
if key:sub(1,2)=="kp" then key=key:sub(3) end
if #key==1 and ("0123456789"):find(key,nil,true) then
input=input..key
showTime=math.min(showTime,0)
if input==showNum then
@@ -56,7 +56,7 @@ function scene.keyDown(key,isRep)
freshLevel()
SFX.play('reach')
end
elseif key=='space'or key=='backspace'then
elseif key=='space' or key=='backspace' then
input=""
end
end

View File

@@ -24,19 +24,19 @@ end
scene.mouseDown=scene.touchDown
function scene.keyDown(key,isRep)
if not isRep and keys[key]then
if not isRep and keys[key] then
local note=keys[key]+offset
if kb.isDown('lshift','rshift')then note=note+1 end
if kb.isDown('lctrl','rctrl')then note=note-1 end
if kb.isDown('lshift','rshift') then note=note+1 end
if kb.isDown('lctrl','rctrl') then note=note-1 end
SFX.playSample(inst,note)
TEXT.show(SFX.getNoteName(note),math.random(150,1130),math.random(140,500),60,'score',.8)
elseif key=='tab'then
elseif key=='tab' then
inst=TABLE.next(instList,inst)
elseif key=='lalt'then
elseif key=='lalt' then
offset=math.max(offset-1,-12)
elseif key=='ralt'then
elseif key=='ralt' then
offset=math.min(offset+1,12)
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -44,11 +44,11 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='escape'then
if tryBack()then
if key=='escape' then
if tryBack() then
SCN.back()
end
elseif key=='space'then
elseif key=='space' then
if state==0 then--main
if timer==0 then
state=1
@@ -58,7 +58,7 @@ function scene.keyDown(key,isRep)
if hit[c]==0 then
hit[c]=1
count=count+1
SFX.play(side<26 and'ren_'..rnd(5)or'ren_'..rnd(6,11))
SFX.play(side<26 and 'ren_'..rnd(5) or 'ren_'..rnd(6,11))
if count>=12 then
SFX.play('ren_mega',(count-11)/15)
end
@@ -154,7 +154,7 @@ function scene.draw()
if state==0 then
gc.setColor(0,0,0,1-timer/50)
setFont(30)
mStr(MOBILE and"Touch to Start"or"Press space to Start",640,630)
mStr(MOBILE and "Touch to Start" or "Press space to Start",640,630)
else
gc.setColor(0,0,0,timer/50)
gc.print("POLYFORGE",20,620)

View File

@@ -44,28 +44,28 @@ local function start()
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='space'then
if key=='space' then
if state==0 then
start()
end
elseif key=='r'then
elseif key=='r' then
state=0
bx,by=640,360
vx,vy=0,0
ry=0
p1.score,p2.score=0,0
SFX.play('hold')
elseif key=='w'or key=='s'then
elseif key=='w' or key=='s' then
p1.y0=false
elseif key=='up'or key=='down'then
elseif key=='up' or key=='down' then
p2.y0=false
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
function scene.touchDown(x,y)
scene.touchMove(x,y)
if state==0 then start()end
if state==0 then start() end
end
function scene.touchMove(x,y)(x<640 and p1 or p2).y0=y end
function scene.mouseMove(x,y)(x<640 and p1 or p2).y0=y end
@@ -86,10 +86,10 @@ function scene.update()
P.vy=P.vy*.5
end
else
if kb.isDown(P==p1 and'w'or'up')then
if kb.isDown(P==p1 and 'w' or 'up') then
P.vy=max(P.vy-1,-8)
end
if kb.isDown(P==p1 and's'or'down')then
if kb.isDown(P==p1 and 's' or 'down') then
P.vy=min(P.vy+1,8)
end
P.y=P.y+P.vy

View File

@@ -23,7 +23,7 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if state==0 then
if key=='space'then
if key=='space' then
reset()
state=1
ct=60
@@ -34,13 +34,13 @@ function scene.keyDown(key,isRep)
--BEAUTIFUL LOGIC BELOW:
--early = error, [UP-key]==[target is up] = correct sfx, else = wrong sfx
SFX.play(ct>6 and'finesseError'or key%2==1==up and'reach'or'fail')
SFX.play(ct>6 and 'finesseError' or key%2==1==up and 'reach' or 'fail')
--(early && P2-key || not early && [P1-key]==[target is up]) = P1 win, else P2 win
if ct>6 and key>2 or ct<=6 and key%4<2==up then
winner=1;s1=s1+1
winner=1; s1=s1+1
else
winner=2;s2=s2+1
winner=2; s2=s2+1
end
state=3
ct=60
@@ -49,10 +49,10 @@ function scene.keyDown(key,isRep)
end
function scene.touchDown(x,y)
scene.keyDown(
state==0 and"space"or
state==0 and "space" or
x<640 and
(y<360 and"q"or"a")or
(y<360 and"p"or"l")
(y<360 and "q" or "a") or
(y<360 and "p" or "l")
)
end
function scene.update()
@@ -106,7 +106,7 @@ function scene.draw()
if state==0 then
setFont(40)
mStr(MOBILE and"Touch to Start"or"Press space to Start",640,400)
mStr(MOBILE and "Touch to Start" or "Press space to Start",640,400)
mStr("Press key on the same side when block appear!",640,500)
if ct>0 then
setFont(100)

View File

@@ -79,9 +79,9 @@ function scene.touchDown(x,y)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='z'or key=='x'then
if key=='z' or key=='x' then
love.mousepressed(ms.getPosition())
elseif key=='space'then
elseif key=='space' then
if state>0 then
board={}
time=0
@@ -89,23 +89,23 @@ function scene.keyDown(key,isRep)
state=0
progress=0
end
elseif key=='q'then
elseif key=='q' then
if state==0 then
invis=not invis
end
elseif key=='w'then
elseif key=='w' then
if state==0 then
disappear=not disappear
end
elseif key=='e'then
elseif key=='e' then
if state==0 then
tapFX=not tapFX
end
elseif key=='3'or key=='4'or key=='5'or key=='6'then
elseif key=='3' or key=='4' or key=='5' or key=='6' then
if state==0 then
rank=tonumber(key)
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
@@ -123,7 +123,7 @@ function scene.draw()
gc.print(mistake,1026,150)
setFont(70)
mStr(state==1 and progress or state==0 and"Ready"or state==2 and"Win",1130,300)
mStr(state==1 and progress or state==0 and "Ready" or state==2 and "Win",1130,300)
gc.setColor(COLOR.dX)
gc.rectangle('fill',310,30,660,660)
@@ -151,7 +151,7 @@ function scene.draw()
for i=1,rank do
for j=1,rank do
local N=board[rank*(i-1)+j]
if not(state==1 and disappear and N<=progress)then
if not (state==1 and disappear and N<=progress) then
gc.setColor(.4,.5,.6)
gc.rectangle('fill',320+(j-1)*width,(i-1)*width+40,width,width)
gc.setColor(COLOR.Z)
@@ -170,11 +170,11 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'space',hideF=function()return state==0 end},
WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,axis={3,6,1},show=false,font=40,disp=function()return rank end,code=function(v)rank=v end,hideF=function()return state>0 end},
WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='disappear',x=240,y=420,lim=200,font=40,disp=function()return disappear end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function()return tapFX end,code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'space',hideF=function() return state==0 end},
WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,axis={3,6,1},show=false,font=40,disp=function() return rank end,code=function(v) rank=v end,hideF=function() return state>0 end},
WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function() return invis end,code=pressKey'q',hideF=function() return state==1 end},
WIDGET.newSwitch{name='disappear',x=240,y=420,lim=200,font=40,disp=function() return disappear end,code=pressKey'w',hideF=function() return state==1 end},
WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function() return tapFX end,code=pressKey'e',hideF=function() return state==1 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -17,16 +17,16 @@ local scene={}
function scene.keyDown(key,isRep)
if isRep then return end
if key=='space'or key=='return'then
if key=='space' or key=='return' then
if STAT.item.zTicket>0 then
if spinner:start()then
if spinner:start() then
STAT.item.zTicket=STAT.item.zTicket-1
saveStats()
end
else
MES.new('info',"Not enough zTicket")
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -45,7 +45,7 @@ function scene.touchUp()
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='escape'then
if key=='escape' then
SCN.back()
else
press()

View File

@@ -11,14 +11,14 @@ local speed,maxSpeed=0,260
function scene.sceneInit()
lastKey=nil
speed=0
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
keyTime={} for i=1,40 do keyTime[i]=-1e99 end
BG.set('fixColor',.26,.26,.26)
BGM.play('push')
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='escape'then
if key=='escape' then
SCN.back()
else
if lastKey~=key then
@@ -34,7 +34,7 @@ end
function scene.update(dt)
local t=TIME()
local v=0
for i=2,40 do v=v+i*(i-1)*.075/(t-keyTime[i])end
for i=2,40 do v=v+i*(i-1)*.075/(t-keyTime[i]) end
speed=MATH.expApproach(speed,v,dt)
if speed>maxSpeed then
maxSpeed=speed
@@ -71,7 +71,7 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newKey{name='tap',x=640,y=540,w=626,h=260,sound='touch',fText="TAP",color='Z',font=100,code=function(i)love.keypressed('b'..i)end},
WIDGET.newKey{name='tap',x=640,y=540,w=626,h=260,sound='touch',fText="TAP",color='Z',font=100,code=function(i) love.keypressed('b'..i) end},
WIDGET.newButton{name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -109,10 +109,10 @@ local function merge()
end
if chosen>=5 then
SFX.play(
chosen>=9 and'ren_mega'or
chosen>=8 and'spin_3'or
chosen>=7 and'spin_2'or
chosen>=6 and'spin_1'or
chosen>=9 and 'ren_mega' or
chosen>=8 and 'spin_3' or
chosen>=7 and 'spin_2' or
chosen>=6 and 'spin_1' or
'spin_0'
)
end
@@ -125,39 +125,39 @@ local function merge()
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='up'or key=='down'or key=='left'or key=='right'then
if key=='up' or key=='down' or key=='left' or key=='right' then
if state==2 then return end
if not cx then
cx,cy=3,3
else
if key=='up'then
if key=='up' then
if cy>1 then cy=cy-1 end
elseif key=='down'then
elseif key=='down' then
if cy<5 then cy=cy+1 end
elseif key=='left'then
elseif key=='left' then
if cx>1 then cx=cx-1 end
elseif key=='right'then
elseif key=='right' then
if cx<5 then cx=cx+1 end
end
end
elseif key=='z'or key=='space'then
elseif key=='z' or key=='space' then
merge()
elseif key=='r'then
elseif key=='r' then
reset()
elseif key=='q'then
elseif key=='q' then
if state==0 then
nexts=not nexts
end
elseif key=='w'then
elseif key=='w' then
if state==0 then
invis=not invis
end
elseif key=='e'then
elseif key=='e' then
if state==0 then
fast=not fast
end
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
SCN.back()
end
end
@@ -198,17 +198,17 @@ function scene.update()
if board[1][i]==0 then
board[1][i]=rem(preview,1)
preview[5]=
maxTile<=4 and rnd(2)or
maxTile<=8 and rnd(1+rnd(2))or
maxTile<=11 and rnd(2+rnd(2))or
maxTile<=4 and rnd(2) or
maxTile<=8 and rnd(1+rnd(2)) or
maxTile<=11 and rnd(2+rnd(2)) or
rnd(2+rnd(3))
noNewTile=false
end
end
if noNewTile then
fallingTimer=false
for i=1,4 do for j=1,5 do if board[i][j]==board[i+1][j]then return end end end
for i=1,5 do for j=1,4 do if board[i][j]==board[i][j+1]then return end end end
for i=1,4 do for j=1,5 do if board[i][j]==board[i+1][j] then return end end end
for i=1,5 do for j=1,4 do if board[i][j]==board[i][j+1] then return end end end
state=2
SFX.play('fail')
else
@@ -216,11 +216,11 @@ function scene.update()
SFX.play('touch')
end
end
elseif fast and(
msIsDown(1)or
elseif fast and (
msIsDown(1) or
#tcTouches()>0 or
kbIsDown('space')
)then
) then
merge()
end
end
@@ -260,9 +260,9 @@ function scene.draw()
end
gc.setLineWidth(10)
setColor(COLOR[
state==1 and(fast and'R'or'W')or
state==0 and'G'or
state==2 and'Y'
state==1 and (fast and 'R' or 'W') or
state==0 and 'G' or
state==2 and 'Y'
])
rectangle('line',315,35,650,650)
@@ -305,9 +305,9 @@ end
scene.widgetList={
WIDGET.newButton{name='reset',x=160,y=100,w=180,h=100,color='lG',font=50,fText=CHAR.icon.retry_spin,code=pressKey'r'},
WIDGET.newSwitch{name='next', x=240,y=235,lim=200,font=40,disp=function()return nexts end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='invis',x=240,y=305,lim=200,font=40,disp=function()return invis end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='fast', x=240,y=375,lim=200,font=30,disp=function()return fast end,code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newSwitch{name='next', x=240,y=235,lim=200,font=40,disp=function() return nexts end,code=pressKey'q',hideF=function() return state==1 end},
WIDGET.newSwitch{name='invis',x=240,y=305,lim=200,font=40,disp=function() return invis end,code=pressKey'w',hideF=function() return state==1 end},
WIDGET.newSwitch{name='fast', x=240,y=375,lim=200,font=30,disp=function() return fast end,code=pressKey'e',hideF=function() return state==1 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -41,7 +41,7 @@ local textColor={
local tileTexts=setmetatable({
[-2]="B",
[-1]="×",
},{__index=function(self,k)self[k]=k return k end})
},{__index=function(self,k) self[k]=k return k end})
local player={x=340,y=90}
@@ -88,17 +88,17 @@ function player:reset()
end
end
self.board[1][1]=false
for _,n in next,{-1,-1,1,1,2,2,3,3}do
for _,n in next,{-1,-1,1,1,2,2,3,3} do
local x,y
repeat
x,y=rnd(6),rnd(6)
until not(x==1 and y==1)and self.board[y][x]==0
until not (x==1 and y==1) and self.board[y][x]==0
self.board[y][x]=n
end
end
function player:merge(b,v,y,x)
if b[y]and v==b[y][x]then
if b[y] and v==b[y][x] then
ins(self.mergedTiles,{y,x})
b[y][x]=0
return 1
@@ -130,13 +130,13 @@ function player:click(y,x)
ins(self.nexts,self:newTile())
end
elseif y~=self.selectY or x~=self.selectX then
if availablePos(self.board[y][x],self.nexts[1])then
if availablePos(self.board[y][x],self.nexts[1]) then
self.selectX,self.selectY=x,y
else
self.selectX,self.selectY=false,false
end
elseif y==self.selectY and x==self.selectX then
if not availablePos(self.board[y][x],self.nexts[1])then return end
if not availablePos(self.board[y][x],self.nexts[1]) then return end
if self.state==0 then
self.state=1
self.startTime=TIME()
@@ -188,16 +188,16 @@ function player:click(y,x)
SFX.play('lock')
if cur>=4 then
SFX.play(
cur>=8 and'ren_mega'or
cur>=7 and'spin_3'or
cur>=6 and'spin_2'or
cur>=5 and'spin_1'or
cur>=8 and 'ren_mega' or
cur>=7 and 'spin_3' or
cur>=6 and 'spin_2' or
cur>=5 and 'spin_1' or
'spin_0'
)
end
else
for i=1,6 do
if TABLE.find(self.board[i],0)then
if TABLE.find(self.board[i],0) then
return
end
end
@@ -247,8 +247,8 @@ function player:drawBoard()
--Board lines
setColor(COLOR.Z)
gc.setLineWidth(2)
for x=1,5 do gc.line(x*100,0,x*100,600)end
for y=1,5 do gc.line(0,y*100,600,y*100)end
for x=1,5 do gc.line(x*100,0,x*100,600) end
for y=1,5 do gc.line(0,y*100,600,y*100) end
gc.setLineWidth(6)
rectangle("line",0,0,600,600)
@@ -280,17 +280,17 @@ function scene.touchClick(x,y)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='up'or key=='down'or key=='left'or key=='right'then
if key=='up' or key=='down' or key=='left' or key=='right' then
if not player.selectX then
player.selectX,player.selectY=3,3
else
if key=='up'then player.selectY=math.max(player.selectY-1,1)
elseif key=='down'then player.selectY=math.min(player.selectY+1,6)
elseif key=='left'then player.selectX=math.max(player.selectX-1,1)
elseif key=='right'then player.selectX=math.min(player.selectX+1,6)
if key=='up' then player.selectY=math.max(player.selectY-1,1)
elseif key=='down' then player.selectY=math.min(player.selectY+1,6)
elseif key=='left' then player.selectX=math.max(player.selectX-1,1)
elseif key=='right' then player.selectX=math.min(player.selectX+1,6)
end
end
elseif key=='x'or key=='space'then
elseif key=='x' or key=='space' then
if not player.selectX then
player.selectX,player.selectY=3,3
else
@@ -298,16 +298,16 @@ function scene.keyDown(key,isRep)
player:click(player.selectY,player.selectX)
player.selectY,player.selectX=y,x
end
elseif key=='w'then
elseif key=='w' then
love.mousepressed(love.mouse.getPosition())
elseif key=='z'or key=='q'then
elseif key=='z' or key=='q' then
player:click(1,1)
elseif key=='r'then
if player.state~=1 or tryReset()then
elseif key=='r' then
if player.state~=1 or tryReset() then
player:reset()
end
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
SCN.back()
end
end

View File

@@ -35,13 +35,13 @@ function scene.sceneBack()
end
local function _play(mode)
if CUSTOMENV.opponent~="X"then
if CUSTOMENV.opponent:sub(1,2)=='CC'then
if CUSTOMENV.sequence=='fixed'then
if CUSTOMENV.opponent~="X" then
if CUSTOMENV.opponent:sub(1,2)=='CC' then
if CUSTOMENV.sequence=='fixed' then
MES.new('error',text.cc_fixed)
return
end
if CUSTOMENV.holdMode=='swap'then
if CUSTOMENV.holdMode=='swap' then
MES.new('error',text.cc_swap)
return
end
@@ -65,25 +65,25 @@ end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='return'and kb.isDown('lctrl','lalt')or key=='play1'or key=='play2'then
if(key=='play2'or kb.isDown('lalt'))and #FIELD[1]>0 then
if key=='return' and kb.isDown('lctrl','lalt') or key=='play1' or key=='play2' then
if (key=='play2' or kb.isDown('lalt')) and #FIELD[1]>0 then
_play('puzzle')
elseif key=='play1'or kb.isDown('lctrl')then
elseif key=='play1' or kb.isDown('lctrl') then
_play('clear')
end
elseif key=='f'then
elseif key=='f' then
SCN.go('custom_field','swipeD')
elseif key=='s'then
elseif key=='s' then
SCN.go('custom_sequence','swipeD')
elseif key=='m'then
elseif key=='m' then
SCN.go('custom_mission','swipeD')
elseif key=='delete'then
if tryReset()then
elseif key=='delete' then
if tryReset() then
TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION)
FIELD[1]=DATA.newBoard()
TABLE.clear(CUSTOMENV)
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
for _,W in next,scene.widgetList do W:reset()end
for _,W in next,scene.widgetList do W:reset() end
saveFile(DATA.copyMission(),'conf/customMissions')
saveFile(DATA.copyBoards(),'conf/customBoards')
saveFile(DATA.copySequence(),'conf/customSequence')
@@ -92,28 +92,28 @@ function scene.keyDown(key,isRep)
BG.set(CUSTOMENV.bg)
BGM.play(CUSTOMENV.bgm)
end
elseif key=='f1'then
elseif key=='f1' then
SCN.go('mod','swipeD')
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
local str="Techmino Quest:"..DATA.copyQuestArgs().."!"
if #BAG>0 then str=str..DATA.copySequence()end
if #BAG>0 then str=str..DATA.copySequence() end
str=str.."!"
if #MISSION>0 then str=str..DATA.copyMission()end
if #MISSION>0 then str=str..DATA.copyMission() end
sys.setClipboardText(str.."!"..DATA.copyBoards().."!")
MES.new('check',text.exportSuccess)
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local str=sys.getClipboardText()
local args=str:sub((str:find(":")or 0)+1):split("!")
local args=str:sub((str:find(":") or 0)+1):split("!")
if #args<4 then goto THROW_fail end
if not(
DATA.pasteQuestArgs(args[1])and
DATA.pasteSequence(args[2])and
if not (
DATA.pasteQuestArgs(args[1]) and
DATA.pasteSequence(args[2]) and
DATA.pasteMission(args[3])
)then goto THROW_fail end
) then goto THROW_fail end
TABLE.cut(FIELD)
FIELD[1]=DATA.newBoard()
for i=4,#args do
if args[i]:find("%S")and not DATA.pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end
if args[i]:find("%S") and not DATA.pasteBoard(args[i],i-3) and i<#args then goto THROW_fail end
end
MES.new('check',text.importSuccess)
do return end
@@ -183,8 +183,8 @@ scene.widgetList={
WIDGET.newKey{name='field', x=450,y=180,w=240,h=80,color='A',font=25,code=pressKey'f'},
WIDGET.newKey{name='sequence', x=730,y=180,w=240,h=80,color='W',font=25,code=pressKey's'},
WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function()return MISSION[1]end},
WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function()return BAG[1]end},
WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function() return MISSION[1] end},
WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function() return BAG[1] end},
--Selectors
WIDGET.newSelector{name='opponent', x=170,y=330,w=260,color='R',list=sList.opponent, disp=CUSval('opponent'), code=CUSsto('opponent')},
@@ -209,7 +209,7 @@ scene.widgetList={
WIDGET.newButton{name='copy', x=1070,y=300,w=310,h=70,color='lR',font=25,code=pressKey'cC'},
WIDGET.newButton{name='paste', x=1070,y=380,w=310,h=70,color='lB',font=25,code=pressKey'cV'},
WIDGET.newButton{name='play_clear', x=1070,y=460,w=310,h=70,color='lY',font=35,code=pressKey'play1'},
WIDGET.newButton{name='play_puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey'play2',hideF=function()return #FIELD[1]==0 end},
WIDGET.newButton{name='play_puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey'play2',hideF=function() return #FIELD[1]==0 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
--Rule set
@@ -225,15 +225,15 @@ scene.widgetList={
WIDGET.newSwitch{name='bone', x=1170,y=950, lim=250,disp=CUSval('bone'), code=CUSrev('bone')},
--Next & Hold
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=CUSval('holdMode'),code=CUSsto('holdMode'),hideF=function() return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=180,axis={0,6,1},disp=CUSval('nextCount'),code=CUSsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=180,axis={0,6,1},disp=CUSval('holdCount'),code=CUSsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=CUSval('infHold'),code=CUSrev('infHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function() return CUSTOMENV.holdCount==0 end},
--BG & BGM
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i)CUSTOMENV.bg=i BG.set(i)end},
WIDGET.newSelector{name='bgm', x=1120,y=1090,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i)CUSTOMENV.bgm=i BGM.play(i)end},
WIDGET.newSelector{name='bg', x=840, y=1090,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMENV.bg=i BG.set(i) end},
WIDGET.newSelector{name='bgm', x=1120,y=1090,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMENV.bgm=i BGM.play(i) end},
}
return scene

View File

@@ -61,16 +61,16 @@ local minoPosCode={
local function _pTouch(x,y)
if not curPen then return end
for i=1,#penPath do
if x==penPath[i][1]and y==penPath[i][2]then
if x==penPath[i][1] and y==penPath[i][2] then
return
end
end
if #penPath==0 then
penMode=
pens[curPen]>0 and(FIELD[page][y][x]~=pens[curPen]and 0 or 1)or
pens[curPen]>0 and (FIELD[page][y][x]~=pens[curPen] and 0 or 1) or
pens[curPen]==0 and 1 or
pens[curPen]==-1 and 0 or
pens[curPen]==-2 and(FIELD[page][y][x]<=0 and 0 or 1)
pens[curPen]==-2 and (FIELD[page][y][x]<=0 and 0 or 1)
end
ins(penPath,{x,y})
end
@@ -92,7 +92,7 @@ local function _pDraw()
for i=1,#y do
sum=sum+2^((11-(y[i]-minY))*(y[i]-minY)/2+(x[i]-minX))
end
if minoPosCode[sum]then
if minoPosCode[sum] then
C=SETTING.skin[minoPosCode[sum]]
end
else
@@ -114,7 +114,7 @@ local function _pDraw()
penPath={}
penMode=0
while #F>0 and isEmpty(F[#F])do rem(F)end
while #F>0 and isEmpty(F[#F]) do rem(F) end
end
function scene.sceneInit()
@@ -157,41 +157,41 @@ function scene.mouseUp(_,_,k)
end
end
function scene.touchDown(x,y)scene.mouseDown(x,y,1)end
function scene.touchUp(x,y)scene.mouseUp(x,y,1)end
function scene.touchDown(x,y) scene.mouseDown(x,y,1) end
function scene.touchUp(x,y) scene.mouseUp(x,y,1) end
scene.touchMove=scene.mouseMove
function scene.keyDown(key)
if key=='up'or key=='down'or key=='left'or key=='right'then
if key=='up' or key=='down' or key=='left' or key=='right' then
if not penX or not penY then penX,penY=1,1 end
if key=='up'then
if key=='up' then
if penY<20 then penY=penY+1 end
elseif key=='down'then
elseif key=='down' then
if penY>1 then penY=penY-1 end
elseif key=='left'then
elseif key=='left' then
if penX>1 then penX=penX-1 end
elseif key=='right'then
elseif key=='right' then
if penX<10 then penX=penX+1 end
end
if kb.isDown('space')then
if kb.isDown('space') then
scene.keyDown('space')
end
elseif key=='space'then
elseif key=='space' then
if penX and penY then
curPen=1
_pTouch(penX,penY)
end
elseif key=='delete'then
if tryReset()then
elseif key=='delete' then
if tryReset() then
FIELD[page]=DATA.newBoard()
SFX.play('finesseError',.7)
end
elseif key=='j'then
elseif key=='j' then
demo=not demo
elseif key=='k'then
elseif key=='k' then
ins(FIELD[page],1,{21,21,21,21,21,21,21,21,21,21})
SFX.play('blip')
elseif key=='l'then
elseif key=='l' then
local F=FIELD[page]
local cleared=false
for i=#F,1,-1 do
@@ -208,42 +208,42 @@ function scene.keyDown(key)
SFX.play('clear_3',.8)
SFX.play('fall',.8)
end
elseif key=='n'then
elseif key=='n' then
ins(FIELD,page+1,DATA.newBoard(FIELD[page]))
page=page+1
SFX.play('warn_1',.8)
SYSFX.newShade(3,200,60,300,600,.5,1,.5)
elseif key=='m'then
elseif key=='m' then
rem(FIELD,page)
page=max(page-1,1)
if not FIELD[1]then
if not FIELD[1] then
ins(FIELD,DATA.newBoard())
end
SYSFX.newShade(3,200,60,300,600,1,.5,.5)
SFX.play('clear_4',.8)
SFX.play('fall',.8)
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
sys.setClipboardText("Techmino Field:"..DATA.copyBoard(page))
MES.new('check',text.exportSuccess)
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local str=sys.getClipboardText()
local p=str:find(":")--ptr*
if p then
if not str:sub(1,p-1):find("Field")then
if not str:sub(1,p-1):find("Field") then
MES.new('error',text.pasteWrongPlace)
end
str=str:sub(p+1)
end
if DATA.pasteBoard(str,page)then
if DATA.pasteBoard(str,page) then
MES.new('check',text.importSuccess)
else
MES.new('error',text.dataCorrupted)
end
elseif key=='pageup'then
elseif key=='pageup' then
page=max(page-1,1)
elseif key=='pagedown'then
elseif key=='pagedown' then
page=min(page+1,#FIELD)
elseif key=='escape'then
elseif key=='escape' then
if curPen then
curPen=false
penPath={}
@@ -255,7 +255,7 @@ function scene.keyDown(key)
end
end
function scene.keyUp(key)
if key=='space'then
if key=='space' then
_pDraw()
curPen=false
end
@@ -267,8 +267,8 @@ function scene.draw()
--Draw grid
gc.setColor(1,1,1,.2)
gc.setLineWidth(1)
for x=1,9 do gc.line(30*x,0,30*x,600)end
for y=0,19 do gc.line(0,30*y,300,30*y)end
for x=1,9 do gc.line(30*x,0,30*x,600) end
for y=0,19 do gc.line(0,30*y,300,30*y) end
--Draw field
gc.setColor(COLOR.Z)
@@ -435,7 +435,7 @@ function scene.draw()
end
end
local function _setPen(i)return function(k)pens[k]=i end end
local function _setPen(i) return function(k) pens[k]=i end end
scene.widgetList={
WIDGET.newText{name='title', x=1020,y=5,lim=480,font=70,align='R'},
WIDGET.newText{name='subTitle', x=1030,y=50,lim=170,font=35,align='L',color='H'},
@@ -476,12 +476,12 @@ scene.widgetList={
WIDGET.newButton{name='copy', x=730, y=530,w=120,color='lR',font=60,fText=CHAR.icon.export,code=pressKey'cC'},
WIDGET.newButton{name='paste', x=860, y=530,w=120,color='lB',font=60,fText=CHAR.icon.import,code=pressKey'cV'},
WIDGET.newButton{name='clear', x=990, y=530,w=120,color='Z', font=70,fText=CHAR.icon.trash,code=pressKey'delete'},
WIDGET.newSwitch{name='demo', x=755, y=640,lim=220,disp=function()return demo end,code=function()demo=not demo end},
WIDGET.newSwitch{name='demo', x=755, y=640,lim=220,disp=function() return demo end,code=function() demo=not demo end},
WIDGET.newButton{name='newPg', x=100, y=110,w=160,h=110,color='N', font=20,code=pressKey'n'},
WIDGET.newButton{name='delPg', x=100, y=230,w=160,h=110,color='lR',font=20,code=pressKey'm'},
WIDGET.newButton{name='prevPg', x=100, y=350,w=160,h=110,color='lG',font=20,code=pressKey'pageup',hideF=function()return page==1 end},
WIDGET.newButton{name='nextPg', x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey'pagedown',hideF=function()return page==#FIELD end},
WIDGET.newButton{name='prevPg', x=100, y=350,w=160,h=110,color='lG',font=20,code=pressKey'pageup',hideF=function() return page==1 end},
WIDGET.newButton{name='nextPg', x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey'pagedown',hideF=function() return page==#FIELD end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -20,7 +20,7 @@ end
local ENUM_MISSION=ENUM_MISSION
local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true}
function scene.keyDown(key)
if key=='left'then
if key=='left' then
local p=cur
if p==0 then
cur=#MISSION
@@ -30,7 +30,7 @@ function scene.keyDown(key)
until MISSION[p]~=MISSION[cur]
cur=p
end
elseif key=='right'then
elseif key=='right' then
local p=cur
if p==#MISSION then
cur=0
@@ -40,7 +40,7 @@ function scene.keyDown(key)
until MISSION[p+1]~=MISSION[cur+1]
cur=p
end
elseif key=='ten'then
elseif key=='ten' then
for _=1,10 do
local p=cur
if p==#MISSION then break end
@@ -49,63 +49,63 @@ function scene.keyDown(key)
until MISSION[p+1]~=MISSION[cur+1]
cur=p
end
elseif key=='backspace'then
elseif key=='backspace' then
if #input>0 then
input=""
elseif cur>0 then
rem(MISSION,cur)
cur=cur-1
if cur>0 and MISSION[cur]==MISSION[cur+1]then
if cur>0 and MISSION[cur]==MISSION[cur+1] then
scene.keyDown('right')
end
end
elseif key=='delete'then
if tryReset()then
elseif key=='delete' then
if tryReset() then
TABLE.cut(MISSION)
cur=0
SFX.play('finesseError',.7)
end
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
if #MISSION>0 then
sys.setClipboardText("Techmino Target:"..DATA.copyMission())
MES.new('check',text.exportSuccess)
end
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local str=sys.getClipboardText()
local p=str:find(":")--ptr*
if p then
if not str:sub(1,p-1):find("Target")then
if not str:sub(1,p-1):find("Target") then
MES.new('error',text.pasteWrongPlace)
end
str=str:sub(p+1)
end
if DATA.pasteMission(str)then
if DATA.pasteMission(str) then
MES.new('check',text.importSuccess)
cur=#MISSION
else
MES.new('error',text.dataCorrupted)
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
elseif type(key)=='number'then
elseif type(key)=='number' then
local p=cur+1
while MISSION[p]==key do p=p+1 end
ins(MISSION,p,key)
cur=p
else
if key=='space'then
if key=='space' then
key="_"
else
key=string.upper(key)
end
input=input..key
if ENUM_MISSION[input]then
if ENUM_MISSION[input] then
cur=cur+1
ins(MISSION,cur,ENUM_MISSION[input])
SFX.play('lock')
input=""
elseif #input>1 or not legalInput[input]then
elseif #input>1 or not legalInput[input] then
input=""
end
end
@@ -131,7 +131,7 @@ function scene.draw()
local i,j=1,#L
local count=1
repeat
if L[i]==L[i-1]then
if L[i]==L[i-1] then
count=count+1
else
if count>1 then
@@ -220,7 +220,7 @@ scene.widgetList={
WIDGET.newKey{name='ten', x=1000,y=440,w=90, color='lG',font=55,code=pressKey'ten', fText=CHAR.key.macTab},
WIDGET.newKey{name='backsp', x=1000,y=540,w=90, color='lY',font=55,code=pressKey'backspace',fText=CHAR.key.backspace},
WIDGET.newKey{name='reset', x=1000,y=640,w=90, color='lY',font=50,code=pressKey'delete', fText=CHAR.icon.trash},
WIDGET.newButton{name='copy', x=1140,y=440,w=170,h=80,color='lR',font=50,code=pressKey'cC', fText=CHAR.icon.export,hideF=function()return #MISSION==0 end},
WIDGET.newButton{name='copy', x=1140,y=440,w=170,h=80,color='lR',font=50,code=pressKey'cC', fText=CHAR.icon.export,hideF=function() return #MISSION==0 end},
WIDGET.newButton{name='paste', x=1140,y=540,w=170,h=80,color='lB',font=50,code=pressKey'cV', fText=CHAR.icon.import},
WIDGET.newSwitch{name='mission',x=1150,y=340,lim=280,disp=CUSval('missionKill'),code=CUSrev('missionKill')},

View File

@@ -28,7 +28,7 @@ local minoKey2={
z=8,s=9,t=14,j=19,l=20,i=25,['-']=26,o=29,
}
function scene.keyDown(key)
if key=='left'then
if key=='left' then
local p=cur
if p==0 then
cur=#BAG
@@ -38,7 +38,7 @@ function scene.keyDown(key)
until BAG[p]~=BAG[cur]
cur=p
end
elseif key=='right'then
elseif key=='right' then
local p=cur
if p==#BAG then
cur=0
@@ -48,7 +48,7 @@ function scene.keyDown(key)
until BAG[p+1]~=BAG[cur+1]
cur=p
end
elseif key=='ten'then
elseif key=='ten' then
for _=1,10 do
local p=cur
if p==#BAG then break end
@@ -57,37 +57,37 @@ function scene.keyDown(key)
until BAG[p+1]~=BAG[cur+1]
cur=p
end
elseif key=='backspace'then
elseif key=='backspace' then
if cur>0 then
rem(BAG,cur)
cur=cur-1
end
elseif key=='delete'then
if tryReset()then
elseif key=='delete' then
if tryReset() then
TABLE.cut(BAG)
cur=0
SFX.play('finesseError',.7)
end
elseif key=='='then
elseif key=='=' then
local l={1,2,3,4,5,6,7}
repeat scene.keyDown(rem(l,math.random(#l)))until not l[1]
elseif key=='tab'then
WIDGET.active.sequence:scroll(kb.isDown('lshift','rshift')and -1 or 1)
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
repeat scene.keyDown(rem(l,math.random(#l))) until not l[1]
elseif key=='tab' then
WIDGET.active.sequence:scroll(kb.isDown('lshift','rshift') and -1 or 1)
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
if #BAG>0 then
sys.setClipboardText("Techmino SEQ:"..DATA.copySequence())
MES.new('check',text.exportSuccess)
end
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local str=sys.getClipboardText()
local p=str:find(":")--ptr*
if p then
if not str:sub(1,p-1):find("SEQ")then
if not str:sub(1,p-1):find("SEQ") then
MES.new('error',text.pasteWrongPlace)
end
str=str:sub(p+1)
end
if DATA.pasteSequence(str)then
if DATA.pasteSequence(str) then
MES.new('check',text.importSuccess)
cur=#BAG
else
@@ -95,13 +95,13 @@ function scene.keyDown(key)
cur=0
MES.new('error',text.dataCorrupted)
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
elseif type(key)=='number'then
elseif type(key)=='number' then
cur=cur+1
ins(BAG,cur,key)
elseif #key==1 then
key=(kb.isDown('lshift','lalt','rshift','ralt')and minoKey2 or minoKey)[key]
key=(kb.isDown('lshift','lalt','rshift','ralt') and minoKey2 or minoKey)[key]
if key then
local p=cur+1
while BAG[p]==key do p=p+1 end
@@ -112,7 +112,7 @@ function scene.keyDown(key)
end
end
local blockCharWidth={}for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth()end
local blockCharWidth={} for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth() end
function scene.draw()
--Draw frame
gc_setColor(COLOR.Z)
@@ -128,7 +128,7 @@ function scene.draw()
local i,j=1,#BAG
local count=1
repeat
if BAG[i]==BAG[i-1]and i-1~=cur then
if BAG[i]==BAG[i-1] and i-1~=cur then
count=count+1
else
if count>1 then
@@ -217,7 +217,7 @@ scene.widgetList={
WIDGET.newKey{name='O1', x=920,y=640,w=80,color='dH',font=100,fText=CHAR.mino.O1, code=pressKey(29)},
WIDGET.newButton{name='copy', x=1140,y=460,w=170,h=80,color='lR',font=50,fText=CHAR.icon.export,code=pressKey'cC',hideF=function()return #BAG==0 end},
WIDGET.newButton{name='copy', x=1140,y=460,w=170,h=80,color='lR',font=50,fText=CHAR.icon.export,code=pressKey'cC',hideF=function() return #BAG==0 end},
WIDGET.newButton{name='paste',x=1140,y=550,w=170,h=80,color='lB',font=50,fText=CHAR.icon.import,code=pressKey'cV'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -7,13 +7,13 @@ local timer
function scene.sceneInit()
timer=1
scene.widgetList.pause.x=
SETTING.menuPos=='right'and 1195 or
SETTING.menuPos=='middle'and 860 or
SETTING.menuPos=='left'and 190
SETTING.menuPos=='right' and 1195 or
SETTING.menuPos=='middle' and 860 or
SETTING.menuPos=='left' and 190
end
function scene.keyDown(key)
if key=='escape'then
if key=='escape' then
pauseGame()
end
end

View File

@@ -32,11 +32,11 @@ local typeColor={
local function _filter(word_org)
local word=word_org
word=word:gsub("[Tt]etris",CHAR.zChan.thinking)
if FNNS then word=word:gsub("[Pp]\97\116\114\101\111\110",CHAR.zChan.qualified)end
if FNNS then word=word:gsub("[Pp]\97\116\114\101\111\110",CHAR.zChan.qualified) end
return word,word_org
end
local function _scanDict(D)
if not D[1][1]then return end
if not D[1][1] then return end
local cut=TABLE.cut
for i=1,#D do
local O=D[i]
@@ -48,7 +48,7 @@ local function _scanDict(D)
cut(O)
end
end
local function _getList()return result[1]and result or dict end
local function _getList() return result[1] and result or dict end
local function _clearResult()
TABLE.cut(result)
selected=1
@@ -61,7 +61,7 @@ local function _search()
_clearResult()
local first
for i=1,#dict do
local pos=find(dict[i].title:lower(),input,nil,true)or find(dict[i].keywords,input,nil,true)
local pos=find(dict[i].title:lower(),input,nil,true) or find(dict[i].keywords,input,nil,true)
if pos==1 and not first then
ins(result,1,dict[i])
first=true
@@ -76,7 +76,7 @@ local function _search()
end
function scene.sceneInit()
dict=require("parts.language.dict_"..(SETTING.locale:find'zh'and'zh'or SETTING.locale:find'ja'and'ja'or'en'))
dict=require("parts.language.dict_"..(SETTING.locale:find'zh' and 'zh' or SETTING.locale:find'ja' and 'ja' or 'en'))
_scanDict(dict)
inputBox:clear()
@@ -95,7 +95,7 @@ function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='up'then
if key=='up' then
if selected and selected>1 then
selected=selected-1
if selected<scrollPos+1 then
@@ -103,42 +103,42 @@ function scene.keyDown(key)
end
scene.widgetList.copy.hide=false
end
elseif key=='down'then
if selected and selected<#_getList()then
elseif key=='down' then
if selected and selected<#_getList() then
selected=selected+1
if selected>scrollPos+15 then
scrollPos=selected-15
end
scene.widgetList.copy.hide=false
end
elseif key=='left'or key=='pageup'then
for _=1,12 do scene.keyDown('up')end
elseif key=='right'or key=='pagedown'then
for _=1,12 do scene.keyDown('down')end
elseif key=='application'then
elseif key=='left' or key=='pageup' then
for _=1,12 do scene.keyDown('up') end
elseif key=='right' or key=='pagedown' then
for _=1,12 do scene.keyDown('down') end
elseif key=='application' then
local url=_getList()[selected].url
if url then love.system.openURL(url)end
elseif key=='delete'then
if inputBox:hasText()then
if url then love.system.openURL(url) end
elseif key=='delete' then
if inputBox:hasText() then
_clearResult()
inputBox:clear()
SFX.play('hold')
end
elseif key=='escape'then
if inputBox:hasText()then
elseif key=='escape' then
if inputBox:hasText() then
scene.keyDown('delete')
else
SCN.back()
end
elseif key=='c'and love.keyboard.isDown('lctrl','rctrl')or key=='cC'then
elseif key=='c' and love.keyboard.isDown('lctrl','rctrl') or key=='cC' then
local t=_getList()[selected]
t=t.title_Org..":\n"..t.content_Org..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote
t=t.title_Org..":\n"..t.content_Org..(t.url and "\n[ "..t.url.." ]\n" or "\n")..text.dictNote
love.system.setClipboardText(t)
scene.widgetList.copy.hide=true
MES.new('info',text.copyDone)
return
else
if not WIDGET.isFocus(inputBox)then
if not WIDGET.isFocus(inputBox) then
WIDGET.focus(inputBox)
end
return true
@@ -190,7 +190,7 @@ function scene.draw()
gc.rectangle('fill',20,143+35*(selected-scrollPos),280,35)
setFont(30)
for i=1,min(#list,15)do
for i=1,min(#list,15) do
local y=142+35*i
i=i+scrollPos
local item=list[i]
@@ -215,7 +215,7 @@ scene.widgetList={
WIDGET.newText{name='book', x=20,y=15,font=70,align='L',fText=CHAR.icon.zBook},
WIDGET.newText{name='title', x=100,y=15,font=70,align='L'},
inputBox,
WIDGET.newKey{name='link', x=1120,y=655,w=80,font=55,fText=CHAR.icon.globe, code=pressKey'application',hideF=function()return not _getList()[selected].url end},
WIDGET.newKey{name='link', x=1120,y=655,w=80,font=55,fText=CHAR.icon.globe, code=pressKey'application',hideF=function() return not _getList()[selected].url end},
WIDGET.newKey{name='copy', x=1210,y=655,w=80,font=50,fText=CHAR.icon.copy, code=pressKey'cC'},
WIDGET.newKey{name='up', x=1120,y=475,w=80,font=50,fText=CHAR.key.up, code=pressKey'up',hide=not MOBILE},
WIDGET.newKey{name='down', x=1120,y=565,w=80,font=50,fText=CHAR.key.down, code=pressKey'down',hide=not MOBILE},

View File

@@ -5,9 +5,9 @@ local errorShot,errorInfo
local scene={}
function scene.sceneInit()
BGcolor=math.random()>.026 and{.3,.5,.9}or{.62,.3,.926}
BGcolor=math.random()>.026 and{.3,.5,.9} or{.62,.3,.926}
sysAndScn=SYSTEM.."-"..VERSION.string.." scene:"..Z.getErr('#').scene
errorText=LOADED and text.errorMsg or"An error has occurred while the game was loading.\nAn error log has been created so you can send it to the author."
errorText=LOADED and text.errorMsg or "An error has occurred while the game was loading.\nAn error log has been created so you can send it to the author."
errorShot,errorInfo=Z.getErr('#').shot,Z.getErr('#').mes
NET.closeWS()
if SETTING then

View File

@@ -20,20 +20,20 @@ local scene={}
local function _updateMenuButtons()
WIDGET.active.restart.hide=replaying
local pos=(GAME.tasUsed or replaying)and'right'or SETTING.menuPos
local pos=(GAME.tasUsed or replaying) and 'right' or SETTING.menuPos
modeTextWidK=math.min(280/TEXTOBJ.modeName:getWidth(),1)
if GAME.replaying then
WIDGET.active.pause.x=1195
modeTextPos=1185-TEXTOBJ.modeName:getWidth()*modeTextWidK
elseif pos=='right'then
elseif pos=='right' then
WIDGET.active.restart.x=1125
WIDGET.active.pause.x=1195
modeTextPos=1115-TEXTOBJ.modeName:getWidth()*modeTextWidK
elseif pos=='middle'then
elseif pos=='middle' then
WIDGET.active.restart.x=360
WIDGET.active.pause.x=860
modeTextPos=940
elseif pos=='left'then
elseif pos=='left' then
WIDGET.active.restart.x=120
WIDGET.active.pause.x=190
modeTextPos=1200-TEXTOBJ.modeName:getWidth()*modeTextWidK
@@ -108,10 +108,10 @@ local function _rep5()
gameRate=5
_updateRepButtons()
end
local function _step()trigGameRate=trigGameRate+1 end
local function _step() trigGameRate=trigGameRate+1 end
local function _restart()
resetGameData(PLAYERS[1].frameRun<240 and'q')
resetGameData(PLAYERS[1].frameRun<240 and 'q')
noKey=replaying
noTouch=replaying
trigGameRate,gameRate=0,1
@@ -143,7 +143,7 @@ function scene.sceneInit()
noKey=replaying
noTouch=not SETTING.VKSwitch or replaying
if SCN.prev~='depause'and SCN.prev~='pause'then
if SCN.prev~='depause' and SCN.prev~='pause' then
trigGameRate,gameRate=0,1
elseif not replaying then
if GAME.tasUsed then
@@ -189,7 +189,7 @@ function scene.touchMove()
local B=keys[n]
if B.ava then
for i=1,#L,2 do
if(L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
if (L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
goto CONTINUE_nextKey
end
end
@@ -201,39 +201,39 @@ function scene.touchMove()
end
function scene.keyDown(key,isRep)
if replaying then
if key=='space'then
if key=='space' then
if not isRep then
gameRate=gameRate==0 and 1 or 0
end
_updateRepButtons()
elseif key=='left'then
elseif key=='left' then
if not isRep then
_speedDown()
end
elseif key=='right'then
elseif key=='right' then
if gameRate==0 then
_step()
elseif not isRep then
_speedUp()
end
elseif key=='escape'then
elseif key=='escape' then
pauseGame()
end
else
if isRep then
return
elseif _checkGameKeyDown(key)then
elseif _checkGameKeyDown(key) then
if GAME.tasUsed then
if key=='f1'then
if key=='f1' then
if not isRep then
gameRate=gameRate==0 and .125 or 0
end
_updateRepButtons()
elseif key=='f2'then
elseif key=='f2' then
if not isRep then
_speedDown()
end
elseif key=='f3'then
elseif key=='f3' then
if gameRate==0 then
_step()
elseif not isRep then
@@ -241,7 +241,7 @@ function scene.keyDown(key,isRep)
end
end
end
if key=='escape'then
if key=='escape' then
pauseGame()
end
end
@@ -267,7 +267,7 @@ function scene.gamepadDown(key)
else
_restart()
end
elseif key=='back'then
elseif key=='back' then
pauseGame()
end
end
@@ -288,10 +288,10 @@ local function _update_common(dt)
VK.update(dt)
--Update players
for p=1,#PLAYERS do PLAYERS[p]:update(dt)end
for p=1,#PLAYERS do PLAYERS[p]:update(dt) end
--Fresh royale target
if PLAYERS[1].frameRun%120==0 and PLAYERS[1].gameEnv.layout=='royale'then
if PLAYERS[1].frameRun%120==0 and PLAYERS[1].gameEnv.layout=='royale' then
freshMostDangerous()
end
@@ -337,7 +337,7 @@ function scene.draw()
VK.draw()
--Attacking & Being attacked
if PLAYERS[1].gameEnv.layout=='royale'then
if PLAYERS[1].gameEnv.layout=='royale' then
local P=PLAYERS[1]
gc_setLineWidth(5)
gc_setColor(.8,1,0,.2)
@@ -362,7 +362,7 @@ function scene.draw()
gc_draw(TEXTOBJ.modeName,modeTextPos,10,0,modeTextWidK,1)
local M=GAME.curMode
if M then
if M.score and M.records[1]then
if M.score and M.records[1] then
setFont(15)
gc_setColor(1,1,1,.6)
gc_print(M.scoreDisp(M.records[1]),modeTextPos,45)

View File

@@ -9,15 +9,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='up'then
if key=='up' then
WIDGET.active.texts:scroll(-5)
elseif key=='down'then
elseif key=='down' then
WIDGET.active.texts:scroll(5)
elseif key=='pageup'then
elseif key=='pageup' then
WIDGET.active.texts:scroll(-20)
elseif key=='pagedown'then
elseif key=='pagedown' then
WIDGET.active.texts:scroll(20)
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -36,7 +36,7 @@ function scene.draw()
love.graphics.setColor(1,1,1,1-curLang%1*2)
GC.mStr(languages[curLang-curLang%1],640,20)
love.graphics.setColor(1,1,1,curLang%1*2)
GC.mStr(languages[curLang-curLang%1+1]or languages[1],640,20)
GC.mStr(languages[curLang-curLang%1+1] or languages[1],640,20)
end
local function _setLang(lid)
@@ -45,23 +45,23 @@ local function _setLang(lid)
TEXT.clear()
TEXT.show(langList[lid],640,360,100,'appear',.626)
collectgarbage()
if FIRSTLAUNCH then SCN.back()end
if FIRSTLAUNCH then SCN.back() end
end
scene.widgetList={
WIDGET.newButton{x=270,y=210,w=330,h=100,font=40, fText=langList.en, color='R',sound='click',code=function()_setLang('en')end},
WIDGET.newButton{x=270,y=330,w=330,h=100,font=40, fText=langList.fr, color='F',sound='click',code=function()_setLang('fr')end},
WIDGET.newButton{x=270,y=450,w=330,h=100,font=35, fText=langList.es, color='O',sound='click',code=function()_setLang('es')end},
WIDGET.newButton{x=270,y=570,w=330,h=100,font=35, fText=langList.id, color='Y',sound='click',code=function()_setLang('id')end},
WIDGET.newButton{x=270,y=210,w=330,h=100,font=40, fText=langList.en, color='R',sound='click',code=function()_setLang('en') end},
WIDGET.newButton{x=270,y=330,w=330,h=100,font=40, fText=langList.fr, color='F',sound='click',code=function()_setLang('fr') end},
WIDGET.newButton{x=270,y=450,w=330,h=100,font=35, fText=langList.es, color='O',sound='click',code=function()_setLang('es') end},
WIDGET.newButton{x=270,y=570,w=330,h=100,font=35, fText=langList.id, color='Y',sound='click',code=function()_setLang('id') end},
WIDGET.newButton{x=640,y=210,w=330,h=100,font=40, fText=langList.pt, color='A',sound='click',code=function()_setLang('pt')end},
WIDGET.newButton{x=640,y=330,w=330,h=100,font=40, fText=langList.symbol, color='G',sound='click',code=function()_setLang('symbol')end},
WIDGET.newButton{x=640,y=450,w=330,h=100,font=40, fText=langList.ja, color='J',sound='click',code=function()_setLang('ja')end},
WIDGET.newButton{x=640,y=210,w=330,h=100,font=40, fText=langList.pt, color='A',sound='click',code=function()_setLang('pt') end},
WIDGET.newButton{x=640,y=330,w=330,h=100,font=40, fText=langList.symbol, color='G',sound='click',code=function()_setLang('symbol') end},
WIDGET.newButton{x=640,y=450,w=330,h=100,font=40, fText=langList.ja, color='J',sound='click',code=function()_setLang('ja') end},
WIDGET.newKey {x=640,y=570,w=330,h=100,font=40, fText='', color='L'},
WIDGET.newButton{x=1000,y=210,w=330,h=100,font=40,fText=langList.zh, color='C',sound='click',code=function()_setLang('zh')end},
WIDGET.newButton{x=1000,y=330,w=330,h=100,font=40,fText=langList.zh_trad, color='S',sound='click',code=function()_setLang('zh_trad')end},
WIDGET.newButton{x=1000,y=450,w=330,h=100,font=40,fText=langList.zh_code, color='P',sound='click',code=function()_setLang('zh_code')end},
WIDGET.newButton{x=1000,y=210,w=330,h=100,font=40,fText=langList.zh, color='C',sound='click',code=function()_setLang('zh') end},
WIDGET.newButton{x=1000,y=330,w=330,h=100,font=40,fText=langList.zh_trad, color='S',sound='click',code=function()_setLang('zh_trad') end},
WIDGET.newButton{x=1000,y=450,w=330,h=100,font=40,fText=langList.zh_code, color='P',sound='click',code=function()_setLang('zh_code') end},
WIDGET.newButton{name='back',x=1000,y=570,w=330,h=100,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -14,14 +14,14 @@ local scene={}
local pad
pad={x=140,y=65,page=1,
func={
function()pad.page=1 end,
function()pad.page=2 end,
function()pad.page=3 end,
function()pad.page=4 end,
function()pad.page=5 end,
function()pad.page=6 end,
function()BGM.set('all','seek',0)BGM.play()end,
function()BGM.stop()end,
function() pad.page=1 end,
function() pad.page=2 end,
function() pad.page=3 end,
function() pad.page=4 end,
function() pad.page=5 end,
function() pad.page=6 end,
function() BGM.set('all','seek',0)BGM.play() end,
function() BGM.stop() end,
},
funcAlpha=TABLE.new(0,8),
alpha={
@@ -37,20 +37,20 @@ pad={x=140,y=65,page=1,
},
{
{
{samp={tag='ready3',func=function()playReadySFX(3)end}},
{samp={tag='ready2',func=function()playReadySFX(2)end}},
{samp={tag='ready1',func=function()playReadySFX(1)end}},
{samp={tag='start',func=function()playReadySFX(0)end}},
{samp={tag='ready3',func=function() playReadySFX(3) end}},
{samp={tag='ready2',func=function() playReadySFX(2) end}},
{samp={tag='ready1',func=function() playReadySFX(1) end}},
{samp={tag='start',func=function() playReadySFX(0) end}},
{sfx='touch'},{sfx='lock'},{sfx='drop'},{sfx='fall'},
},
{
{sfx='hold'},{sfx='prehold'},
{samp={tag='clear_1',func=function()playClearSFX(1)end}},
{samp={tag='clear_2',func=function()playClearSFX(2)end}},
{samp={tag='clear_3',func=function()playClearSFX(3)end}},
{samp={tag='clear_4',func=function()playClearSFX(4)end}},
{samp={tag='clear_7',func=function()playClearSFX(7)end}},
{samp={tag='clear_10',func=function()playClearSFX(10)end}},
{samp={tag='clear_1',func=function() playClearSFX(1) end}},
{samp={tag='clear_2',func=function() playClearSFX(2) end}},
{samp={tag='clear_3',func=function() playClearSFX(3) end}},
{samp={tag='clear_4',func=function() playClearSFX(4) end}},
{samp={tag='clear_7',func=function() playClearSFX(7) end}},
{samp={tag='clear_10',func=function() playClearSFX(10) end}},
},
{{sfx='prerotate'}, {sfx='rotate'}, {sfx='rotatekick'}, {}, {voc='single'}, {voc='double'}, {voc='triple'}, {voc='techrash'}},
{{sfx='finesseError'},{sfx='finesseError_long'},{sfx='drop_cancel'},{}, {sfx='spin_0'}, {sfx='spin_1'}, {sfx='spin_2'}, {sfx='spin_3'}},
@@ -71,20 +71,20 @@ pad={x=140,y=65,page=1,
},
{
{
{samp={tag='ready3',func=function()playReadySFX(3)end}},
{samp={tag='ready2',func=function()playReadySFX(2)end}},
{samp={tag='ready1',func=function()playReadySFX(1)end}},
{samp={tag='start',func=function()playReadySFX(0)end}},
{samp={tag='ready3',func=function() playReadySFX(3) end}},
{samp={tag='ready2',func=function() playReadySFX(2) end}},
{samp={tag='ready1',func=function() playReadySFX(1) end}},
{samp={tag='start',func=function() playReadySFX(0) end}},
{sfx='touch'},{sfx='lock'},{sfx='drop'},{sfx='fall'},
},
{
{sfx='hold'},{sfx='prehold'},
{samp={tag='clear_1',func=function()playClearSFX(1)end}},
{samp={tag='clear_2',func=function()playClearSFX(2)end}},
{samp={tag='clear_3',func=function()playClearSFX(3)end}},
{samp={tag='clear_4',func=function()playClearSFX(4)end}},
{samp={tag='clear_7',func=function()playClearSFX(7)end}},
{samp={tag='clear_10',func=function()playClearSFX(10)end}},
{samp={tag='clear_1',func=function() playClearSFX(1) end}},
{samp={tag='clear_2',func=function() playClearSFX(2) end}},
{samp={tag='clear_3',func=function() playClearSFX(3) end}},
{samp={tag='clear_4',func=function() playClearSFX(4) end}},
{samp={tag='clear_7',func=function() playClearSFX(7) end}},
{samp={tag='clear_10',func=function() playClearSFX(10) end}},
},
{{voc='mini'}, {voc='b2b'}, {voc='b3b'}, {voc='perfect_clear'}, {voc='half_clear'}, {sfx='finesseError'}, {sfx='finesseError_long'}, {sfx='drop_cancel'},},
{{voc='zspin'}, {voc='sspin'}, {voc='jspin'}, {voc='lspin'}, {voc='tspin'}, {voc='ospin'}, {voc='ispin'}, {}},
@@ -95,31 +95,31 @@ pad={x=140,y=65,page=1,
},
{
{
{samp={tag='clear_1',func=function()playClearSFX(1)end}},
{samp={tag='clear_2',func=function()playClearSFX(2)end}},
{samp={tag='clear_3',func=function()playClearSFX(3)end}},
{samp={tag='clear_4',func=function()playClearSFX(4)end}},
{samp={tag='clear_5',func=function()playClearSFX(5)end}},
{samp={tag='clear_6',func=function()playClearSFX(6)end}},
{samp={tag='clear_7',func=function()playClearSFX(7)end}},
{samp={tag='clear_8',func=function()playClearSFX(8)end}},
{samp={tag='clear_1',func=function() playClearSFX(1) end}},
{samp={tag='clear_2',func=function() playClearSFX(2) end}},
{samp={tag='clear_3',func=function() playClearSFX(3) end}},
{samp={tag='clear_4',func=function() playClearSFX(4) end}},
{samp={tag='clear_5',func=function() playClearSFX(5) end}},
{samp={tag='clear_6',func=function() playClearSFX(6) end}},
{samp={tag='clear_7',func=function() playClearSFX(7) end}},
{samp={tag='clear_8',func=function() playClearSFX(8) end}},
},
{
{samp={tag='clear_9',func=function()playClearSFX(9)end}},
{samp={tag='clear_10',func=function()playClearSFX(10)end}},
{samp={tag='clear_11',func=function()playClearSFX(11)end}},
{samp={tag='clear_12',func=function()playClearSFX(12)end}},
{samp={tag='clear_13',func=function()playClearSFX(13)end}},
{samp={tag='clear_14',func=function()playClearSFX(14)end}},
{samp={tag='clear_15',func=function()playClearSFX(15)end}},
{samp={tag='clear_16',func=function()playClearSFX(16)end}},
{samp={tag='clear_9',func=function() playClearSFX(9) end}},
{samp={tag='clear_10',func=function() playClearSFX(10) end}},
{samp={tag='clear_11',func=function() playClearSFX(11) end}},
{samp={tag='clear_12',func=function() playClearSFX(12) end}},
{samp={tag='clear_13',func=function() playClearSFX(13) end}},
{samp={tag='clear_14',func=function() playClearSFX(14) end}},
{samp={tag='clear_15',func=function() playClearSFX(15) end}},
{samp={tag='clear_16',func=function() playClearSFX(16) end}},
},
{
{samp={tag='clear_17',func=function()playClearSFX(17)end}},
{samp={tag='clear_18',func=function()playClearSFX(18)end}},
{samp={tag='clear_19',func=function()playClearSFX(19)end}},
{samp={tag='clear_20',func=function()playClearSFX(20)end}},
{samp={tag='clear_20+',func=function()playClearSFX(21)end}},
{samp={tag='clear_17',func=function() playClearSFX(17) end}},
{samp={tag='clear_18',func=function() playClearSFX(18) end}},
{samp={tag='clear_19',func=function() playClearSFX(19) end}},
{samp={tag='clear_20',func=function() playClearSFX(20) end}},
{samp={tag='clear_20+',func=function() playClearSFX(21) end}},
{},{},{}
},
{{},{},{},{},{},{},{},{}},
@@ -145,7 +145,7 @@ pad={x=140,y=65,page=1,
B[y]={}
for x=1,8 do
local i=8*(y-1)+x
B[y][x]=L[i]and{bgm=L[i]}or{}
B[y][x]=L[i] and{bgm=L[i]} or{}
end
end
return B
@@ -160,10 +160,10 @@ local function press(x,y)
pad.funcAlpha[y]=1
else
local k=pad[pad.page][y][x]
if k.samp then k.samp.func()end
if k.sfx then SFX.play(k.sfx,k.vol)end
if k.voc then VOC.play(k.voc)end
if k.bgm then BGM.play(k.bgm)end
if k.samp then k.samp.func() end
if k.sfx then SFX.play(k.sfx,k.vol) end
if k.voc then VOC.play(k.voc) end
if k.bgm then BGM.play(k.bgm) end
pad.alpha[y][x]=1
end
end
@@ -178,29 +178,29 @@ scene.mouseDown=scene.touchDown
function scene.keyDown(key,isRep)
if isRep then return end
if key=='z'or key=='x'then
if key=='z' or key=='x' then
love.mousepressed(love.mouse.getPosition())
elseif #key==1 then
if("12345678"):find(key,nil,true)then
if ("12345678"):find(key,nil,true) then
press(0,tonumber(key))
else
key=("hjkluiop"):find(key,nil,true)
if key then
if isDown('q')then press(key,1)end
if isDown('w')then press(key,2)end
if isDown('e')then press(key,3)end
if isDown('r')then press(key,4)end
if isDown('a')then press(key,5)end
if isDown('s')then press(key,6)end
if isDown('d')then press(key,7)end
if isDown('f')then press(key,8)end
if isDown('q') then press(key,1) end
if isDown('w') then press(key,2) end
if isDown('e') then press(key,3) end
if isDown('r') then press(key,4) end
if isDown('a') then press(key,5) end
if isDown('s') then press(key,6) end
if isDown('d') then press(key,7) end
if isDown('f') then press(key,8) end
end
end
elseif key=='tab'then
elseif key=='tab' then
SCN.swapTo('music','none')
elseif key=='space'then
elseif key=='space' then
showLabel=not showLabel
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
@@ -217,7 +217,7 @@ function scene.update(dt)
end
end end
for i=1,8 do
if isDown(("qwerasdf"):sub(i,i))then
if isDown(("qwerasdf"):sub(i,i)) then
local L=pad.alpha[i]
for j=1,8 do
pad.alpha[i][j]=min(L[j]+dt*10,max(L[j],.4))
@@ -260,15 +260,15 @@ function scene.draw()
gc_rectangle('line',x*80+2,(y-1)*80+2,76,76,5)
local k=pad[pad.page][y][x]
if showLabel then
if k.sfx then mStr(k.sfx,x*80+40,y*80-30)gc_circle('line',x*80+40,(y-1)*80+40,5)end
if k.voc then mStr(k.voc,x*80+40,y*80-17)gc_rectangle('line',x*80+30,(y-1)*80+30,20,20,1)end
if k.samp then mStr(k.samp.tag,x*80+40,y*80-30)gc_rectangle('fill',x*80+10,(y-1)*80+35,60,5,1)end
if k.bgm then mStr(k.bgm,x*80+40,y*80-78)gc_rectangle('fill',x*80+20,(y-1)*80+15,40,5,2)end
if k.sfx then mStr(k.sfx,x*80+40,y*80-30)gc_circle('line',x*80+40,(y-1)*80+40,5) end
if k.voc then mStr(k.voc,x*80+40,y*80-17)gc_rectangle('line',x*80+30,(y-1)*80+30,20,20,1) end
if k.samp then mStr(k.samp.tag,x*80+40,y*80-30)gc_rectangle('fill',x*80+10,(y-1)*80+35,60,5,1) end
if k.bgm then mStr(k.bgm,x*80+40,y*80-78)gc_rectangle('fill',x*80+20,(y-1)*80+15,40,5,2) end
else
if k.sfx then gc_circle('line',x*80+40,(y-1)*80+40,5)end
if k.voc then gc_rectangle('line',x*80+30,(y-1)*80+30,20,20,1)end
if k.samp then gc_rectangle('fill',x*80+10,(y-1)*80+35,60,5,1)end
if k.bgm then gc_rectangle('fill',x*80+20,(y-1)*80+15,40,5,2)end
if k.sfx then gc_circle('line',x*80+40,(y-1)*80+40,5) end
if k.voc then gc_rectangle('line',x*80+30,(y-1)*80+30,20,20,1) end
if k.samp then gc_rectangle('fill',x*80+10,(y-1)*80+35,60,5,1) end
if k.bgm then gc_rectangle('fill',x*80+20,(y-1)*80+15,40,5,2) end
end
if pad.alpha[y][x]>0 then
gc_setColor(1,1,1,pad.alpha[y][x]*.7)
@@ -281,10 +281,10 @@ end
scene.widgetList={
WIDGET.newText{name='title', x=640, y=-5,font=50},
WIDGET.newSlider{name='bgm', x=1000,y=80, lim=130,w=250,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newSlider{name='sfx', x=1000,y=150,lim=130,w=250,disp=SETval('sfx'),code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end},
WIDGET.newSlider{name='voc', x=1000,y=220,lim=130,w=250,disp=SETval('voc'),code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end},
WIDGET.newSwitch{name='label',x=1200,y=290,lim=160,disp=function()return showLabel end,code=pressKey'space',},
WIDGET.newSlider{name='bgm', x=1000,y=80, lim=130,w=250,disp=SETval('bgm'),code=function(v) SETTING.bgm=v BGM.setVol(SETTING.bgm) end},
WIDGET.newSlider{name='sfx', x=1000,y=150,lim=130,w=250,disp=SETval('sfx'),code=function(v) SETTING.sfx=v SFX.setVol(SETTING.sfx) end},
WIDGET.newSlider{name='voc', x=1000,y=220,lim=130,w=250,disp=SETval('voc'),code=function(v) SETTING.voc=v VOC.setVol(SETTING.voc) end},
WIDGET.newSwitch{name='label',x=1200,y=290,lim=160,disp=function() return showLabel end,code=pressKey'space',},
WIDGET.newButton{name='music',x=1140,y=540,w=170,h=80,font=40,code=pressKey'tab'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -13,15 +13,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='up'then
if key=='up' then
WIDGET.active.texts:scroll(-5)
elseif key=='down'then
elseif key=='down' then
WIDGET.active.texts:scroll(5)
elseif key=='pageup'then
elseif key=='pageup' then
WIDGET.active.texts:scroll(-20)
elseif key=='pagedown'then
elseif key=='pagedown' then
WIDGET.active.texts:scroll(20)
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -9,11 +9,11 @@ local studioLogo--Studio logo text object
local logoColor1,logoColor2
local titleTransform={
function(t)GC.translate(0,max(50-t,0)^2/25)end,
function(t)GC.translate(0,-max(50-t,0)^2/25)end,
function(t,i)local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d)end,
function(t,i)local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d)end,
function(t)GC.setColor(1,1,1,min(t*.02,1)+math.random()*.2)end,
function(t) GC.translate(0,max(50-t,0)^2/25) end,
function(t) GC.translate(0,-max(50-t,0)^2/25) end,
function(t,i) local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d) end,
function(t,i) local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d) end,
function(t) GC.setColor(1,1,1,min(t*.02,1)+math.random()*.2) end,
}
local loadingThread=coroutine.wrap(function()
@@ -32,7 +32,7 @@ local loadingThread=coroutine.wrap(function()
coroutine.yield('loadSample')SFX.loadSample{name='lead',path='media/sample/lead',base='A3'}--A3~A5
coroutine.yield('loadSample')SFX.loadSample{name='bell',path='media/sample/bell',base='A4'}--A4~A6
coroutine.yield('loadVoice')VOC.load('media/vocal/'..SETTING.vocPack..'/')
coroutine.yield('loadFont')for i=1,17 do getFont(15+5*i)getFont(15+5*i,'mono')end
coroutine.yield('loadFont') for i=1,17 do getFont(15+5*i)getFont(15+5*i,'mono') end
coroutine.yield('loadModeIcon')
local modeIcons={}
@@ -93,8 +93,8 @@ local loadingThread=coroutine.wrap(function()
coroutine.yield('loadMode')
for _,M in next,MODES do
M.records=loadFile("record/"..M.name..".rec",'-luaon -canSkip')or M.score and{}
M.icon=M.icon and(modeIcons[M.icon]or GC.newImage("media/image/modeicon/"..M.icon..".png"))
M.records=loadFile("record/"..M.name..".rec",'-luaon -canSkip') or M.score and{}
M.icon=M.icon and (modeIcons[M.icon] or GC.newImage("media/image/modeicon/"..M.icon..".png"))
end
coroutine.yield('loadOther')
@@ -115,7 +115,7 @@ function scene.sceneInit()
progress=0
maxProgress=10
t1,t2=0,0--Timer
animeType={}for i=1,#SVG_TITLE_FILL do animeType[i]=math.random(#titleTransform)end--Random animation type
animeType={} for i=1,#SVG_TITLE_FILL do animeType[i]=math.random(#titleTransform) end--Random animation type
end
function scene.sceneBack()
love.event.quit()
@@ -127,13 +127,13 @@ function scene.mouseDown()
SCN.push('main')
SCN.swapTo('lang')
else
SCN.swapTo(SETTING.simpMode and'main_simple'or'main')
SCN.swapTo(SETTING.simpMode and 'main_simple' or 'main')
end
end
end
scene.touchDown=scene.mouseDown
function scene.keyDown(key)
if key=='escape'then
if key=='escape' then
love.event.quit()
else
scene.mouseDown()
@@ -177,19 +177,19 @@ function scene.draw()
end
GC.setColor(1,1,1,min(t*.025,1))
GC.polygon('line',SVG_TITLE_LINE[i])
if i==8 then GC.polygon('line',SVG_TITLE_LINE[9])end
if i==8 then GC.polygon('line',SVG_TITLE_LINE[9]) end
GC.pop()
end
end
GC.pop()
GC.setColor(logoColor1[1],logoColor1[2],logoColor1[3],progress/maxProgress)mDraw(studioLogo,640,400)
GC.setColor(logoColor2[1],logoColor2[2],logoColor2[3],progress/maxProgress)for dx=-2,2,2 do for dy=-2,2,2 do mDraw(studioLogo,640+dx,400+dy)end end
GC.setColor(logoColor2[1],logoColor2[2],logoColor2[3],progress/maxProgress) for dx=-2,2,2 do for dy=-2,2,2 do mDraw(studioLogo,640+dx,400+dy) end end
GC.setColor(.2,.2,.2,progress/maxProgress)mDraw(studioLogo,640,400)
GC.setColor(COLOR.Z)
setFont(30)
GC.mStr(text.loadText[loading]or"",640,530)
GC.mStr(text.loadText[loading] or "",640,530)
end
return scene

View File

@@ -5,7 +5,7 @@ local showEmail=true
local function _login()
local email,password=emailBox:getText(),passwordBox:getText()
if not STRING.simpEmailCheck(email)then
if not STRING.simpEmailCheck(email) then
MES.new('error',text.wrongEmail)return
elseif #password==0 then
MES.new('error',text.noPassword)return
@@ -29,10 +29,10 @@ end
scene.widgetList={
WIDGET.newText{name='title', x=80, y=50,font=70,align='L'},
WIDGET.newButton{name='register', x=1140,y=100,w=170,h=80,color='lY',code=function()SCN.swapTo('register','swipeR')end},
WIDGET.newButton{name='register', x=1140,y=100,w=170,h=80,color='lY',code=function() SCN.swapTo('register','swipeR') end},
emailBox,
passwordBox,
WIDGET.newSwitch{name='showEmail',x=550, y=420,disp=function()return showEmail end,code=function()showEmail=not showEmail emailBox.secret=not showEmail end},
WIDGET.newSwitch{name='showEmail',x=550, y=420,disp=function() return showEmail end,code=function() showEmail=not showEmail emailBox.secret=not showEmail end},
WIDGET.newKey{name='login', x=1140,y=540,w=170,h=80,font=40,code=pressKey'return'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -36,7 +36,7 @@ function scene.sceneInit()
end
function scene.resize()
local qpModeName=text.modes[STAT.lastPlay]and text.modes[STAT.lastPlay][1]or"["..STAT.lastPlay.."]"
local qpModeName=text.modes[STAT.lastPlay] and text.modes[STAT.lastPlay][1] or "["..STAT.lastPlay.."]"
scene.widgetList[2]:setObject(text.WidgetText.main.qplay..qpModeName)
end
@@ -47,7 +47,7 @@ function scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseDown
local function _testButton(n)
if WIDGET.isFocus(scene.widgetList[n])then
if WIDGET.isFocus(scene.widgetList[n]) then
return true
else
WIDGET.focus(scene.widgetList[n])
@@ -55,58 +55,58 @@ local function _testButton(n)
end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='1'then
if _testButton(1)then
if key=='1' then
if _testButton(1) then
SCN.go('mode')
end
elseif key=='q'then
if _testButton(2)then
elseif key=='q' then
if _testButton(2) then
loadGame(STAT.lastPlay,true)
end
elseif key=='a'then
if _testButton(3)then
elseif key=='a' then
if _testButton(3) then
NET.autoLogin()
end
elseif key=='z'then
if _testButton(4)then
elseif key=='z' then
if _testButton(4) then
SCN.go('customGame')
end
elseif key=='-'then
if _testButton(5)then
elseif key=='-' then
if _testButton(5) then
SCN.go('setting_game')
end
elseif key=='p'then
if _testButton(6)then
elseif key=='p' then
if _testButton(6) then
SCN.go('stat')
end
elseif key=='l'then
if _testButton(7)then
elseif key=='l' then
if _testButton(7) then
SCN.go('dict')
end
elseif key==','then
if _testButton(8)then
elseif key==',' then
if _testButton(8) then
SCN.go('replays')
end
elseif key=='2'then
if _testButton(9)then
elseif key=='2' then
if _testButton(9) then
SCN.go('music')
end
elseif key=='3'then
if _testButton(10)then
elseif key=='3' then
if _testButton(10) then
SCN.go('lang')
end
elseif key=='x'then
if _testButton(11)then
elseif key=='x' then
if _testButton(11) then
SCN.go('about')
end
elseif key=='m'then
if _testButton(12)then
elseif key=='m' then
if _testButton(12) then
SCN.go('manual')
end
elseif key=='c'then
elseif key=='c' then
enterConsole()
elseif key=='escape'then
if tryBack()then
elseif key=='escape' then
if tryBack() then
VOC.play('bye')
SCN.swapTo('quit','slowFade')
end
@@ -119,13 +119,13 @@ function scene.update(dt)
if dt>.26 then return end
PLAYERS[1]:update(dt)
scrollX=scrollX-162*dt
if scrollX<-tip:getWidth()then
if scrollX<-tip:getWidth() then
scrollX=tipLength
tip:set(text.getTip())
end
local L=scene.widgetList
for i=1,8 do
L[i].x=MATH.expApproach(L[i].x,(widgetX0[i]-400+(WIDGET.isFocus(L[i])and(i<5 and 100 or -100)or 0)),dt*9)
L[i].x=MATH.expApproach(L[i].x,(widgetX0[i]-400+(WIDGET.isFocus(L[i]) and (i<5 and 100 or -100) or 0)),dt*9)
end
end

View File

@@ -16,12 +16,12 @@ end
scene.widgetList={
WIDGET.newText{name='system', x=750,y=280,color='Z',align='L',fText=SYSTEM},
WIDGET.newText{name='version', x=950,y=280,color='Z',align='L',fText=VERSION.string},
WIDGET.newButton{name='sprint', x=260,y=480,w=260,font=50,code=function()loadGame('sprint_40l',true)end},
WIDGET.newButton{name='marathon',x=640,y=480,w=260,font=50,code=function()loadGame('marathon_n',true)end},
WIDGET.newButton{name='sprint', x=260,y=480,w=260,font=50,code=function() loadGame('sprint_40l',true) end},
WIDGET.newButton{name='marathon',x=640,y=480,w=260,font=50,code=function() loadGame('marathon_n',true) end},
WIDGET.newButton{name='setting', x=1000,y=400,w=120,font=90,fText=CHAR.icon.settings,code=goScene'setting_game'},
WIDGET.newButton{name='lang', x=1000,y=560,w=120,font=90,fText=CHAR.icon.language,code=goScene'lang'},
WIDGET.newButton{name='dict', x=1160,y=400,w=120,font=90,fText=CHAR.icon.zBook,code=goScene'dict'},
WIDGET.newButton{name='quit', x=1160,y=560,w=120,font=80,fText=CHAR.key.macEsc,code=function()VOC.play('bye')SCN.swapTo('quit','slowFade')end},
WIDGET.newButton{name='quit', x=1160,y=560,w=120,font=80,fText=CHAR.key.macEsc,code=function() VOC.play('bye')SCN.swapTo('quit','slowFade') end},
}
return scene

View File

@@ -2,7 +2,7 @@ local scene={}
function scene.sceneInit()
BG.set('cubes')
local fileData=FILE.load('parts/language/manual_'..(SETTING.locale:find'zh'and'zh'or SETTING.locale:find'ja'and'ja'or'en')..'.txt','-string')
local fileData=FILE.load('parts/language/manual_'..(SETTING.locale:find'zh' and 'zh' or SETTING.locale:find'ja' and 'ja' or 'en')..'.txt','-string')
if fileData then
WIDGET.active.texts:setTexts(fileData:split('\n'))
else
@@ -15,15 +15,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='up'then
if key=='up' then
WIDGET.active.texts:scroll(-5)
elseif key=='down'then
elseif key=='down' then
WIDGET.active.texts:scroll(5)
elseif key=='pageup'then
elseif key=='pageup' then
WIDGET.active.texts:scroll(-20)
elseif key=='pagedown'then
elseif key=='pagedown' then
WIDGET.active.texts:scroll(20)
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -47,7 +47,7 @@ end
function scene.mouseMove(x,y)
selected=false
for _,M in next,MODOPT do
if(x-M.x)^2+(y-M.y)^2<2000 then
if (x-M.x)^2+(y-M.y)^2<2000 then
selected=M
break
end
@@ -55,7 +55,7 @@ function scene.mouseMove(x,y)
end
function scene.mouseDown(x,y,k)
for _,M in next,MODOPT do
if(x-M.x)^2+(y-M.y)^2<2000 then
if (x-M.x)^2+(y-M.y)^2<2000 then
_toggleMod(M,k==2 or love.keyboard.isDown('lshift','rshift'))
break
end
@@ -69,9 +69,9 @@ function scene.touchDown(x,y)
end
function scene.keyDown(key)
if key=='tab'or key=='delete'then
if GAME.mod[1]then
while GAME.mod[1]do
if key=='tab' or key=='delete' then
if GAME.mod[1] then
while GAME.mod[1] do
table.remove(GAME.mod).sel=0
end
scene.widgetList.unranked.hide=scoreValid()
@@ -85,7 +85,7 @@ function scene.keyDown(key)
break
end
end
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end

View File

@@ -26,14 +26,14 @@ local scene={}
function scene.sceneInit()
BG.set()
mapCam.zoomK=SCN.prev=='main'and 5 or 1
mapCam.zoomK=SCN.prev=='main' and 5 or 1
visibleModes={}--1=unlocked, 2=locked but visible
for name,M in next,MODES do
if RANKS[name]and M.x then
if RANKS[name] and M.x then
visibleModes[name]=1
if M.unlock then
for i=1,#M.unlock do
visibleModes[M.unlock[i]]=visibleModes[M.unlock[i]]or 2
visibleModes[M.unlock[i]]=visibleModes[M.unlock[i]] or 2
end
end
end
@@ -49,14 +49,14 @@ end
local function _onModeRaw(x,y)
for name,M in next,MODES do
if visibleModes[name]and M.x then
if visibleModes[name] and M.x then
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return name end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s+12 then return name end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<(s+6)^2 then return name end
if (x-M.x)^2+(y-M.y)^2<(s+6)^2 then return name end
end
end
end
@@ -78,7 +78,7 @@ function scene.wheelMoved(_,dy)
mapCam.xOy:translate(x*(1-k),y*(1-k))
end
function scene.mouseMove(_,_,dx,dy)
if ms.isDown(1)then
if ms.isDown(1) then
_moveMap(dx,dy)
end
mapCam.keyCtrl=false
@@ -109,9 +109,9 @@ function scene.touchDown()
end
function scene.touchMove(x,y,dx,dy)
local L=tc.getTouches()
if not L[2]then
if not L[2] then
_moveMap(dx,dy)
elseif not L[3]then
elseif not L[3] then
x,y=SCR.xOy:inverseTransformPoint(tc.getPosition(L[1]))
dx,dy=SCR.xOy:inverseTransformPoint(tc.getPosition(L[2]))--Not delta!!!
local d=(x-dx)^2+(y-dy)^2
@@ -130,7 +130,7 @@ function scene.touchClick(x,y)
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='return'then
if key=='return' then
if mapCam.sel then
if visibleModes[mapCam.sel]==2 then
MES.new('info',text.unlockHint)
@@ -139,9 +139,9 @@ function scene.keyDown(key,isRep)
loadGame(mapCam.sel)
end
end
elseif key=='f1'then
elseif key=='f1' then
SCN.go('mod')
elseif key=='escape'then
elseif key=='escape' then
if mapCam.sel then
mapCam.sel=false
else
@@ -154,10 +154,10 @@ function scene.update()
local dx,dy=0,0
local F
if not SCN.swapping then
if kb.isDown('up', 'w')then dy=dy+10 F=true end
if kb.isDown('down', 's')then dy=dy-10 F=true end
if kb.isDown('left', 'a')then dx=dx+10 F=true end
if kb.isDown('right','d')then dx=dx-10 F=true end
if kb.isDown('up', 'w') then dy=dy+10 F=true end
if kb.isDown('down', 's') then dy=dy-10 F=true end
if kb.isDown('left', 'a') then dx=dx+10 F=true end
if kb.isDown('right','d') then dx=dx-10 F=true end
local js=Z.getJsState()[1]
if js then
local sx,sy=js._jsObj:getGamepadAxis('leftx'),js._jsObj:getGamepadAxis('lefty')
@@ -172,7 +172,7 @@ function scene.update()
end
if F then
mapCam.keyCtrl=true
if kb.isDown('lctrl','rctrl','lalt','ralt')then
if kb.isDown('lctrl','rctrl','lalt','ralt') then
scene.wheelMoved(nil,(dy-dx)*.026)
else
_moveMap(dx,dy)
@@ -186,7 +186,7 @@ function scene.update()
end
local _=SCN.stat.tar
mapCam.zoomMethod=_=="game"and 1 or _=="mode"and 2
mapCam.zoomMethod=_=="game" and 1 or _=="mode" and 2
if mapCam.zoomMethod==1 then
_=mapCam.zoomK
if _<.8 then _=_*1.05 end
@@ -230,7 +230,7 @@ function scene.draw()
gc_setLineWidth(8)
gc_setColor(1,1,1,.2)
for name,M in next,MODES do
if R[name]and M.unlock and M.x then
if R[name] and M.unlock and M.x then
for _=1,#M.unlock do
local m=MODES[M.unlock[_]]
gc_line(M.x,M.y,m.x,m.y)
@@ -297,7 +297,7 @@ function scene.draw()
gc_setColor(1,1,1)
if visibleModes[sel]==2 then
mText(TEXTOBJ.modeLocked,1100,370)
elseif L[1]then
elseif L[1] then
for i=1,#L do
local t=M.scoreDisp(L[i])
local f=int((30-#t*.5)/5)*5
@@ -326,7 +326,7 @@ end
scene.widgetList={
WIDGET.newKey{name='mod', x=140,y=655,w=220,h=80,font=35,code=goScene'mod'},
WIDGET.newButton{name='start',x=1040,y=655,w=180,h=80,font=40,code=pressKey'return',hideF=function()return not mapCam.sel end},
WIDGET.newButton{name='start',x=1040,y=655,w=180,h=80,font=40,code=pressKey'return',hideF=function() return not mapCam.sel end},
WIDGET.newButton{name='back', x=1200,y=655,w=120,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -21,11 +21,11 @@ local playing
local selected--Music selected
local bgmList=BGM.getList()
if #bgmList==0 then bgmList={"[NO BGM]"}end
if #bgmList==0 then bgmList={"[NO BGM]"} end
function scene.sceneInit()
playing=BGM.getPlaying()[1]
selected=TABLE.find(bgmList,playing)or 1
selected=TABLE.find(bgmList,playing) or 1
end
function scene.wheelMoved(_,y)
@@ -33,31 +33,31 @@ function scene.wheelMoved(_,y)
end
function scene.keyDown(key,isRep)
local S=selected
if key=='down'then
if key=='down' then
if S<#bgmList then
selected=S+1
SFX.play('touch',.7)
end
elseif key=='up'then
elseif key=='up' then
if S>1 then
selected=S-1
SFX.play('touch',.7)
end
elseif not isRep then
if key=='return'or key=='space'then
if key=='return' or key=='space' then
playing=BGM.getPlaying()[1]
if playing~=bgmList[S]then
if playing~=bgmList[S] then
BGM.play(bgmList[S])
SFX.play('click')
else
BGM.stop()
SFX.play('click')
end
elseif key=='tab'then
elseif key=='tab' then
SCN.swapTo('launchpad','none')
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
elseif #key==1 and key:find'[0-9a-z]'then
elseif #key==1 and key:find'[0-9a-z]' then
for _=1,#bgmList do
selected=selected%#bgmList+1
if bgmList[selected]:sub(1,1)==key then break end
@@ -91,11 +91,11 @@ function scene.draw()
setFont(50)
GC.print(bgmList[selected],320,355)
setFont(35)
if selected>1 then GC.print(bgmList[selected-1],322,350-30)end
if selected<#bgmList then GC.print(bgmList[selected+1],322,350+65)end
if selected>1 then GC.print(bgmList[selected-1],322,350-30) end
if selected<#bgmList then GC.print(bgmList[selected+1],322,350+65) end
setFont(20)
if selected>2 then GC.print(bgmList[selected-2],322,350-50)end
if selected<#bgmList-1 then GC.print(bgmList[selected+2],322,350+110)end
if selected>2 then GC.print(bgmList[selected-2],322,350-50) end
if selected<#bgmList-1 then GC.print(bgmList[selected+2],322,350+110) end
--Title
if playing then
@@ -113,7 +113,7 @@ function scene.draw()
GC.print(playing,710,508)
setFont(35)
GC.setColor(1,sin(t*2.6)*.5+.5,sin(t*2.6)*.5+.5)
GC.print(author[playing]or"MrZ",670,465)
GC.print(author[playing] or "MrZ",670,465)
setFont(20)
GC.setColor(COLOR.Z)
@@ -126,17 +126,17 @@ end
scene.widgetList={
WIDGET.newText{name='title', x=30,y=30,font=80,align='L'},
WIDGET.newText{name='arrow', x=270,y=360,font=45,align='L'},
WIDGET.newText{name='now', x=700,y=500,font=50,align='R',hideF=function()return not playing end},
WIDGET.newText{name='now', x=700,y=500,font=50,align='R',hideF=function() return not playing end},
WIDGET.newSlider{name='slide',x=480,y=600,w=400,
disp=function()return BGM.tell()/BGM.getDuration()%1 end,
disp=function() return BGM.tell()/BGM.getDuration()%1 end,
show=false,
code=function(v)BGM.set('all','seek',v*BGM.getDuration())end,
hideF=function()return not playing end
code=function(v) BGM.set('all','seek',v*BGM.getDuration()) end,
hideF=function() return not playing end
},
WIDGET.newSlider{name='bgm', x=760,y=80,w=400,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newButton{name='up', x=200,y=250,w=120,sound=false,code=pressKey'up',hideF=function()return selected==1 end,font=60,fText=CHAR.key.up},
WIDGET.newSlider{name='bgm', x=760,y=80,w=400,disp=SETval('bgm'),code=function(v) SETTING.bgm=v BGM.setVol(SETTING.bgm) end},
WIDGET.newButton{name='up', x=200,y=250,w=120,sound=false,code=pressKey'up',hideF=function() return selected==1 end,font=60,fText=CHAR.key.up},
WIDGET.newButton{name='play', x=200,y=390,w=120,sound=false,font=65,fText=CHAR.icon.play_pause,code=pressKey'space'},
WIDGET.newButton{name='down', x=200,y=530,w=120,sound=false,code=pressKey'down',hideF=function()return selected==#bgmList end,font=60,fText=CHAR.key.down},
WIDGET.newButton{name='down', x=200,y=530,w=120,sound=false,code=pressKey'down',hideF=function() return selected==#bgmList end,font=60,fText=CHAR.key.down},
WIDGET.newButton{name='sound',x=1140,y=540,w=170,h=80,font=40,code=pressKey'tab'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -43,9 +43,9 @@ local function _gotoSetting()
SCN.go('setting_game')
end
local function _quit()
if tryBack()then
if tryBack() then
NET.room.leave()
if SCN.stack[#SCN.stack-1]=='net_newRoom'then
if SCN.stack[#SCN.stack-1]=='net_newRoom' then
SCN.pop()
end
SCN.back()
@@ -76,7 +76,7 @@ function scene.sceneInit()
upstreamProgress=1
newMessageTimer=0
if SCN.prev=='setting_game'then
if SCN.prev=='setting_game' then
NET.player.updateConf()
end
if GAME.prevBG then
@@ -92,7 +92,7 @@ function scene.sceneBack()
end
scene.mouseDown=NULL
function scene.mouseMove(x,y)NETPLY.mouseMove(x,y)end
function scene.mouseMove(x,y) NETPLY.mouseMove(x,y) end
function scene.touchDown(x,y)
if not playing then NETPLY.mouseMove(x,y)return end
if noTouch then return end
@@ -124,7 +124,7 @@ function scene.touchMove()
local B=keys[n]
if B.ava then
for i=1,#L,2 do
if(L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
if (L[i]-B.x)^2+(L[i+1]-B.y)^2<=B.r^2 then
goto CONTINUE_nextKey
end
end
@@ -135,13 +135,13 @@ function scene.touchMove()
end
end
function scene.keyDown(key,isRep)
if key=='escape'then
if key=='escape' then
if not inputBox.hide then
_switchChat()
else
_quit()
end
elseif key=='return'then
elseif key=='return' then
local mes=STRING.trim(inputBox:getText())
if not inputBox.hide and #mes>0 then
NET.room.chat(mes)
@@ -159,14 +159,14 @@ function scene.keyDown(key,isRep)
PLAYERS[1]:pressKey(k)
VK.press(k)
end
elseif not _hideReadyUI()then
if key=='space'then
elseif not _hideReadyUI() then
if key=='space' then
if NETPLY.getSelfJoinMode()==0 then
(kb.isDown('lctrl','rctrl','lalt','ralt')and _setSpectate or _setReady)()
(kb.isDown('lctrl','rctrl','lalt','ralt') and _setSpectate or _setReady)()
else
_setCancel()
end
elseif key=='s'then
elseif key=='s' then
_gotoSetting()
end
end
@@ -180,7 +180,7 @@ function scene.keyUp(key)
end
end
function scene.gamepadDown(key)
if key=='back'then
if key=='back' then
scene.keyDown('escape')
else
if not playing then return end
@@ -201,27 +201,27 @@ function scene.gamepadUp(key)
end
function scene.socketRead(cmd,d)
if cmd=='join'then
if cmd=='join' then
textBox:push{
COLOR.lR,d.username,
COLOR.dY,"#"..d.uid.." ",
COLOR.Y,text.joinRoom,
}
SFX.play('warn_1')
elseif cmd=='leave'then
elseif cmd=='leave' then
textBox:push{
COLOR.lR,d.username,
COLOR.dY,"#"..d.uid.." ",
COLOR.Y,text.leaveRoom,
}
elseif cmd=='talk'then
elseif cmd=='talk' then
newMessageTimer=80
textBox:push{
COLOR.Z,d.username,
COLOR.dY,"#"..d.uid.." ",
COLOR.N,d.message or"[_]",
COLOR.N,d.message or "[_]",
}
elseif cmd=='go'then
elseif cmd=='go' then
if not playing then
playing=true
lastUpstreamTime=0
@@ -231,7 +231,7 @@ function scene.socketRead(cmd,d)
else
MES.new('warn',"Redundant [Go]")
end
elseif cmd=='finish'then
elseif cmd=='finish' then
playing=false
BG.set()
end
@@ -250,7 +250,7 @@ function scene.update(dt)
VK.update(dt)
--Update players
for p=1,#PLAYERS do PLAYERS[p]:update(dt)end
for p=1,#PLAYERS do PLAYERS[p]:update(dt) end
--Warning check
checkWarning(dt)
@@ -258,7 +258,7 @@ function scene.update(dt)
--Upload stream
if not NET.spectate and P1.frameRun-lastUpstreamTime>8 then
local stream
if not GAME.rep[upstreamProgress]then
if not GAME.rep[upstreamProgress] then
ins(GAME.rep,P1.frameRun)
ins(GAME.rep,0)
end
@@ -303,13 +303,13 @@ function scene.draw()
--Ready & Set mark
setFont(50)
if NET.roomReadyState=='allReady'then
if NET.roomReadyState=='allReady' then
gc_setColor(1,.85,.6,.9)
mStr(text.ready,640,15)
elseif NET.roomReadyState=='connecting'then
elseif NET.roomReadyState=='connecting' then
gc_setColor(.6,1,.9,.9)
mStr(text.connStream,640,15)
elseif NET.roomReadyState=='waitConn'then
elseif NET.roomReadyState=='waitConn' then
gc_setColor(.6,.95,1,.9)
mStr(text.waitStream,640,15)
end
@@ -341,8 +341,8 @@ function scene.draw()
gc_print("M",430,10)
end
end
local function _hideF_ingame()return _hideReadyUI()or NETPLY.getSelfReady()end
local function _hideF_ingame2()return _hideReadyUI()or not NETPLY.getSelfReady()end
local function _hideF_ingame() return _hideReadyUI() or NETPLY.getSelfReady() end
local function _hideF_ingame2() return _hideReadyUI() or not NETPLY.getSelfReady() end
scene.widgetList={
textBox,
inputBox,

View File

@@ -16,7 +16,7 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newKey{name='setting',x=1200,y=160,w=90,h=90,font=60,fText=CHAR.icon.settings,code=goScene'setting_game'},
WIDGET.newKey{name='match',x=640,y=500,w=760,h=140,font=60,code=function()MES.new('warn',text.notFinished)end},
WIDGET.newKey{name='match',x=640,y=500,w=760,h=140,font=60,code=function() MES.new('warn',text.notFinished) end},
WIDGET.newButton{name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -15,11 +15,11 @@ end
scene.widgetList={
WIDGET.newKey{name='setting', x=1200,y=160,w=90, h=90,code=goScene'setting_game',font=60,fText=CHAR.icon.settings},
WIDGET.newButton{name='league',x=640, y=180,w=350,h=120,font=40,color='D',code=goScene'net_league'},
WIDGET.newButton{name='ffa', x=640, y=360,w=350,h=120,font=40,color='D',code=function()MES.new('warn',text.notFinished)--[[NET.enterRoom({name='ffa'})]]end},
WIDGET.newButton{name='ffa', x=640, y=360,w=350,h=120,font=40,color='D',code=function() MES.new('warn',text.notFinished)--[[NET.enterRoom({name='ffa'})]] end},
WIDGET.newButton{name='rooms', x=640, y=540,w=350,h=120,font=40,code=goScene'net_rooms'},
WIDGET.newButton{name='logout',x=880, y=40,w=180, h=60,color='dR',
code=function()
if tryBack()then
if tryBack() then
USER.__data.email=false
USER.__data.password=false
USER.__data.rToken=false

View File

@@ -29,12 +29,12 @@ local sList={
local scene={}
local function _createRoom()
if legalGameTime()then
if legalGameTime() then
local pw=passwordBox.value
if pw==""then pw=nil end
if pw=="" then pw=nil end
local roomname=STRING.trim(roomNameBox.value)
if #roomname==0 then
roomname=(USERS.getUsername(USER.uid)or"Anonymous").."'s room"
roomname=(USERS.getUsername(USER.uid) or "Anonymous").."'s room"
end
NET.room.create(
roomname,
@@ -103,11 +103,11 @@ scene.widgetList={
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=ROOMval('eventSet'),code=ROOMval('eventSet')},
--Next & Hold
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=ROOMval('holdMode'),code=ROOMval('holdMode'),hideF=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSelector{name='holdMode', x=310, y=890, w=300,color='lY',list=sList.holdMode,disp=ROOMval('holdMode'),code=ROOMval('holdMode'),hideF=function() return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name='nextCount', x=140, y=960, lim=130,w=200,axis={0,6,1},disp=ROOMval('nextCount'),code=ROOMsto('nextCount')},
WIDGET.newSlider{name='holdCount', x=140, y=1030,lim=130,w=200,axis={0,6,1},disp=ROOMval('holdCount'),code=ROOMsto('holdCount')},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=ROOMval('infHold'),code=ROOMrev('infHold'),hideF=function()return ROOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=ROOMval('phyHold'),code=ROOMrev('phyHold'),hideF=function()return ROOMENV.holdCount==0 end},
WIDGET.newSwitch{name='infHold', x=560, y=960, lim=200, disp=ROOMval('infHold'),code=ROOMrev('infHold'),hideF=function() return ROOMENV.holdCount==0 end},
WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=ROOMval('phyHold'),code=ROOMrev('phyHold'),hideF=function() return ROOMENV.holdCount==0 end},
}
return scene

View File

@@ -26,10 +26,10 @@ local roomList=WIDGET.newListBox{name='roomList',x=50,y=50,w=800,h=440,lineH=40,
end
if item.count then
gc_printf(
type(item.count.Spectator)=='number'and item.count.Spectator>0 and
("$1(+$2)/$3"):repD(item.count.Gamer or'?',item.count.Spectator or'?',item.capacity or'?')
type(item.count.Spectator)=='number' and item.count.Spectator>0 and
("$1(+$2)/$3"):repD(item.count.Gamer or '?',item.count.Spectator or '?',item.capacity or '?')
or
("$1/$2"):repD(item.count.Gamer or'?',item.capacity or'?'),600,-4,180,'right')
("$1/$2"):repD(item.count.Gamer or '?',item.capacity or '?'),600,-4,180,'right')
end
if item.info and item.state then
@@ -77,14 +77,14 @@ function scene.sceneInit()
end
function scene.keyDown(key)
if TASK.getLock('enterRoom')then return true end
if key=='r'then
if TASK.getLock('enterRoom') then return true end
if key=='r' then
if fetchTimer<=7 then
_fetchRoom()
end
elseif roomList:getLen()>0 and(key=='join'or key=='return'and love.keyboard.isDown('lctrl','rctrl'))then
elseif roomList:getLen()>0 and (key=='join' or key=='return' and love.keyboard.isDown('lctrl','rctrl')) then
local R=roomList:getSel()
if TASK.getLock('fetchRoom')or not R then return end
if TASK.getLock('fetchRoom') or not R then return end
if R.info.version==VERSION.room then
NET.room.enter(R.roomId,passwordBox.value)
else
@@ -96,7 +96,7 @@ function scene.keyDown(key)
end
function scene.update(dt)
if not TASK.getLock('fetchRoom')and _hidePW()then
if not TASK.getLock('fetchRoom') and _hidePW() then
fetchTimer=fetchTimer-dt
if fetchTimer<=0 then
_fetchRoom()
@@ -109,14 +109,6 @@ function scene.draw()
gc_setColor(1,1,1,.12)
gc_arc('fill','pie',250,630,40,-1.5708,-1.5708-.6283*fetchTimer)
--Joining mark
if TASK.getLock('enterRoom')then
gc.setColor(COLOR.Z)
gc.setLineWidth(15)
local t=TIME()*6.26%6.2832
gc.arc('line','open',640,360,80,t,t+4.26)
end
--Room list
local R=roomList:getSel()
if R then
@@ -130,7 +122,7 @@ function scene.draw()
gc_printf(R.info.name,10,0,365)
setFont(20)
gc_setColor(COLOR.lH)
gc_printf(R.info.description or"[No description]",10,55,365)
gc_printf(R.info.description or "[No description]",10,55,365)
if R.start then
gc_setColor(COLOR.lA)
gc_print(text.started,10,300)
@@ -151,11 +143,11 @@ scene.widgetList={
roomList,
passwordBox,
WIDGET.newKey{name='setting', x=1200,y=160,w=90,h=90,font=60,fText=CHAR.icon.settings,code=goScene'setting_game'},
WIDGET.newText{name='refreshing',x=450,y=240,font=45,hideF=function()return not TASK.getLock('fetchRoom')end},
WIDGET.newText{name='noRoom', x=450,y=245,font=40,hideF=function()return roomList:getLen()>0 or TASK.getLock('fetchRoom')end},
WIDGET.newKey{name='refresh', x=250,y=630,w=140,h=120,code=_fetchRoom,hideF=function()return fetchTimer>7 end},
WIDGET.newText{name='refreshing',x=450,y=240,font=45,hideF=function() return not TASK.getLock('fetchRoom') end},
WIDGET.newText{name='noRoom', x=450,y=245,font=40,hideF=function() return roomList:getLen()>0 or TASK.getLock('fetchRoom') end},
WIDGET.newKey{name='refresh', x=250,y=630,w=140,h=120,code=_fetchRoom,hideF=function() return fetchTimer>7 end},
WIDGET.newKey{name='new', x=510,y=630,w=260,h=120,code=goScene'net_newRoom'},
WIDGET.newKey{name='join', x=780,y=630,w=140,h=120,code=pressKey'join',hideF=function()return roomList:getLen()==0 or TASK.getLock('enterRoom')end},
WIDGET.newKey{name='join', x=780,y=630,w=140,h=120,code=pressKey'join',hideF=function() return roomList:getLen()==0 or TASK.getLock('enterRoom') end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
}

View File

@@ -19,13 +19,13 @@ local trophyColor--Current trophy color
function scene.sceneInit()
page=0
if SCN.prev:find("setting")then
if SCN.prev:find("setting") then
TEXT.show(text.needRestart,640,410,50,'fly',.6)
end
local P1=PLAYERS[1]
local S=P1.stat
timer1=SCN.prev=='game'and 0 or 50
timer1=SCN.prev=='game' and 0 or 50
timer2=timer1
local frameLostRate=(S.frame/S.time/60-1)*100
@@ -54,7 +54,7 @@ function scene.sceneInit()
--Normalize Values
for i=1,6 do
val[i]=val[i]*radar[i]if val[i]>1.26 then val[i]=1.26+log(val[i]-.26)end
val[i]=val[i]*radar[i] if val[i]>1.26 then val[i]=1.26+log(val[i]-.26) end
end
for i=1,6 do
@@ -87,16 +87,16 @@ function scene.sceneInit()
val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i]
end
if P1.result=='win'and P1.stat.piece>4 then
if P1.result=='win' and P1.stat.piece>4 then
local acc=P1.stat.finesseRate*.2/P1.stat.piece
rank=CHAR.icon['rank'..(
acc==1. and"Z"or
acc>.97 and"S"or
acc>.94 and"A"or
acc>.87 and"B"or
acc>.70 and"C"or
acc>.50 and"D"or
acc>.30 and"E"or
acc==1. and "Z" or
acc>.97 and "S" or
acc>.94 and "A" or
acc>.87 and "B" or
acc>.70 and "C" or
acc>.50 and "D" or
acc>.30 and "E" or
"F"
)]
if acc==1 then
@@ -122,43 +122,43 @@ end
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='q'then
if key=='q' then
SCN.back()
GAME.playing=false
elseif key=='escape'then
SCN.swapTo(GAME.result and'game'or'depause','none')
elseif key=='s'then
elseif key=='escape' then
SCN.swapTo(GAME.result and 'game' or 'depause','none')
elseif key=='s' then
if not GAME.fromRepMenu then
GAME.prevBG=BG.cur
SCN.go('setting_sound')
end
elseif key=='r'then
elseif key=='r' then
if not GAME.fromRepMenu then
resetGameData()
SCN.swapTo('game','none')
end
elseif key=='p'then
if(GAME.result or GAME.replaying)and #PLAYERS==1 then
elseif key=='p' then
if (GAME.result or GAME.replaying) and #PLAYERS==1 then
resetGameData('r')
PLAYERS[1]:startStreaming(GAME.rep)
SCN.swapTo('game','none')
end
elseif key=='o'then
if(GAME.result or GAME.replaying)and #PLAYERS==1 and not GAME.saved then
if DATA.saveReplay()then
elseif key=='o' then
if (GAME.result or GAME.replaying) and #PLAYERS==1 and not GAME.saved then
if DATA.saveReplay() then
GAME.saved=true
SFX.play('connected')
end
end
elseif key=='tab'or key=='Stab'then
if love.keyboard.isDown('lshift','rshift')or key=='Stab'then
elseif key=='tab' or key=='Stab' then
if love.keyboard.isDown('lshift','rshift') or key=='Stab' then
page=(page-1)%2
else
page=(page+1)%2
end
timer2=0
elseif key=='t'then
if SETTING.allowTAS and not(GAME.result or GAME.replaying)then
elseif key=='t' then
if SETTING.allowTAS and not (GAME.result or GAME.replaying) then
GAME.tasUsed=true
SFX.play('ren_mega')
SFX.play('clear_3')
@@ -170,7 +170,7 @@ function scene.keyDown(key,isRep)
end
function scene.update(dt)
if not(GAME.result or GAME.replaying)then
if not (GAME.result or GAME.replaying) then
GAME.pauseTime=GAME.pauseTime+dt
end
timer1=math.min(timer1+dt*60*.02,1)
@@ -198,13 +198,13 @@ function scene.draw()
gc.setColor(.97,.97,.97,timer1)
--Result Text
mDraw(GAME.result and TEXTOBJ[GAME.result]or TEXTOBJ.pause,640,70-10*(5-timer1*5)^1.5)
mDraw(GAME.result and TEXTOBJ[GAME.result] or TEXTOBJ.pause,640,70-10*(5-timer1*5)^1.5)
--Mode Info (outside)
gc.draw(TEXTOBJ.modeName,745-TEXTOBJ.modeName:getWidth(),143)
--Level rank
if RANK_CHARS[GAME.rank]then
if RANK_CHARS[GAME.rank] then
gc.push('transform')
gc.translate(1050,5)
setFont(80)
@@ -320,7 +320,7 @@ function scene.draw()
gc.scale(.65)
if #GAME.mod>0 then
gc.setLineWidth(2)
if scoreValid()then
if scoreValid() then
gc.setColor(.7,.7,.7,timer1)
gc.rectangle('line',-5,-5,500,150,8)
gc.setColor(.7,.7,.7,timer1*.05)
@@ -345,22 +345,22 @@ end
scene.widgetList={
WIDGET.newKey{name='resume', x=290,y=240,w=300,h=70,code=pressKey'escape'},
WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey'r',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey's',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey'r',hideF=function() return GAME.fromRepMenu end},
WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey's',hideF=function() return GAME.fromRepMenu end},
WIDGET.newKey{name='quit', x=290,y=540,w=300,h=70,code=pressKey'q'},
WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey't',hideF=function()return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey't',hideF=function() return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
WIDGET.newKey{name='page_prev',x=500,y=390,w=70,code=pressKey'tab',
fText=GC.DO{70,70,{'setLW',2}, {'dRRPol',33,35,32,3,6,3.142},{'dRRPol',45,35,32,3,6,3.142}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRRPol',33,35,32,3,6,3.142},{'fRRPol',45,35,32,3,6,3.142}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end,
hideF=function() return PLAYERS[1].frameRun<=180 end,
},
WIDGET.newKey{name='page_next',x=1230,y=390,w=70,code=pressKey'Stab',
fText=GC.DO{70,70,{'setLW',2}, {'dRRPol',37,35,32,3,6},{'dRRPol',25,35,32,3,6}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRRPol',37,35,32,3,6},{'fRRPol',25,35,32,3,6}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end,
hideF=function() return PLAYERS[1].frameRun<=180 end,
},
WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey'p',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey'p',hideF=function() return not (GAME.result or GAME.replaying) or #PLAYERS>1 end},
WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function() return not (GAME.result or GAME.replaying) or #PLAYERS>1 or GAME.saved end},
}
return scene

View File

@@ -1,7 +1,7 @@
local scene={}
function scene.sceneInit()
if SYSTEM~="iOS"then
if SYSTEM~="iOS" then
if math.random()>.0000626 then
love.timer.sleep(.26)
love.event.quit()

View File

@@ -5,7 +5,7 @@ local code
local function _getCode()
local email=WIDGET.active.email:getText()
if not STRING.simpEmailCheck(email)then
if not STRING.simpEmailCheck(email) then
MES.new('error',text.wrongEmail)
else
NET.getCode(email)
@@ -80,7 +80,7 @@ end
scene.widgetList={
WIDGET.newText{name='title', x=80, y=50,font=70,align='L'},
WIDGET.newButton{name='login', x=1140,y=100,w=170,h=80,color='lY',code=function()SCN.swapTo('login','swipeL')end},
WIDGET.newButton{name='login', x=1140,y=100,w=170,h=80,color='lY',code=function() SCN.swapTo('login','swipeL') end},
WIDGET.newInputBox{name='email', x=380, y=300,w=626,h=60,limit=128},
WIDGET.newKey{name='send', x=640, y=430,w=250,h=80,font=40,code=_getCode},

View File

@@ -17,7 +17,7 @@ local listBox=WIDGET.newListBox{name='list',x=50,y=50,w=1200,h=520,lineH=40,draw
if rep.available then
GC.setColor(.9,.9,1)
local modeName=text.modes[rep.mode]
GC.print(modeName and modeName[1].." "..modeName[2]or rep.mode,310,0)
GC.print(modeName and modeName[1].." "..modeName[2] or rep.mode,310,0)
setFont(20)
GC.setColor(1,1,.8)
GC.print(rep.date,80,6)
@@ -37,7 +37,7 @@ local function _playRep(fileName)
local rep=DATA.parseReplay(fileName,true)
if not rep.available then
MES.new('error',text.replayBroken)
elseif MODES[rep.mode]then
elseif MODES[rep.mode] then
GAME.seed=rep.seed
GAME.setting=rep.setting
TABLE.cut(GAME.mod)
@@ -72,12 +72,12 @@ function scene.sceneInit()
end
function scene.keyDown(key)
if key=='return'then
if key=='return' then
local rep=listBox:getSel()
if rep then
_playRep(rep.fileName)
end
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
local rep=listBox:getSel()
if rep then
if rep.available and rep.fileName then
@@ -92,14 +92,14 @@ function scene.keyDown(key)
MES.new('error',text.replayBroken)
end
end
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local repStr=love.system.getClipboardText()
local res,fileData=pcall(love.data.decode,'string','base64',repStr)
if res then
local fileName=os.date("replay/%Y_%m_%d_%H%M%S_import.rep")
local rep=DATA.parseReplayData(fileName,fileData,false)
if rep.available then
if saveFile(fileData,fileName,'-d')then
if saveFile(fileData,fileName,'-d') then
table.insert(REPLAY,1,rep)
MES.new('info',text.importSuccess)
end
@@ -109,10 +109,10 @@ function scene.keyDown(key)
else
MES.new('error',text.dataCorrupted)
end
elseif key=='delete'then
elseif key=='delete' then
local rep=listBox:getSel()
if rep then
if tryDelete()then
if tryDelete() then
listBox:remove()
love.filesystem.remove(rep.fileName)
for i=1,#REPLAY do
@@ -124,7 +124,7 @@ function scene.keyDown(key)
SFX.play('finesseError',.7)
end
end
elseif key=='up'or key=='down'then
elseif key=='up' or key=='down' then
listBox:arrowKey(key)
else
return true

View File

@@ -20,10 +20,10 @@ local function _parseCB()
end
scene.widgetList={
WIDGET.newText{name='export', x=55,y=45,color='lY',align='L',font=50},
WIDGET.newButton{name='unlock', x=190,y=170,w=280,h=100,color='lY',code=function()_dumpCB(RANKS)end},
WIDGET.newButton{name='data', x=490,y=170,w=280,h=100,color='lY',code=function()_dumpCB(STAT)end},
WIDGET.newButton{name='setting', x=790,y=170,w=280,h=100,color='lY',code=function()_dumpCB(SETTING)end},
WIDGET.newButton{name='vk', x=1090,y=170,w=280,h=100,color='lY',code=function()_dumpCB(VK_ORG)end},
WIDGET.newButton{name='unlock', x=190,y=170,w=280,h=100,color='lY',code=function()_dumpCB(RANKS) end},
WIDGET.newButton{name='data', x=490,y=170,w=280,h=100,color='lY',code=function()_dumpCB(STAT) end},
WIDGET.newButton{name='setting', x=790,y=170,w=280,h=100,color='lY',code=function()_dumpCB(SETTING) end},
WIDGET.newButton{name='vk', x=1090,y=170,w=280,h=100,color='lY',code=function()_dumpCB(VK_ORG) end},
WIDGET.newText{name='import', x=55,y=265,color='lR',align='L',font=50},
WIDGET.newButton{name='unlock', x=190,y=390,w=280,h=100,color='lR',
@@ -32,7 +32,7 @@ scene.widgetList={
if D then
TABLE.cover(D,RANKS)
for k,v in next,MODE_UPDATE_MAP do
if RANKS[k]then
if RANKS[k] then
RANKS[v]=RANKS[k]
RANKS[k]=nil
end
@@ -79,9 +79,9 @@ scene.widgetList={
end},
WIDGET.newText{name='couldSave', x=55,y=485,color='lB',align='L',font=50},
WIDGET.newText{name='notLogin', x=55,y=550,color='dB',align='L',font=30,hideF=function()return WS.status('user')=='running'end},
WIDGET.newButton{name='upload', x=190,y=610,w=280,h=90,color='lB',font=25,code=NET.uploadSave,hideF=function()return WS.status('user')~='running'end},
WIDGET.newButton{name='download', x=490,y=610,w=280,h=90,color='lB',font=25,code=NET.downloadSave,hideF=function()return WS.status('user')~='running'end},
WIDGET.newText{name='notLogin', x=55,y=550,color='dB',align='L',font=30,hideF=function() return WS.status('user')=='running' end},
WIDGET.newButton{name='upload', x=190,y=610,w=280,h=90,color='lB',font=25,code=NET.uploadSave,hideF=function() return WS.status('user')~='running' end},
WIDGET.newButton{name='download', x=490,y=610,w=280,h=90,color='lB',font=25,code=NET.downloadSave,hideF=function() return WS.status('user')~='running' end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -39,21 +39,21 @@ scene.widgetList={
WIDGET.newButton{name='style', x=250, y=540, w=200,h=70,font=35,code=goScene'setting_skin'},
WIDGET.newButton{name='ctrl', x=290, y=220, w=320,h=80,font=35,code=goScene'setting_control'},
WIDGET.newButton{name='key', x=640, y=220, w=320,h=80,color=MOBILE and'dH',font=35, code=goScene'setting_key'},
WIDGET.newButton{name='touch', x=990, y=220, w=320,h=80,color=not MOBILE and'dH',font=35, code=goScene'setting_touch',hideF=function()return not SETTING.VKSwitch end},
WIDGET.newButton{name='key', x=640, y=220, w=320,h=80,color=MOBILE and 'dH',font=35, code=goScene'setting_key'},
WIDGET.newButton{name='touch', x=990, y=220, w=320,h=80,color=not MOBILE and 'dH',font=35, code=goScene'setting_touch',hideF=function() return not SETTING.VKSwitch end},
WIDGET.newSwitch{name='showVK', x=1100, y=150, lim=400, disp=SETval('VKSwitch'), code=SETrev('VKSwitch')},
WIDGET.newSlider{name='reTime', x=330, y=320, w=300,lim=180,axis={.5,3,.25},disp=SETval('reTime'), code=SETsto('reTime'),show=SETval('reTime')},
WIDGET.newSelector{name='RS', x=300, y=420, w=300,color='S', disp=SETval('RS'), code=SETsto('RS'),list={'TRS','SRS','SRS_plus','SRS_X','BiRS','ARS_Z','DRS_weak','ASC','ASC_plus','C2','C2_sym','Classic','Classic_plus','None','None_plus'}},
WIDGET.newSelector{name='menuPos',x=980, y=320, w=300,color='O', disp=SETval('menuPos'), code=SETsto('menuPos'),list={'left','middle','right'}},
WIDGET.newSwitch{name='sysCursor',x=1060, y=400, lim=580, disp=SETval('sysCursor'),code=function()SETTING.sysCursor=not SETTING.sysCursor applySettings()end},
WIDGET.newSwitch{name='sysCursor',x=1060, y=400, lim=580, disp=SETval('sysCursor'),code=function() SETTING.sysCursor=not SETTING.sysCursor applySettings() end},
WIDGET.newSwitch{name='autoPause',x=1060, y=470, lim=580, disp=SETval('autoPause'),code=SETrev('autoPause')},
WIDGET.newSwitch{name='autoSave', x=1060, y=540, lim=580, disp=SETval('autoSave'), code=SETrev('autoSave')},
WIDGET.newSwitch{name='simpMode', x=960, y=670, lim=480, disp=SETval('simpMode'),
code=function()
SETTING.simpMode=not SETTING.simpMode
for i=1,#SCN.stack,2 do
if SCN.stack[i]=='main'or SCN.stack[i]=='main_simple'then
SCN.stack[i]=SETTING.simpMode and'main_simple'or'main'
if SCN.stack[i]=='main' or SCN.stack[i]=='main_simple' then
SCN.stack[i]=SETTING.simpMode and 'main_simple' or 'main'
break
end
end

View File

@@ -33,7 +33,7 @@ local keyNames={
pageup='PgUp',
pagedown='PgDn',
home='Home',
['end']='End',
[' end']='End',
insert='Ins',
numlock='Numlock',
menu=CHAR.key.winMenu,
@@ -58,7 +58,7 @@ local keyNames={
pageup=CHAR.key.macPgup,
pagedown=CHAR.key.macPgdn,
home=CHAR.key.macHome,
['end']=CHAR.key.macEnd,
[' end']=CHAR.key.macEnd,
numlock=CHAR.key.clear,
},
controller={
@@ -86,15 +86,15 @@ local keyNames={
}setmetatable(keyNames.apple,{__index=keyNames.normal})
local function _freshKeyList()
keyList={}for i=0,20 do keyList[i]={}end
keyList={} for i=0,20 do keyList[i]={} end
local keynames=SYSTEM:find'OS'and keyNames.apple or keyNames.normal
local keynames=SYSTEM:find'OS' and keyNames.apple or keyNames.normal
for k,v in next,KEY_MAP.keyboard do
ins(keyList[v],{COLOR.lB,keynames[k]or k})
ins(keyList[v],{COLOR.lB,keynames[k] or k})
end
for b,v in next,KEY_MAP.joystick do
ins(keyList[v],{COLOR.lR,keyNames.controller[b]or b})
ins(keyList[v],{COLOR.lR,keyNames.controller[b] or b})
end
end
@@ -113,13 +113,13 @@ local forbbidenKeys={
}
function scene.keyDown(key,isRep)
if isRep then return true end
if key=='escape'then
if key=='escape' then
if selected then
selected=false
else
SCN.back()
end
elseif key=='backspace'then
elseif key=='backspace' then
if selected then
for k,v in next,KEY_MAP.keyboard do
if v==selected then
@@ -131,7 +131,7 @@ function scene.keyDown(key,isRep)
SFX.play('finesseError',.5)
end
elseif selected then
if not forbbidenKeys[key]then
if not forbbidenKeys[key] then
KEY_MAP.keyboard[key]=selected
_freshKeyList()
selected=false
@@ -142,7 +142,7 @@ function scene.keyDown(key,isRep)
end
end
function scene.gamepadDown(key)
if key=='back'then
if key=='back' then
if selected then
for k,v in next,KEY_MAP.joystick do
if v==selected then
@@ -171,7 +171,7 @@ function scene.draw()
gc.printf(text.keySettingInstruction,526,620,500,'right')
for i=0,20 do
for j=1,#keyList[i]do
for j=1,#keyList[i] do
local key=keyList[i][j]
local font=#key[2]<=4 and 35 or #key[2]<=7 and 25 or 15
setFont(font)
@@ -207,29 +207,29 @@ local function _setSel(i)
end
end
scene.widgetList={
WIDGET.newKey{name='a1',x=150,y=40,w=180,h=60,font=25,code=function()_setSel(1)end},
WIDGET.newKey{name='a2',x=150,y=100,w=180,h=60,font=25,code=function()_setSel(2)end},
WIDGET.newKey{name='a3',x=150,y=160,w=180,h=60,font=25,code=function()_setSel(3)end},
WIDGET.newKey{name='a4',x=150,y=220,w=180,h=60,font=25,code=function()_setSel(4)end},
WIDGET.newKey{name='a5',x=150,y=280,w=180,h=60,font=25,code=function()_setSel(5)end},
WIDGET.newKey{name='a6',x=150,y=340,w=180,h=60,font=25,code=function()_setSel(6)end},
WIDGET.newKey{name='a7',x=150,y=400,w=180,h=60,font=25,code=function()_setSel(7)end},
WIDGET.newKey{name='a8',x=150,y=460,w=180,h=60,font=25,code=function()_setSel(8)end},
WIDGET.newKey{name='a9',x=150,y=520,w=180,h=60,font=25,code=function()_setSel(9)end},
WIDGET.newKey{name='a10',x=150,y=580,w=180,h=60,font=25,code=function()_setSel(10)end},
WIDGET.newKey{name='a1',x=150,y=40,w=180,h=60,font=25,code=function()_setSel(1) end},
WIDGET.newKey{name='a2',x=150,y=100,w=180,h=60,font=25,code=function()_setSel(2) end},
WIDGET.newKey{name='a3',x=150,y=160,w=180,h=60,font=25,code=function()_setSel(3) end},
WIDGET.newKey{name='a4',x=150,y=220,w=180,h=60,font=25,code=function()_setSel(4) end},
WIDGET.newKey{name='a5',x=150,y=280,w=180,h=60,font=25,code=function()_setSel(5) end},
WIDGET.newKey{name='a6',x=150,y=340,w=180,h=60,font=25,code=function()_setSel(6) end},
WIDGET.newKey{name='a7',x=150,y=400,w=180,h=60,font=25,code=function()_setSel(7) end},
WIDGET.newKey{name='a8',x=150,y=460,w=180,h=60,font=25,code=function()_setSel(8) end},
WIDGET.newKey{name='a9',x=150,y=520,w=180,h=60,font=25,code=function()_setSel(9) end},
WIDGET.newKey{name='a10',x=150,y=580,w=180,h=60,font=25,code=function()_setSel(10) end},
WIDGET.newKey{name='a11',x=770,y=40,w=180,h=60,font=25,code=function()_setSel(11)end},
WIDGET.newKey{name='a12',x=770,y=100,w=180,h=60,font=25,code=function()_setSel(12)end},
WIDGET.newKey{name='a13',x=770,y=160,w=180,h=60,font=25,code=function()_setSel(13)end},
WIDGET.newKey{name='a14',x=770,y=220,w=180,h=60,font=25,code=function()_setSel(14)end},
WIDGET.newKey{name='a15',x=770,y=280,w=180,h=60,font=25,code=function()_setSel(15)end},
WIDGET.newKey{name='a16',x=770,y=340,w=180,h=60,font=25,code=function()_setSel(16)end},
WIDGET.newKey{name='a17',x=770,y=400,w=180,h=60,font=25,code=function()_setSel(17)end},
WIDGET.newKey{name='a18',x=770,y=460,w=180,h=60,font=25,code=function()_setSel(18)end},
WIDGET.newKey{name='a19',x=770,y=520,w=180,h=60,font=25,code=function()_setSel(19)end},
WIDGET.newKey{name='a20',x=770,y=580,w=180,h=60,font=25,code=function()_setSel(20)end},
WIDGET.newKey{name='a11',x=770,y=40,w=180,h=60,font=25,code=function()_setSel(11) end},
WIDGET.newKey{name='a12',x=770,y=100,w=180,h=60,font=25,code=function()_setSel(12) end},
WIDGET.newKey{name='a13',x=770,y=160,w=180,h=60,font=25,code=function()_setSel(13) end},
WIDGET.newKey{name='a14',x=770,y=220,w=180,h=60,font=25,code=function()_setSel(14) end},
WIDGET.newKey{name='a15',x=770,y=280,w=180,h=60,font=25,code=function()_setSel(15) end},
WIDGET.newKey{name='a16',x=770,y=340,w=180,h=60,font=25,code=function()_setSel(16) end},
WIDGET.newKey{name='a17',x=770,y=400,w=180,h=60,font=25,code=function()_setSel(17) end},
WIDGET.newKey{name='a18',x=770,y=460,w=180,h=60,font=25,code=function()_setSel(18) end},
WIDGET.newKey{name='a19',x=770,y=520,w=180,h=60,font=25,code=function()_setSel(19) end},
WIDGET.newKey{name='a20',x=770,y=580,w=180,h=60,font=25,code=function()_setSel(20) end},
WIDGET.newKey{name='restart',x=150,y=670,w=180,h=60,code=function()_setSel(0)end},
WIDGET.newKey{name='restart',x=150,y=670,w=180,h=60,code=function()_setSel(0) end},
WIDGET.newButton{name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -7,7 +7,7 @@ local minoRot={0,0,0,0,0,0,0}
local minoRot0={}
local selEggMode
local playEgg=WIDGET.newButton{name='playEgg', x=1140,y=540,w=140,h=65,color='lP',font=60,fText=CHAR.icon.rankZ,code=function()loadGame(selEggMode,true)end}
local playEgg=WIDGET.newButton{name='playEgg', x=1140,y=540,w=140,h=65,color='lP',font=60,fText=CHAR.icon.rankZ,code=function() loadGame(selEggMode,true) end}
local scene={}
@@ -40,11 +40,11 @@ function scene.draw()
local x,y=-45-selRS.centerPos[n][0][2]*30,15+selRS.centerPos[n][0][1]*30
local col=#B[1]
for i=1,#B do for j=1,col do
if B[i][j]then
if B[i][j] then
gc.draw(texture[color],x+30*j,y-30*i)
end
end end
if selRS.centerDisp[n]then
if selRS.centerDisp[n] then
mDraw(selRS.centerTex)
end
gc.pop()
@@ -84,29 +84,29 @@ scene.widgetList={
WIDGET.newText{name='title', x=80,y=50,lim=500,font=70,align='L'},
WIDGET.newSelector{name='skinSet',x=780,y=100,w=320,list=SKIN.getList(),disp=SETval('skinSet'),code=SETsto('skinSet')},
WIDGET.newButton{name='prev1', x=130,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(1)end},
WIDGET.newButton{name='prev2', x=270,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(2)end},
WIDGET.newButton{name='prev3', x=410,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(3)end},
WIDGET.newButton{name='prev4', x=550,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(4)end},
WIDGET.newButton{name='prev5', x=690,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(5)end},
WIDGET.newButton{name='prev6', x=830,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(6)end},
WIDGET.newButton{name='prev7', x=970,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(7)end},
WIDGET.newButton{name='prev1', x=130,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(1) end},
WIDGET.newButton{name='prev2', x=270,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(2) end},
WIDGET.newButton{name='prev3', x=410,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(3) end},
WIDGET.newButton{name='prev4', x=550,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(4) end},
WIDGET.newButton{name='prev5', x=690,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(5) end},
WIDGET.newButton{name='prev6', x=830,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(6) end},
WIDGET.newButton{name='prev7', x=970,y=220,w=80,h=65,sound='hold',font=40,fText="",code=function()_prevSkin(7) end},
WIDGET.newButton{name='next1', x=130,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(1)end},
WIDGET.newButton{name='next2', x=270,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(2)end},
WIDGET.newButton{name='next3', x=410,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(3)end},
WIDGET.newButton{name='next4', x=550,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(4)end},
WIDGET.newButton{name='next5', x=690,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(5)end},
WIDGET.newButton{name='next6', x=830,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(6)end},
WIDGET.newButton{name='next7', x=970,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(7)end},
WIDGET.newButton{name='next1', x=130,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(1) end},
WIDGET.newButton{name='next2', x=270,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(2) end},
WIDGET.newButton{name='next3', x=410,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(3) end},
WIDGET.newButton{name='next4', x=550,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(4) end},
WIDGET.newButton{name='next5', x=690,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(5) end},
WIDGET.newButton{name='next6', x=830,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(6) end},
WIDGET.newButton{name='next7', x=970,y=440,w=80,h=65,sound='hold',font=40,fText="",code=function()_nextSkin(7) end},
WIDGET.newButton{name='spin1', x=130,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(1)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin2', x=270,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(2)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin3', x=410,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(3)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin4', x=550,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(4)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin5', x=690,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(5)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin6', x=825,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(6)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin7', x=970,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(7)end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin1', x=130,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(1) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin2', x=270,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(2) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin3', x=410,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(3) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin4', x=550,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(4) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin5', x=690,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(5) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin6', x=825,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(6) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='spin7', x=970,y=540,w=80,h=65,sound='rotate',font=40,code=function()_nextDir(7) end,fText=CHAR.icon.retry_spin},
WIDGET.newButton{name='skinR', x=200,y=640,w=220,h=80,color='lV',font=35,sound='back',
code=function()

View File

@@ -28,7 +28,7 @@ function scene.mouseDown(x,y)
if t2>2.6 and t2<3 and not GAME.playing then
loadGame('sprintSmooth',true)
elseif vocPack==SETTING.vocPack then
VOC.play((t2<1.26 or t2>6.26)and'doubt'or'happy')
VOC.play((t2<1.26 or t2>6.26) and 'doubt' or 'happy')
last2=TIME()
end
end
@@ -36,7 +36,7 @@ end
scene.touchDown=scene.mouseDown
function scene.keyDown(key)
if key=='space'then
if key=='space' then
scene.mouseDown(942,626)
else
return true
@@ -46,7 +46,7 @@ end
function scene.draw()
gc.setColor(1,1,1)
gc.push('transform')
if vocPack=="miya"then
if vocPack=="miya" then
gc.translate(780,340+6*sin(TIME()*.5))
gc.draw(IMG.miyaGlow,-4,-4)
if TIME()-last1<1 then
@@ -63,18 +63,18 @@ function scene.draw()
gc.translate(0,-6*sin(TIME()*.5))
gc.setColor(1,1,1,1-(TIME()-last1))
gc.draw(IMG.miyaHeart,162,52,nil,.3)
elseif vocPack=="mono"then
elseif vocPack=="mono" then
local jump=math.max(30-(TIME()-last1)*60,0)%10
gc.translate(730,340+6*sin(TIME()*.5)+(jump-10)*jump*.3)
gc.draw(IMG.monoCH)
elseif vocPack=="xiaoya"then
elseif vocPack=="xiaoya" then
gc.translate(770,340+4*sin(TIME()*.5))
gc.draw(IMG.xiaoyaCH)
gc.draw(IMG.xiaoyaOmino,16,168,26/(1+TIME()-last1),.36,.36,33,37)
elseif vocPack=="miku"then
elseif vocPack=="miku" then
gc.translate(700,320+12*sin(TIME()*.5))
gc.draw(IMG.mikuCH,nil,nil,nil,.8)
elseif vocPack=="rin"then
elseif vocPack=="rin" then
gc.translate(820,280+12*sin(TIME()*.5))
gc.draw(IMG.rinCH,nil,nil,nil,.8)
end
@@ -87,22 +87,22 @@ scene.widgetList={
WIDGET.newButton{name='game', x=200, y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_game','swipeR')},
WIDGET.newButton{name='graphic', x=1080,y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_video','swipeL')},
WIDGET.newSlider{name='mainVol', x=300, y=170,w=420,lim=220,color='lG',disp=SETval('mainVol'), code=function(v)SETTING.mainVol=v love.audio.setVolume(SETTING.mainVol)end},
WIDGET.newSlider{name='bgm', x=300, y=240,w=420,lim=220,color='lG',disp=SETval('bgm'), code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newSlider{name='sfx', x=300, y=310,w=420,lim=220,color='lC',disp=SETval('sfx'), code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end, change=function()SFX.play('warn_1')end},
WIDGET.newSlider{name='stereo', x=300, y=380,w=420,lim=220,color='lC',disp=SETval('stereo'), code=function(v)SETTING.stereo=v SFX.setStereo(SETTING.stereo)end,change=function()SFX.play('touch',1,-1)SFX.play('lock',1,1)end,hideF=function()return SETTING.sfx==0 end},
WIDGET.newSlider{name='spawn', x=300, y=450,w=420,lim=220,color='lC',disp=SETval('sfx_spawn'), code=function(v)SETTING.sfx_spawn=v end, change=function()SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn)end,},
WIDGET.newSlider{name='warn', x=300, y=520,w=420,lim=220,color='lC',disp=SETval('sfx_warn'), code=function(v)SETTING.sfx_warn=v end, change=function()SFX.fplay('warn_beep',SETTING.sfx_warn)end},
WIDGET.newSlider{name='vib', x=300, y=590,w=420,lim=220,color='lN',disp=SETval('vib'),axis={0,10,1},code=function(v)SETTING.vib=v end, change=function()if SETTING.vib>0 then VIB(SETTING.vib+2)end end},
WIDGET.newSlider{name='voc', x=300, y=660,w=420,lim=220,color='lN',disp=SETval('voc'), code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end, change=function()VOC.play('test')end},
WIDGET.newSlider{name='mainVol', x=300, y=170,w=420,lim=220,color='lG',disp=SETval('mainVol'), code=function(v) SETTING.mainVol=v love.audio.setVolume(SETTING.mainVol) end},
WIDGET.newSlider{name='bgm', x=300, y=240,w=420,lim=220,color='lG',disp=SETval('bgm'), code=function(v) SETTING.bgm=v BGM.setVol(SETTING.bgm) end},
WIDGET.newSlider{name='sfx', x=300, y=310,w=420,lim=220,color='lC',disp=SETval('sfx'), code=function(v) SETTING.sfx=v SFX.setVol(SETTING.sfx) end, change=function() SFX.play('warn_1') end},
WIDGET.newSlider{name='stereo', x=300, y=380,w=420,lim=220,color='lC',disp=SETval('stereo'), code=function(v) SETTING.stereo=v SFX.setStereo(SETTING.stereo) end,change=function() SFX.play('touch',1,-1)SFX.play('lock',1,1) end,hideF=function() return SETTING.sfx==0 end},
WIDGET.newSlider{name='spawn', x=300, y=450,w=420,lim=220,color='lC',disp=SETval('sfx_spawn'), code=function(v) SETTING.sfx_spawn=v end, change=function() SFX.fplay('spawn_'..math.random(7),SETTING.sfx_spawn) end,},
WIDGET.newSlider{name='warn', x=300, y=520,w=420,lim=220,color='lC',disp=SETval('sfx_warn'), code=function(v) SETTING.sfx_warn=v end, change=function() SFX.fplay('warn_beep',SETTING.sfx_warn) end},
WIDGET.newSlider{name='vib', x=300, y=590,w=420,lim=220,color='lN',disp=SETval('vib'),axis={0,10,1},code=function(v) SETTING.vib=v end, change=function() if SETTING.vib>0 then VIB(SETTING.vib+2) end end},
WIDGET.newSlider{name='voc', x=300, y=660,w=420,lim=220,color='lN',disp=SETval('voc'), code=function(v) SETTING.voc=v VOC.setVol(SETTING.voc) end, change=function() VOC.play('test') end},
WIDGET.newSwitch{name='autoMute', x=1150,y=180,lim=380,disp=SETval('autoMute'),code=SETrev('autoMute')},
WIDGET.newSwitch{name='fine', x=1150,y=250,lim=380,disp=SETval('fine'),code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play('finesseError',.6)end end},
WIDGET.newSwitch{name='fine', x=1150,y=250,lim=380,disp=SETval('fine'),code=function() SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play('finesseError',.6) end end},
WIDGET.newSelector{name='sfxPack',x=1100,y=330,w=200,color='lV',list=SFXPACKS,disp=function()return sfxPack end,code=function(i)sfxPack=i end},
WIDGET.newButton{name='apply', x=1100,y=400,w=180,h=60,code=function()SETTING.sfxPack=sfxPack SFX.load('media/effect/'..sfxPack..'/')end,hideF=function()return SETTING.sfxPack==sfxPack end},
WIDGET.newSelector{name='vocPack',x=1100,y=470,w=200,color='lV',list=VOCPACKS,disp=function()return vocPack end,code=function(i)vocPack=i end},
WIDGET.newButton{name='apply', x=1100,y=540,w=180,h=60,code=function()SETTING.vocPack=vocPack VOC.load('media/vocal/'..vocPack..'/')end,hideF=function()return SETTING.vocPack==vocPack end},
WIDGET.newSelector{name='sfxPack',x=1100,y=330,w=200,color='lV',list=SFXPACKS,disp=function() return sfxPack end,code=function(i) sfxPack=i end},
WIDGET.newButton{name='apply', x=1100,y=400,w=180,h=60,code=function() SETTING.sfxPack=sfxPack SFX.load('media/effect/'..sfxPack..'/') end,hideF=function() return SETTING.sfxPack==sfxPack end},
WIDGET.newSelector{name='vocPack',x=1100,y=470,w=200,color='lV',list=VOCPACKS,disp=function() return vocPack end,code=function(i) vocPack=i end},
WIDGET.newButton{name='apply', x=1100,y=540,w=180,h=60,code=function() SETTING.vocPack=vocPack VOC.load('media/vocal/'..vocPack..'/') end,hideF=function() return SETTING.vocPack==vocPack end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -64,12 +64,12 @@ function scene.mouseUp()
scene.touchUp()
end
function scene.mouseMove(_,_,dx,dy)
if ms.isDown(1)then
if ms.isDown(1) then
scene.touchMove(nil,nil,dx,dy)
end
end
function scene.touchDown(x,y)
selected=_onVK_org(x,y)or selected
selected=_onVK_org(x,y) or selected
end
function scene.touchUp()
if selected then
@@ -78,7 +78,7 @@ function scene.touchUp()
end
end
function scene.touchMove(_,_,dx,dy)
if selected and not WIDGET.isFocus()then
if selected and not WIDGET.isFocus() then
local B=VK_ORG[selected]
B.x,B.y=B.x+dx,B.y+dy
end
@@ -113,8 +113,8 @@ scene.widgetList={
defaultSetSelect=defaultSetSelect%5+1
selected=false
end},
WIDGET.newSelector{name='snap', x=750,y=90,w=200,h=80,color='Y',list={1,10,20,40,60,80},disp=function()return snapUnit end,code=function(i)snapUnit=i end},
WIDGET.newButton{name='option', x=530,y=190,w=200,h=80,font=60,fText=CHAR.icon.menu,code=function()SCN.go('setting_touchSwitch')end},
WIDGET.newSelector{name='snap', x=750,y=90,w=200,h=80,color='Y',list={1,10,20,40,60,80},disp=function() return snapUnit end,code=function(i) snapUnit=i end},
WIDGET.newButton{name='option', x=530,y=190,w=200,h=80,font=60,fText=CHAR.icon.menu,code=function() SCN.go('setting_touchSwitch') end},
WIDGET.newButton{name='back', x=750,y=190,w=200,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
WIDGET.newKey{name='save1', x=475,y=290,w=90,h=70,code=_save1,font=45,fText=CHAR.icon.saveOne},
WIDGET.newKey{name='load1', x=585,y=290,w=90,h=70,code=_load1,font=45,fText=CHAR.icon.loadOne},
@@ -132,7 +132,7 @@ scene.widgetList={
hideF=function()
return not selected
end},
WIDGET.newKey{name='shape', x=640,y=600,w=200,h=80,code=function()SETTING.VKSkin=VK.nextShape()end},
WIDGET.newKey{name='shape', x=640,y=600,w=200,h=80,code=function() SETTING.VKSkin=VK.nextShape() end},
}
return scene

View File

@@ -14,7 +14,7 @@ function scene.draw()
end
end
local function _VKAdisp(n)return function()return VK_ORG[n].ava end end
local function _VKAdisp(n) return function() return VK_ORG[n].ava end end
local function _VKAcode(n)
return n<10 and
function()
@@ -25,7 +25,7 @@ local function _VKAcode(n)
VK_ORG[n].ava=not VK_ORG[n].ava
end
end
local function _notTrack()return not SETTING.VKTrack end
local function _notTrack() return not SETTING.VKTrack end
scene.widgetScrollHeight=340
scene.widgetList={
@@ -50,17 +50,17 @@ scene.widgetList={
WIDGET.newSwitch{name='b19', x=580, y=560, lim=230,disp=_VKAdisp(19),code=_VKAcode(19)},
WIDGET.newSwitch{name='b20', x=580, y=620, lim=230,disp=_VKAdisp(20),code=_VKAcode(20)},
WIDGET.newButton{name='norm', x=840, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=i<11 end end},
WIDGET.newButton{name='pro', x=1120, y=80, w=240,h=80, font=35,code=function()for i=1,20 do VK_ORG[i].ava=true end end},
WIDGET.newButton{name='norm', x=840, y=80, w=240,h=80, font=35,code=function() for i=1,20 do VK_ORG[i].ava=i<11 end end},
WIDGET.newButton{name='pro', x=1120, y=80, w=240,h=80, font=35,code=function() for i=1,20 do VK_ORG[i].ava=true end end},
WIDGET.newSwitch{name='icon', x=1150, y=240, lim=400, font=35,disp=SETval('VKIcon'),code=SETrev('VKIcon')},
WIDGET.newSlider{name='sfx', x=830, y=320, lim=160,w=400, font=35,change=function()SFX.play('virtualKey',SETTING.VKSFX)end,disp=SETval('VKSFX'),code=SETsto('VKSFX')},
WIDGET.newSlider{name='vib', x=830, y=390, lim=160,w=400,axis={0,6,1},font=35,change=function()if SETTING.vib>0 then VIB(SETTING.vib+SETTING.VKVIB)end end,disp=SETval('VKVIB'),code=SETsto('VKVIB')},
WIDGET.newSlider{name='sfx', x=830, y=320, lim=160,w=400, font=35,change=function() SFX.play('virtualKey',SETTING.VKSFX) end,disp=SETval('VKSFX'),code=SETsto('VKSFX')},
WIDGET.newSlider{name='vib', x=830, y=390, lim=160,w=400,axis={0,6,1},font=35,change=function() if SETTING.vib>0 then VIB(SETTING.vib+SETTING.VKVIB) end end,disp=SETval('VKVIB'),code=SETsto('VKVIB')},
WIDGET.newSlider{name='alpha', x=830, y=460, lim=160,w=400, font=35,disp=SETval('VKAlpha'),code=SETsto('VKAlpha')},
WIDGET.newSwitch{name='track', x=360, y=720, lim=250, font=35,disp=SETval('VKTrack'),code=SETrev('VKTrack')},
WIDGET.newSwitch{name='dodge', x=800, y=720, lim=250, font=35,disp=SETval('VKDodge'),code=SETrev('VKDodge'),hideF=_notTrack},
WIDGET.newSlider{name='tchW', x=140, y=860, w=1000, font=35,disp=SETval('VKTchW'),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end,hideF=_notTrack},
WIDGET.newSlider{name='curW', x=140, y=930, w=1000, font=35,disp=SETval('VKCurW'),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end,hideF=_notTrack},
WIDGET.newSlider{name='tchW', x=140, y=860, w=1000, font=35,disp=SETval('VKTchW'),code=function(i) SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i) end,hideF=_notTrack},
WIDGET.newSlider{name='curW', x=140, y=930, w=1000, font=35,disp=SETval('VKCurW'),code=function(i) SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i) end,hideF=_notTrack},
WIDGET.newButton{name='back', x=1140, y=640, w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}

View File

@@ -8,7 +8,7 @@ end
function scene.fileDropped(file)
if pcall(gc.newImage,file)then
if pcall(gc.newImage,file) then
love.filesystem.write('conf/customBG',file:read('data'))
SETTING.bg='custom'
applySettings()
@@ -68,7 +68,7 @@ scene.widgetList={
WIDGET.newSlider{name='shakeFX', x=330,y=760,lim=280,w=540,axis={0,5,1},disp=SETval('shakeFX'), code=SETsto('shakeFX')},
WIDGET.newSlider{name='atkFX', x=330,y=820,lim=280,w=540,axis={0,5,1},disp=SETval('atkFX'), code=SETsto('atkFX')},
WIDGET.newSelector{name='frame', x=400,y=890,lim=280,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval('frameMul'),code=function(v)SETTING.frameMul=v;Z.setFrameMul(SETTING.frameMul)end},
WIDGET.newSelector{name='frame', x=400,y=890,lim=280,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval('frameMul'),code=function(v) SETTING.frameMul=v;Z.setFrameMul(SETTING.frameMul) end},
WIDGET.newSwitch{name='text', x=450,y=980,lim=360,disp=SETval('text'), code=SETrev('text')},
WIDGET.newSwitch{name='score', x=450,y=1030,lim=360,disp=SETval('score'), code=SETrev('score')},
@@ -78,16 +78,16 @@ scene.widgetList={
WIDGET.newSwitch{name='highCam', x=450,y=1270,lim=360,disp=SETval('highCam'), code=SETrev('highCam')},
WIDGET.newSwitch{name='warn', x=450,y=1340,lim=360,disp=SETval('warn'), code=SETrev('warn')},
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=function()SETTING.clickFX=not SETTING.clickFX applySettings()end},
WIDGET.newSwitch{name='power', x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=function()SETTING.powerInfo=not SETTING.powerInfo applySettings()end},
WIDGET.newSwitch{name='clean', x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=function()SETTING.cleanCanvas=not SETTING.cleanCanvas applySettings()end},
WIDGET.newSwitch{name='fullscreen', x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function()SETTING.fullscreen=not SETTING.fullscreen applySettings()end},
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=function() SETTING.clickFX=not SETTING.clickFX applySettings() end},
WIDGET.newSwitch{name='power', x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=function() SETTING.powerInfo=not SETTING.powerInfo applySettings() end},
WIDGET.newSwitch{name='clean', x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=function() SETTING.cleanCanvas=not SETTING.cleanCanvas applySettings() end},
WIDGET.newSwitch{name='fullscreen', x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function() SETTING.fullscreen=not SETTING.fullscreen applySettings() end},
WIDGET.newKey{name='bg_on', x=680,y=1340,w=200,h=80,code=function()SETTING.bg='on'applySettings()end},
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function()SETTING.bg='off'applySettings()end},
WIDGET.newKey{name='bg_on', x=680,y=1340,w=200,h=80,code=function() SETTING.bg='on'applySettings() end},
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function() SETTING.bg='off'applySettings() end},
WIDGET.newKey{name='bg_custom', x=1120,y=1340,w=200,h=80,
code=function()
if love.filesystem.getInfo('conf/customBG')then
if love.filesystem.getInfo('conf/customBG') then
SETTING.bg='custom'
applySettings()
else
@@ -105,18 +105,18 @@ scene.widgetList={
BG.send(v)
end
end,
hideF=function()return SETTING.bg=='on'end
hideF=function() return SETTING.bg=='on' end
},
WIDGET.newSelector{name='blockSatur', x=800,y=1440,w=300,color='lN',
list={'normal','soft','gray','light','color'},
disp=SETval('blockSatur'),
code=function(v)SETTING.blockSatur=v;applySettings(SETTING.blockSatur)end
code=function(v) SETTING.blockSatur=v; applySettings(SETTING.blockSatur) end
},
WIDGET.newSelector{name='fieldSatur', x=800,y=1540,w=300,color='lN',
list={'normal','soft','gray','light','color'},
disp=SETval('fieldSatur'),
code=function(v)SETTING.fieldSatur=v;applySettings(SETTING.fieldSatur)end
code=function(v) SETTING.fieldSatur=v; applySettings(SETTING.fieldSatur) end
},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},

View File

@@ -31,17 +31,17 @@ end
scene.touchDown=scene.mouseDown
function scene.keyDown(key)
if key=='l'then
if key=='l' then
loadGame('sprintLock',true)
elseif key=='f'then
elseif key=='f' then
loadGame('sprintFix',true)
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
function scene.update(dt)
if(kb.isDown('space','return')or tc.getTouches()[1])and v<16.2 then
if (kb.isDown('space','return') or tc.getTouches()[1]) and v<16.2 then
v=v+.42
elseif v>3.55 then
v=v-.42
@@ -54,7 +54,7 @@ function scene.update(dt)
local r=rnd()<.5
ins(names,{
text=T,
x=r and -T:getWidth()or SCR.w,
x=r and -T:getWidth() or SCR.w,
y=rnd()*(SCR.h-T:getHeight()),
w=T:getWidth(),
vx=(r and 1 or -1)*(1.626+rnd())*(SCR.w+T:getWidth())/SCR.w,

View File

@@ -46,7 +46,7 @@ function scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseDown
function scene.keyDown()
if love.keyboard.isDown('m')and love.keyboard.isDown('d')then
if love.keyboard.isDown('m') and love.keyboard.isDown('d') then
loadGame('sprintMD',true)
else
return true
@@ -114,7 +114,7 @@ end
scene.widgetList={
WIDGET.newButton{name='path',x=820,y=540,w=250,h=80,font=25,
code=function()
if SYSTEM=="Windows"or SYSTEM=="Linux"then
if SYSTEM=="Windows" or SYSTEM=="Linux" then
love.system.openURL(love.filesystem.getSaveDirectory())
else
MES.new('info',love.filesystem.getSaveDirectory())

View File

@@ -24,7 +24,7 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
_push("[keyDown] <"..key..">")
if key=='escape'then
if key=='escape' then
backCounter=backCounter-1
if backCounter==0 then
SCN.back()