整理代码,清除问题

This commit is contained in:
MrZ626
2020-10-19 22:40:14 +08:00
parent 4cdf3f52b5
commit df1cb2832d
40 changed files with 158 additions and 202 deletions

View File

@@ -1,12 +1,12 @@
local gc=love.graphics local gc=love.graphics
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min,sin,cos=math.max,math.min,math.sin,math.cos local max,min,sin=math.max,math.min,math.sin
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local BG local function NULL(...)end
local SCR=SCR local SCR=SCR
local BGvars={_G=_G,SHADER=SHADER} local BGvars={_G=_G,SHADER=SHADER}
local BG
local back={} local back={}
back.none={ back.none={
draw=function() draw=function()
@@ -208,7 +208,7 @@ back.aura={
t=rnd()*3600 t=rnd()*3600
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(_,h)
SHADER.aura:send("w",SCR.W) SHADER.aura:send("w",SCR.W)
SHADER.aura:send("h",h*SCR.dpi) SHADER.aura:send("h",h*SCR.dpi)
end, end,
@@ -225,9 +225,9 @@ back.aura={
back.bg1={ back.bg1={
init=function() init=function()
t=0 t=0
BG.resize(SCR.w) BG.resize()
end, end,
resize=function(w) resize=function()
SHADER.gradient1:send("w",SCR.W) SHADER.gradient1:send("w",SCR.W)
end, end,
update=function(dt) update=function(dt)
@@ -245,7 +245,7 @@ back.bg2={
t=0 t=0
BG.resize(nil,SCR.h) BG.resize(nil,SCR.h)
end, end,
resize=function(w,h) resize=function(_,h)
SHADER.gradient2:send("h",h*SCR.dpi) SHADER.gradient2:send("h",h*SCR.dpi)
end, end,
update=function(dt) update=function(dt)
@@ -263,7 +263,7 @@ back.rainbow={
t=0 t=0
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(_,h)
SHADER.rgb1:send("w",SCR.W) SHADER.rgb1:send("w",SCR.W)
SHADER.rgb1:send("h",h*SCR.dpi) SHADER.rgb1:send("h",h*SCR.dpi)
end, end,
@@ -282,7 +282,7 @@ back.rainbow2={
t=0 t=0
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(_,h)
SHADER.rgb2:send("w",SCR.W) SHADER.rgb2:send("w",SCR.W)
SHADER.rgb2:send("h",h*SCR.dpi) SHADER.rgb2:send("h",h*SCR.dpi)
end, end,
@@ -365,7 +365,7 @@ back.space={
W,H=SCR.w+20,SCR.h+20 W,H=SCR.w+20,SCR.h+20
BG.resize(SCR.w,SCR.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function()
local S=stars local S=stars
for i=1,1260,5 do for i=1,1260,5 do
local s=rnd(26,40)*.1 local s=rnd(26,40)*.1
@@ -376,7 +376,7 @@ back.space={
S[i+4]=(rnd()-.5)*.01*s --Vy S[i+4]=(rnd()-.5)*.01*s --Vy
end end
end, end,
update=function(dt) update=function()
local S=stars local S=stars
--Star moving --Star moving
for i=1,1260,5 do for i=1,1260,5 do
@@ -404,31 +404,31 @@ back.space={
--Make BG vars invisible --Make BG vars invisible
for _,bg in next,back do for _,bg in next,back do
if not bg.init then bg.init= NULL end setfenv(bg.init ,BGvars) if bg.init then setfenv(bg.init ,BGvars)end
if not bg.resize then bg.resize= NULL end setfenv(bg.resize ,BGvars) if bg.resize then setfenv(bg.resize ,BGvars)end
if not bg.update then bg.update= NULL end setfenv(bg.update ,BGvars) if bg.update then setfenv(bg.update ,BGvars)end
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars) if bg.draw then setfenv(bg.draw ,BGvars)end
if not bg.event then bg.event= NULL end setfenv(bg.event ,BGvars) if bg.event then setfenv(bg.event ,BGvars)end
if not bg.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars) if bg.discard then setfenv(bg.discard ,BGvars)end
end end
BG={ BG={
cur="none", cur="none",
init=NULL,
resize=NULL, resize=NULL,
update=NULL, update=NULL,
draw=back.none.draw, draw=back.none.draw,
event=NULL,
discard=NULL,
} }
function BG.send(data) function BG.send(data)
if BG.event then if BG.event then
BG.event(data) BG.event(data)
end end
end end
function BG.set(bg,data) function BG.set(bg)
if bg==BG.cur or not SETTING.bg then return end if bg==BG.cur or not SETTING.bg then return end
if BG.discard then BG.discard()
BG.discard()
collectgarbage()
end
if not back[bg]then if not back[bg]then
LOG.print("No BG called"..bg,"warn") LOG.print("No BG called"..bg,"warn")
return return

View File

@@ -1,5 +1,4 @@
local min=math.min local min=math.min
local rem=table.remove
local function fadeOut(id) local function fadeOut(id)
local src=BGM.list[id] local src=BGM.list[id]

View File

@@ -1,6 +1,4 @@
local fs=love.filesystem local fs=love.filesystem
local int=math.floor
local toN,toS=tonumber,tostring
local files={ local files={
data= fs.newFile("data.dat"), data= fs.newFile("data.dat"),

View File

@@ -23,7 +23,7 @@ local IMG={
} }
local list={} local list={}
local count=0 local count=0
for k,v in next,IMG do for k,_ in next,IMG do
count=count+1 count=count+1
list[count]=k list[count]=k
end end

View File

@@ -21,7 +21,7 @@ LIGHT= require("Zframework/light")
local ms=love.mouse local ms=love.mouse
local gc=love.graphics local gc=love.graphics
local int,rnd,abs=math.floor,math.random,math.abs local int,rnd,abs=math.floor,math.random,math.abs
local max,min=math.max,math.min local min=math.min
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local SCR=SCR local SCR=SCR
@@ -85,7 +85,7 @@ local keyDown,keyUp=keyDown,keyUp
local gamepadDown,gamepadUp=gamepadDown,gamepadUp local gamepadDown,gamepadUp=gamepadDown,gamepadUp
------------------------------------------------------------- -------------------------------------------------------------
local lastX,lastY=0,0--Last clickDown pos local lastX,lastY=0,0--Last clickDown pos
function love.mousepressed(x,y,k,touch,num) function love.mousepressed(x,y,k,touch)
if touch then return end if touch then return end
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
@@ -112,12 +112,12 @@ function love.mousemoved(x,y,dx,dy,t)
mouseMove[SCN.cur](mx,my,dx,dy) mouseMove[SCN.cur](mx,my,dx,dy)
end end
if ms.isDown(1) then if ms.isDown(1) then
WIDGET.drag(mx,my,dx,dy) WIDGET.drag(mx,my)
else else
WIDGET.moveCursor(mx,my) WIDGET.moveCursor(mx,my)
end end
end end
function love.mousereleased(x,y,k,touch,num) function love.mousereleased(x,y,k,touch)
if touch or SCN.swapping then return end if touch or SCN.swapping then return end
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
WIDGET.release(mx,my) WIDGET.release(mx,my)
@@ -155,7 +155,7 @@ function love.touchmoved(id,x,y,dx,dy)
end end
if WIDGET.sel then if WIDGET.sel then
if touching then if touching then
WIDGET.drag(x,y,dx,dy) WIDGET.drag(x,y)
end end
else else
WIDGET.moveCursor(x,y) WIDGET.moveCursor(x,y)
@@ -281,7 +281,7 @@ local keyMirror={
start="return", start="return",
back="escape", back="escape",
} }
function love.gamepadpressed(joystick,i) function love.gamepadpressed(_,i)
mouseShow=false mouseShow=false
if SCN.swapping then return end if SCN.swapping then return end
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i) if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
@@ -290,7 +290,7 @@ function love.gamepadpressed(joystick,i)
else WIDGET.gamepadPressed(i) else WIDGET.gamepadPressed(i)
end end
end end
function love.gamepadreleased(joystick,i) function love.gamepadreleased(_,i)
if SCN.swapping then return end if SCN.swapping then return end
if gamepadUp[SCN.cur]then gamepadUp[SCN.cur](i) if gamepadUp[SCN.cur]then gamepadUp[SCN.cur](i)
end end
@@ -336,7 +336,7 @@ function love.resize(w,h)
SCR.x,SCR.y=(w-h*16/9)*.5,0 SCR.x,SCR.y=(w-h*16/9)*.5,0
end end
xOy=xOy:setTransformation(w*.5,h*.5,nil,SCR.k,nil,640,360) xOy=xOy:setTransformation(w*.5,h*.5,nil,SCR.k,nil,640,360)
BG.resize(w,h) if BG.resize then BG.resize(w,h)end
SHADER.warning:send("w",w*SCR.dpi) SHADER.warning:send("w",w*SCR.dpi)
SHADER.warning:send("h",h*SCR.dpi) SHADER.warning:send("h",h*SCR.dpi)
@@ -366,7 +366,7 @@ function love.errorhandler(msg)
c=3 c=3
end end
end end
print(table.concat(err,"\n"),1,c-2) DBP(table.concat(err,"\n"),1,c-2)
gc.reset() gc.reset()
local CAP local CAP
local function _(_)CAP=gc.newImage(_)end local function _(_)CAP=gc.newImage(_)end
@@ -380,7 +380,7 @@ function love.errorhandler(msg)
local count=0 local count=0
return function() return function()
PUMP() PUMP()
for E,a,b,c,d,e in POLL()do for E,a,b in POLL()do
if E=="quit"or a=="escape"then if E=="quit"or a=="escape"then
destroyPlayers() destroyPlayers()
return 1 return 1
@@ -445,7 +445,6 @@ function love.run()
local mini=love.window.isMinimized local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll local PUMP,POLL=love.event.pump,love.event.poll
local waitTime=1/60
local frameTimeList={} local frameTimeList={}
local lastFrame=Timer() local lastFrame=Timer()

View File

@@ -2996,7 +2996,6 @@ end
local langMeta={__index=langList[1]} local langMeta={__index=langList[1]}
for i=2,#langList do setmetatable(langList[i],langMeta)end for i=2,#langList do setmetatable(langList[i],langMeta)end
local gc=love.graphics
local LANG={} local LANG={}
local drawableTextLoad={ local drawableTextLoad={
"anykey", "anykey",
@@ -3013,7 +3012,7 @@ end
function LANG.set(l) function LANG.set(l)
text=langList[l] text=langList[l]
for S,L in next,Widgets do for S,L in next,Widgets do
for N,W in next,L do for _,W in next,L do
W.text=text.WidgetText[S][W.name] W.text=text.WidgetText[S][W.name]
end end
end end

View File

@@ -62,7 +62,7 @@ function LIGHT.draw()
Lights[i]:draw() Lights[i]:draw()
end end
end end
function LIGHT.clear(L) function LIGHT.clear()
for i=#Lights,1,-1 do for i=#Lights,1,-1 do
Lights[i]:destroy() Lights[i]:destroy()
Lights[i]=nil Lights[i]=nil

View File

@@ -179,7 +179,7 @@ do--httpRequest
end end
end end
else else
function httpRequest(tick,url,method) function httpRequest(...)
LOG.print("[NO NETlib]",5,color.yellow) LOG.print("[NO NETlib]",5,color.yellow)
end end
end end
@@ -235,7 +235,7 @@ do--json
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
end end
local function encode_nil(val) return "null" end local function encode_nil() return "null" end
local function encode_table(val, stack) local function encode_table(val, stack)
local res = {} local res = {}
@@ -257,7 +257,7 @@ do--json
end end
if n ~= #val then error("invalid table: sparse array") end if n ~= #val then error("invalid table: sparse array") end
-- Encode -- Encode
for i, v in ipairs(val) do table.insert(res, encode(v, stack)) end for _, v in ipairs(val) do table.insert(res, encode(v, stack)) end
stack[val] = nil stack[val] = nil
return "[" .. table.concat(res, ",") .. "]" return "[" .. table.concat(res, ",") .. "]"

View File

@@ -102,7 +102,6 @@ function button:FX()
self.y-ATV, self.y-ATV,
self.w+2*ATV, self.w+2*ATV,
self.h+2*ATV self.h+2*ATV
,5
) )
end end
function button:update() function button:update()
@@ -329,7 +328,6 @@ local slider={
pos=0,--Position shown pos=0,--Position shown
} }
local sliderShowFunc={ local sliderShowFunc={
none=NULL,
int=function(S) int=function(S)
return S.disp() return S.disp()
end, end,
@@ -733,7 +731,7 @@ function WIDGET.press(x,y)
end end
if W.hide and W.hide()then WIDGET.sel=nil end if W.hide and W.hide()then WIDGET.sel=nil end
end end
function WIDGET.drag(x,y,dx,dy) function WIDGET.drag(x,y)
local W=WIDGET.sel local W=WIDGET.sel
if not W then return end if not W then return end
if W.type=="slider"then if W.type=="slider"then
@@ -851,7 +849,7 @@ function WIDGET.keyPressed(key)
end end
end end
else else
for k,v in next,WIDGET.active do for _,v in next,WIDGET.active do
if v.isAbove then if v.isAbove then
WIDGET.sel=v WIDGET.sel=v
break break

View File

@@ -1,5 +1,4 @@
local rnd=math.random local rnd=math.random
local ins,rem=table.insert,table.remove
local mobileHide=(SYSTEM=="Android"or SYSTEM=="iOS")and function()return true end local mobileHide=(SYSTEM=="Android"or SYSTEM=="iOS")and function()return true end
local function BACK()SCN.back()end local function BACK()SCN.back()end
local virtualkeySet={ local virtualkeySet={
@@ -102,7 +101,6 @@ local function SETsto(k) return function(i) SETTING[k]=i end end
local function STPval(k) return function() return sceneTemp[k] end end local function STPval(k) return function() return sceneTemp[k] end end
local function STPrev(k) return function() sceneTemp[k]=not sceneTemp[k] end end local function STPrev(k) return function() sceneTemp[k]=not sceneTemp[k] end end
local function STPeq(k,v) return function() return sceneTemp[k]==v end end local function STPeq(k,v) return function() return sceneTemp[k]==v end end
local function STPsto(k) return function(i) sceneTemp[k]=i end end
local function prevSkin(n) return function() SKIN.prev(n) end end local function prevSkin(n) return function() SKIN.prev(n) end end
local function nextSkin(n) return function() SKIN.next(n) end end local function nextSkin(n) return function() SKIN.next(n) end end
@@ -644,20 +642,20 @@ local Widgets={
}, },
dict={ dict={
newText({name="title", x=20,y=5,font=70,align="L"}), newText({name="title", x=20,y=5,font=70,align="L"}),
newKey({name="link", x=1140,y=650,w=200,h=80, font=35,code=pressKey("link"),hide=function()return not sceneTemp.url end}), newKey({name="link", x=1140,y=650,w=200,h=80,font=35,code=pressKey("link"),hide=function()return not sceneTemp.url end}),
newButton({name="back", x=1165,y=60,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1165,y=60,w=170,h=80,font=40,code=BACK}),
}, },
staff={ staff={
newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640,w=170,h=80,font=40,code=BACK}),
}, },
history={ history={
newKey({name="prev", x=1155, y=170,w=180, font=65,code=pressKey("up"),hide=STPeq("pos",1)}), newKey({name="prev", x=1155, y=170,w=180,font=65,code=pressKey("up"),hide=STPeq("pos",1)}),
newKey({name="next", x=1155, y=400,w=180, font=65,code=pressKey("down"),hide=function()return sceneTemp.pos==#sceneTemp.text end}), newKey({name="next", x=1155, y=400,w=180,font=65,code=pressKey("down"),hide=function()return sceneTemp.pos==#sceneTemp.text end}),
newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640,w=170,h=80,font=40,code=BACK}),
}, },
stat={ stat={
newButton({name="path", x=980, y=620,w=250,h=80, font=25,code=function()love.system.openURL(love.filesystem.getSaveDirectory())end,hide=mobileHide}), newButton({name="path", x=980, y=620,w=250,h=80,font=25,code=function()love.system.openURL(love.filesystem.getSaveDirectory())end,hide=mobileHide}),
newButton({name="back", x=640, y=620,w=200,h=80, font=35,code=BACK}), newButton({name="back", x=640, y=620,w=200,h=80,font=35,code=BACK}),
}, },
login={ login={
newText({name="title", x=80,y=50,font=70,align="L"}), newText({name="title", x=80,y=50,font=70,align="L"}),
@@ -676,20 +674,20 @@ local Widgets={
}, },
p15={ p15={
newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("space")}), newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("space")}),
newSlider({name="color", x=110,y=250,w=170,unit=4,show=false, font=30,disp=STPval("color"), code=function(v)if sceneTemp.state~=1 then sceneTemp.color=v end end,hide=STPeq("state",1)}), newSlider({name="color", x=110,y=250,w=170,unit=4,show=false,font=30,disp=STPval("color"), code=function(v)if sceneTemp.state~=1 then sceneTemp.color=v end end,hide=STPeq("state",1)}),
newSwitch({name="blind", x=240,y=330,w=60, font=40,disp=STPval("blind"), code=pressKey("w"), hide=STPeq("state",1)}), newSwitch({name="blind", x=240,y=330,w=60, font=40,disp=STPval("blind"), code=pressKey("w"), hide=STPeq("state",1)}),
newSwitch({name="slide", x=240,y=420,w=60, font=40,disp=STPval("slide"), code=pressKey("e"), hide=STPeq("state",1)}), newSwitch({name="slide", x=240,y=420,w=60, font=40,disp=STPval("slide"), code=pressKey("e"), hide=STPeq("state",1)}),
newSwitch({name="pathVis", x=240,y=510,w=60, font=40,disp=STPval("pathVis"), code=pressKey("r"), hide=function()return sceneTemp.state==1 or not sceneTemp.slide end}), newSwitch({name="pathVis", x=240,y=510,w=60, font=40,disp=STPval("pathVis"), code=pressKey("r"), hide=function()return sceneTemp.state==1 or not sceneTemp.slide end}),
newSwitch({name="revKB", x=240,y=600,w=60, font=40,disp=STPval("revKB"), code=pressKey("t"), hide=STPeq("state",1)}), newSwitch({name="revKB", x=240,y=600,w=60, font=40,disp=STPval("revKB"), code=pressKey("t"), hide=STPeq("state",1)}),
newButton({name="back", x=1140,y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140,y=640,w=170,h=80, font=40,code=BACK}),
}, },
schulte_G={ schulte_G={
newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("space"),hide=function()return sceneTemp.state==0 end}), newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen",font=40,code=pressKey("space"),hide=function()return sceneTemp.state==0 end}),
newSlider({name="rank", x=130,y=250,w=150,unit=3,show=false, font=40,disp=function()return sceneTemp.rank-3 end, code=function(v)sceneTemp.rank=v+3 end,hide=function()return sceneTemp.state>0 end}), newSlider({name="rank", x=130,y=250,w=150,unit=3,show=false,font=40,disp=function()return sceneTemp.rank-3 end,code=function(v)sceneTemp.rank=v+3 end,hide=function()return sceneTemp.state>0 end}),
newSwitch({name="blind", x=240,y=330,w=60, font=40,disp=STPval("blind"), code=pressKey("q"),hide=STPeq("state",1)}), newSwitch({name="blind", x=240,y=330,w=60, font=40,disp=STPval("blind"), code=pressKey("q"),hide=STPeq("state",1)}),
newSwitch({name="disappear",x=240,y=420,w=60, font=40,disp=STPval("disappear"), code=pressKey("w"),hide=STPeq("state",1)}), newSwitch({name="disappear",x=240,y=420,w=60, font=40,disp=STPval("disappear"),code=pressKey("w"),hide=STPeq("state",1)}),
newSwitch({name="tapFX", x=240,y=510,w=60, font=40,disp=STPval("tapFX"), code=pressKey("e"),hide=STPeq("state",1)}), newSwitch({name="tapFX", x=240,y=510,w=60, font=40,disp=STPval("tapFX"), code=pressKey("e"),hide=STPeq("state",1)}),
newButton({name="back", x=1140,y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140,y=640,w=170,h=80, font=40,code=BACK}),
}, },
pong={ pong={
newKey({name="reset", x=640,y=45,w=150,h=50, font=35,code=pressKey("r")}), newKey({name="reset", x=640,y=45,w=150,h=50, font=35,code=pressKey("r")}),

View File

@@ -9,7 +9,7 @@
]]-- ]]--
--? --?
function NULL()end NULL=function()end
DBP=print--use this if need debugging print DBP=print--use this if need debugging print
SYSTEM=love.system.getOS() SYSTEM=love.system.getOS()
MARKING=true MARKING=true
@@ -157,7 +157,7 @@ if fs.getInfo("tech_ultimate+.dat")then fs.remove("tech_ultimate+.dat")end
do do
local R=modeRanks local R=modeRanks
R.sprint_10=R.sprint_10 or 0 R.sprint_10=R.sprint_10 or 0
for k,v in next,R do for k,_ in next,R do
if type(k)=="number"then if type(k)=="number"then
R[k]=nil R[k]=nil
end end

View File

@@ -1,7 +1,6 @@
local int,max,min=math.floor,math.max,math.min local int,min=math.floor,math.min
local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"} local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"}
local function score(P) local function score(P)
local F=false
--If Less then MM --If Less then MM
if P.modeData.point<70 then if P.modeData.point<70 then
local R=#P.clearedRow local R=#P.clearedRow

View File

@@ -1,4 +1,3 @@
local int=math.floor
return{ return{
color=color.magenta, color=color.magenta,
env={ env={

View File

@@ -1,4 +1,4 @@
local int,min=math.floor,math.min local min=math.min
return{ return{
color=color.lYellow, color=color.lYellow,
env={ env={

View File

@@ -1,11 +1,4 @@
local format=string.format local format=string.format
local function getField()
local F={}
return F
end
local function newField(P)
end
return{ return{
color=color.lGrey, color=color.lGrey,
env={ env={

View File

@@ -3,7 +3,7 @@ local function check_c4w(P)
if #P.clearedRow==0 then if #P.clearedRow==0 then
P:lose() P:lose()
else else
for i=1,#P.clearedRow do for _=1,#P.clearedRow do
P.field[#P.field+1]=freeRow.get(13) P.field[#P.field+1]=freeRow.get(13)
P.visTime[#P.visTime+1]=freeRow.get(20) P.visTime[#P.visTime+1]=freeRow.get(20)
for i=4,7 do P.field[#P.field][i]=0 end for i=4,7 do P.field[#P.field][i]=0 end

View File

@@ -1,7 +1,7 @@
local min=math.min local min=math.min
local function check_c4w(P) local function check_c4w(P)
if #P.clearedRow>0 then if #P.clearedRow>0 then
for i=1,#P.clearedRow do for _=1,#P.clearedRow do
P.field[#P.field+1]=freeRow.get(13) P.field[#P.field+1]=freeRow.get(13)
P.visTime[#P.visTime+1]=freeRow.get(20) P.visTime[#P.visTime+1]=freeRow.get(20)
for i=4,7 do P.field[#P.field][i]=0 end for i=4,7 do P.field[#P.field][i]=0 end

View File

@@ -1,4 +1,3 @@
local gc=love.graphics
local int=math.floor local int=math.floor
return{ return{
color=color.white, color=color.white,

View File

@@ -1,5 +1,5 @@
local function check_rise(P) local function check_rise(P)
for i=1,math.min(8,100-P.stat.dig)-P.garbageBeneath do for _=1,math.min(8,100-P.stat.dig)-P.garbageBeneath do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
if P.stat.dig==100 then if P.stat.dig==100 then

View File

@@ -1,5 +1,5 @@
local function check_rise(P) local function check_rise(P)
for i=1,math.min(8,40-P.stat.dig)-P.garbageBeneath do for _=1,math.min(8,40-P.stat.dig)-P.garbageBeneath do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
if P.stat.dig==40 then if P.stat.dig==40 then

View File

@@ -1,5 +1,5 @@
local function check_rise(P) local function check_rise(P)
for i=1,math.min(8,400-P.stat.dig)-P.garbageBeneath do for _=1,math.min(8,400-P.stat.dig)-P.garbageBeneath do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
if P.stat.dig==400 then if P.stat.dig==400 then

View File

@@ -1,10 +1,10 @@
local min,rem=math.min,table.remove local min=math.min
return{ return{
color=color.red, color=color.red,
env={ env={
drop=20,lock=60, drop=20,lock=60,
sequence=function(P) sequence=function(P)
for i=1,3 do P:getNext(7)end for _=1,3 do P:getNext(7)end
end, end,
freshMethod=function(P) freshMethod=function(P)
if not P.next[1] then if not P.next[1] then
@@ -34,7 +34,7 @@ return{
end end
if d<40 or P.stat.row>2*42 then if d<40 or P.stat.row>2*42 then
A=#res+1 A=#res+1
for i=1,4 do for _=1,4 do
res[A]=1 res[A]=1
res[A+1]=2 res[A+1]=2
res[A+2]=6 res[A+2]=6

View File

@@ -9,7 +9,7 @@ local function check_rise(P)
P:showTextF(text.great,0,-120,80,"fly",.8) P:showTextF(text.great,0,-120,80,"fly",.8)
end end
end end
for i=1,8-L do for _=1,8-L do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
else else
@@ -17,7 +17,7 @@ local function check_rise(P)
P:showTextF(text.awesome,0,-120,80,"beat",.6) P:showTextF(text.awesome,0,-120,80,"beat",.6)
SFX.play("clear") SFX.play("clear")
BG.send(26) BG.send(26)
for i=1,8 do for _=1,8 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end
else else

View File

@@ -1,4 +1,3 @@
local gc=love.graphics
return{ return{
color=color.magenta, color=color.magenta,
env={ env={

View File

@@ -1,4 +1,3 @@
local gc=love.graphics
return{ return{
color=color.red, color=color.red,
env={ env={

View File

@@ -1,4 +1,3 @@
local gc=love.graphics
return{ return{
color=color.green, color=color.green,
env={ env={

View File

@@ -1,5 +1,4 @@
local int=math.floor local int=math.floor
local ins=table.insert
local pc_drop={50,45,40,35,30,26,22,18,15,12} local pc_drop={50,45,40,35,30,26,22,18,15,12}
local pc_lock={55,50,45,40,36,32,30} local pc_lock={55,50,45,40,36,32,30}
local pc_fall={18,16,14,12,10,9,8,7,6} local pc_fall={18,16,14,12,10,9,8,7,6}

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -1,5 +1,5 @@
local gc=love.graphics local gc=love.graphics
local int,rnd=math.floor,math.random local rnd=math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if SETTING.swap then if SETTING.swap then

View File

@@ -87,15 +87,6 @@ if CC then
end end
-------------------------------------------------9 Stack setup -------------------------------------------------9 Stack setup
local dirCount={1,1,3,3,3,0,1} local dirCount={1,1,3,3,3,0,1}
local spinOffset={
{[0]=0,1,0,0},--Z
{[0]=0,1,0,0},--L
{[0]=0,1,0,0},--J
{[0]=0,1,0,0},--T
{[0]=0,1,0,0},--S
{[0]=0,0,0,0},--O
{[0]=0,2,0,1},--I
}
local FCL={ local FCL={
[1]={ [1]={
{{11},{11,2},{1},{},{2},{2,2},{12,1},{12}}, {{11},{11,2},{1},{},{2},{2,2},{12,1},{12}},
@@ -281,7 +272,7 @@ return{
return 1 return 1
end, end,
}, },
["CC"]={ ["CC"]=CC and{
[0]=NULL, [0]=NULL,
function(P)--Start thinking function(P)--Start thinking
if not pcall(CC.think,P.AI_bot)then if not pcall(CC.think,P.AI_bot)then

View File

@@ -1,8 +1,7 @@
local tm,gc=love.timer,love.graphics local tm=love.timer
local kb,data=love.keyboard,love.data local data=love.data
local int,abs,rnd=math.floor,math.abs,math.random local int,rnd=math.floor,math.random
local max,min=math.max,math.min local sub=string.sub
local sub,find=string.sub,string.find
local char,byte=string.char,string.byte local char,byte=string.char,string.byte
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
@@ -108,24 +107,24 @@ function copySequence()
return str return str
end end
function pasteSequence(str) function pasteSequence(str)
local _ local b
local bag={} local bag={}
local reg local reg
for i=1,#str do for i=1,#str do
_=byte(str,i) b=byte(str,i)
if not reg then if not reg then
if _>=97 and _<=125 then if b>=97 and b<=125 then
reg=_-96 reg=b-96
else else
return return
end end
else else
if _>=97 and _<=125 then if b>=97 and b<=125 then
ins(bag,reg) ins(bag,reg)
reg=_-96 reg=b-96
elseif _>=34 and _<=96 then elseif b>=34 and b<=96 then
for i=1,_-32 do for _=1,b-32 do
ins(bag,reg) ins(bag,reg)
end end
reg=nil reg=nil
@@ -251,27 +250,27 @@ function copyMission()
return str return str
end end
function pasteMission(str) function pasteMission(str)
local _ local b
local mission={} local mission={}
local reg local reg
for i=1,#str do for i=1,#str do
_=byte(str,i) b=byte(str,i)
if not reg then if not reg then
if _>=34 and _<=114 then if b>=34 and b<=114 then
reg=_-33 reg=b-33
else else
return return
end end
else else
if _>=34 and _<=114 then if b>=34 and b<=114 then
if missionEnum[reg]then if missionEnum[reg]then
ins(mission,reg) ins(mission,reg)
reg=_-33 reg=b-33
else else
return return
end end
elseif _>=115 and _<=126 then elseif b>=115 and b<=126 then
for i=1,_-113 do for _=1,b-113 do
ins(mission,reg) ins(mission,reg)
end end
reg=nil reg=nil

View File

@@ -231,7 +231,7 @@ elseif SETTING.lang==3 then
elseif SETTING.lang==4 then elseif SETTING.lang==4 then
L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'} L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'}
local s="" local s=""
for i=1,math.random(16,26)do for _=1,math.random(16,26)do
s=s..L[math.random(#L)] s=s..L[math.random(#L)]
end end
return s return s

View File

@@ -26,7 +26,7 @@ local function flipList(O)--Use this to copy a symmetry list
end end
return L return L
end end
local function reflect(a,b) local function reflect(a)
local b={} local b={}
b[03]=flipList(a[01]) b[03]=flipList(a[01])
b[01]=flipList(a[03]) b[01]=flipList(a[03])

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local mt=love.math local mt=love.math
local Timer=love.timer.getTime local Timer=love.timer.getTime
local int,ceil,rnd=math.floor,math.ceil,math.random local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min,abs,sin,cos,log=math.max,math.min,math.abs,math.sin,math.cos,math.log local max,min,abs,sin=math.max,math.min,math.abs,math.sin
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local format=string.format local format=string.format
local SCR=SCR local SCR=SCR
@@ -67,7 +67,7 @@ local PLY={}--Lib
--------------------------</LIB>-------------------------- --------------------------</LIB>--------------------------
--------------------------<Update>-------------------------- --------------------------<Update>--------------------------
local function updateLine(P,dt)--Attacks, line pushing, cam moving local function updateLine(P)--Attacks, line pushing, cam moving
local bf=P.atkBuffer local bf=P.atkBuffer
for i=#bf,1,-1 do for i=#bf,1,-1 do
local A=bf[i] local A=bf[i]
@@ -96,7 +96,7 @@ local function updateLine(P,dt)--Attacks, line pushing, cam moving
y=30*max(min(#P.field-19.5-P.fieldBeneath/30,P.imgY-17),0) y=30*max(min(#P.field-19.5-P.fieldBeneath/30,P.imgY-17),0)
end end
if f~=y then if f~=y then
P.fieldUp=f>y and max(f*.95+y*.05-2,y)or ceil(f*.97+y*.03+1,y) P.fieldUp=f>y and max(f*.95+y*.05-2,y)or min(f*.97+y*.03+1,y)
end end
end end
end end
@@ -329,7 +329,7 @@ local function Pupdate_alive(P,dt)
D=1/D--Fall dist D=1/D--Fall dist
if D>P.curY-P.imgY then D=P.curY-P.imgY end if D>P.curY-P.imgY then D=P.curY-P.imgY end
if P.gameEnv.moveFX and P.gameEnv.block then if P.gameEnv.moveFX and P.gameEnv.block then
for i=1,D do for _=1,D do
P:createMoveFX("down") P:createMoveFX("down")
P.curY=P.curY-1 P.curY=P.curY-1
end end
@@ -368,7 +368,7 @@ local function Pupdate_alive(P,dt)
if P.finesseComboTime>0 then if P.finesseComboTime>0 then
P.finesseComboTime=P.finesseComboTime-1 P.finesseComboTime=P.finesseComboTime-1
end end
updateLine(P,dt) updateLine(P)
updateFXs(P,dt) updateFXs(P,dt)
updateTasks(P) updateTasks(P)
end end
@@ -396,7 +396,7 @@ local function Pupdate_dead(P,dt)
if P.finesseComboTime>0 then if P.finesseComboTime>0 then
P.finesseComboTime=P.finesseComboTime-1 P.finesseComboTime=P.finesseComboTime-1
end end
updateLine(P,dt) updateLine(P)
updateFXs(P,dt) updateFXs(P,dt)
updateTasks(P) updateTasks(P)
end end
@@ -722,10 +722,10 @@ local Pdraw_norm do
if P.lockDelay>=0 then if P.lockDelay>=0 then
gc.rectangle("fill",0,602,300*P.lockDelay/ENV.lock,6)--Lock delay indicator gc.rectangle("fill",0,602,300*P.lockDelay/ENV.lock,6)--Lock delay indicator
end end
_=3 local x=3
for i=1,min(ENV.freshLimit-P.freshTime,15)do for _=1,min(ENV.freshLimit-P.freshTime,15)do
gc.rectangle("fill",_,615,14,5) gc.rectangle("fill",x,615,14,5)
_=_+20 x=x+20
end end
--Draw Hold --Draw Hold
@@ -1129,7 +1129,6 @@ end
local function loadGameEnv(P)--Load gameEnv local function loadGameEnv(P)--Load gameEnv
P.gameEnv={}--Current game setting environment P.gameEnv={}--Current game setting environment
local ENV=P.gameEnv local ENV=P.gameEnv
local E
--Load game settings --Load game settings
for k,v in next,gameEnv0 do for k,v in next,gameEnv0 do
if modeEnv[k]~=nil then if modeEnv[k]~=nil then
@@ -1567,7 +1566,7 @@ function player.createBeam(P,R,send,time,target,color,clear,combo)
end end
else else
if combo>3 then if combo>3 then
radius=min(15+combo,30) radius=min(15+combo,30)+time*.1
corner=3 corner=3
else else
radius=30 radius=30
@@ -1577,7 +1576,7 @@ function player.createBeam(P,R,send,time,target,color,clear,combo)
g=1-g*.3 g=1-g*.3
b=1-b*.3 b=1-b*.3
end end
if modeEnv.royaleMode and not(P.human or R.human)then if modeEnv.royaleMode and not P.human and not R.human then
radius=radius*.4 radius=radius*.4
a=.35 a=.35
end end
@@ -2198,7 +2197,7 @@ do--player.drop(P)--Place piece
else else
_=#P.lockFX _=#P.lockFX
if _>0 then if _>0 then
for i=1,_ do for _=1,_ do
rem(P.lockFX) rem(P.lockFX)
end end
end end
@@ -2223,7 +2222,7 @@ do--player.drop(P)--Place piece
finesse=true finesse=true
elseif CY<=18 then elseif CY<=18 then
local y0=CY local y0=CY
local x,c=CX,P.c local c=P.c
local B=CB.bk local B=CB.bk
for x=1,c do for x=1,c do
local y local y
@@ -2970,7 +2969,7 @@ end
function player.act.func(P) function player.act.func(P)
P.gameEnv.Fkey(P) P.gameEnv.Fkey(P)
end end
function player.act.restart(P) function player.act.restart()
if GAME.frame<240 or GAME.result then if GAME.frame<240 or GAME.result then
resetPartGameData() resetPartGameData()
else else
@@ -3170,7 +3169,7 @@ function PLY.newDemoPlayer(id,x,y,size)
P:popNext() P:popNext()
end end
function PLY.newRemotePlayer(id,x,y,size,actions) function PLY.newRemotePlayer(id,x,y,size)
local P=newEmptyPlayer(id,x,y,size) local P=newEmptyPlayer(id,x,y,size)
P.human=false P.human=false

View File

@@ -5,12 +5,12 @@ local Timer=love.timer.getTime
local setFont=setFont local setFont=setFont
local mStr=mStr local mStr=mStr
local int,ceil,abs=math.floor,math.ceil,math.abs local int,abs=math.floor,math.abs
local max,min,sin,cos=math.max,math.min,math.sin,math.cos local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local log,rnd=math.log,math.random local log,rnd=math.log,math.random
local format=string.format local format=string.format
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local find,sub,char,byte=string.find,string.sub,string.char,string.byte local find,sub,byte=string.find,string.sub,string.byte
local SCR=SCR local SCR=SCR
@@ -187,7 +187,7 @@ do--load
SCN.back() SCN.back()
end end
end end
function touchDown.load(id,x,y) function touchDown.load()
if #tc.getTouches()==2 then if #tc.getTouches()==2 then
sceneTemp.skip=true sceneTemp.skip=true
end end
@@ -285,7 +285,7 @@ do--intro
end end
end end
function mouseDown.intro(x,y,k) function mouseDown.intro(_,_,k)
if k==2 then if k==2 then
VOC.play("bye") VOC.play("bye")
SCN.back() SCN.back()
@@ -312,7 +312,7 @@ do--intro
end end
end end
end end
function touchDown.intro(id,x,y) function touchDown.intro()
mouseDown.intro() mouseDown.intro()
end end
function keyDown.intro(key) function keyDown.intro(key)
@@ -457,7 +457,7 @@ do--mode
end end
end end
end end
function wheelMoved.mode(x,y) function wheelMoved.mode(_,y)
local cam=mapCam local cam=mapCam
local t=cam.k local t=cam.k
local k=t+y*.1 local k=t+y*.1
@@ -475,7 +475,7 @@ do--mode
cam.k=k cam.k=k
cam.keyCtrl=false cam.keyCtrl=false
end end
function mouseMove.mode(x,y,dx,dy) function mouseMove.mode(_,_,dx,dy)
if ms.isDown(1)then if ms.isDown(1)then
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
end end
@@ -504,10 +504,10 @@ do--mode
end end
cam.keyCtrl=false cam.keyCtrl=false
end end
function touchDown.mode(id,x,y) function touchDown.mode()
touchDist=nil touchDist=nil
end end
function touchMove.mode(id,x,y,dx,dy) function touchMove.mode(_,x,y,dx,dy)
local L=tc.getTouches() local L=tc.getTouches()
if not L[2]then if not L[2]then
mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy
@@ -544,7 +544,7 @@ do--mode
end end
end end
function Tmr.mode(dt) function Tmr.mode()
local cam=mapCam local cam=mapCam
local x,y,k=cam.x,cam.y,cam.k local x,y,k=cam.x,cam.y,cam.k
local F local F
@@ -708,7 +708,6 @@ do--mode
gc.pop() gc.pop()
if sel then if sel then
local M=Modes[sel] local M=Modes[sel]
local lang=SETTING.lang
gc.setColor(.7,.7,.7,.5) gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color) gc.setColor(M.color)
@@ -910,7 +909,7 @@ do--custom_sequence
S.cur=p S.cur=p
end end
elseif key=="ten"then elseif key=="ten"then
for i=1,10 do for _=1,10 do
local p=S.cur local p=S.cur
if p==#BAG then break end if p==#BAG then break end
repeat repeat
@@ -928,7 +927,7 @@ do--custom_sequence
end end
elseif key=="delete"then elseif key=="delete"then
if S.sure>20 then if S.sure>20 then
for i=1,#BAG do for _=1,#BAG do
rem(BAG) rem(BAG)
end end
S.cur=0 S.cur=0
@@ -1052,10 +1051,10 @@ do--custom_field
z=0,x=-1, z=0,x=-1,
} }
local FIELD=FIELD local FIELD=FIELD
function mouseDown.custom_field(x,y,k) function mouseDown.custom_field(x,y)
mouseMove.custom_field(x,y) mouseMove.custom_field(x,y)
end end
function mouseMove.custom_field(x,y,dx,dy) function mouseMove.custom_field(x,y)
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30) local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
if sx<1 or sx>10 then sx=nil end if sx<1 or sx>10 then sx=nil end
if sy<1 or sy>20 then sy=nil end if sy<1 or sy>20 then sy=nil end
@@ -1064,7 +1063,7 @@ do--custom_field
FIELD[sy][sx]=ms.isDown(1)and sceneTemp.pen or ms.isDown(2)and -1 or 0 FIELD[sy][sx]=ms.isDown(1)and sceneTemp.pen or ms.isDown(2)and -1 or 0
end end
end end
function wheelMoved.custom_field(x,y) function wheelMoved.custom_field(_,y)
local pen=sceneTemp.pen local pen=sceneTemp.pen
if y<0 then if y<0 then
pen=pen+1 pen=pen+1
@@ -1075,10 +1074,10 @@ do--custom_field
end end
sceneTemp.pen=pen sceneTemp.pen=pen
end end
function touchDown.custom_field(id,x,y) function touchDown.custom_field(_,x,y)
mouseMove.custom_field(x,y) mouseMove.custom_field(x,y)
end end
function touchMove.custom_field(id,x,y,dx,dy) function touchMove.custom_field(_,x,y)
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30) local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
if sx<1 or sx>10 then sx=nil end if sx<1 or sx>10 then sx=nil end
if sy<1 or sy>20 then sy=nil end if sy<1 or sy>20 then sy=nil end
@@ -1251,7 +1250,7 @@ do--custom_mission
S.cur=p S.cur=p
end end
elseif key=="ten"then elseif key=="ten"then
for i=1,10 do for _=1,10 do
local p=S.cur local p=S.cur
if p==#MISSION then break end if p==#MISSION then break end
repeat repeat
@@ -1269,7 +1268,7 @@ do--custom_mission
end end
elseif key=="delete"then elseif key=="delete"then
if S.sure>20 then if S.sure>20 then
for i=1,#MISSION do for _=1,#MISSION do
rem(MISSION) rem(MISSION)
end end
S.cur=0 S.cur=0
@@ -1421,7 +1420,7 @@ do--play
BG.set(modeEnv.bg) BG.set(modeEnv.bg)
end end
function touchDown.play(id,x,y) function touchDown.play(_,x,y)
if not SETTING.VKSwitch or GAME.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
@@ -1454,7 +1453,7 @@ do--play
VIB(SETTING.VKVIB) VIB(SETTING.VKVIB)
end end
end end
function touchUp.play(id,x,y) function touchUp.play(_,x,y)
if not SETTING.VKSwitch or GAME.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
@@ -1462,7 +1461,7 @@ do--play
PLAYERS[1]:releaseKey(t) PLAYERS[1]:releaseKey(t)
end end
end end
function touchMove.play(id,x,y,dx,dy) function touchMove.play()
if not SETTING.VKSwitch or GAME.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local l=tc.getTouches() local l=tc.getTouches()
@@ -2017,7 +2016,7 @@ do--setting_sound
FILE.saveSetting() FILE.saveSetting()
end end
function mouseDown.setting_sound(x,y,k) function mouseDown.setting_sound(x,y)
local S=sceneTemp local S=sceneTemp
if x>780 and x<980 and y>470 and S.jump==0 then if x>780 and x<980 and y>470 and S.jump==0 then
S.jump=10 S.jump=10
@@ -2028,7 +2027,7 @@ do--setting_sound
end end
end end
end end
function touchDown.setting_sound(id,x,y) function touchDown.setting_sound(_,x,y)
mouseDown.setting_sound(x,y) mouseDown.setting_sound(x,y)
end end
@@ -2310,30 +2309,30 @@ do--setting_touch
if k==2 then SCN.back()end if k==2 then SCN.back()end
sceneTemp.sel=onVK_org(x,y)or sceneTemp.sel sceneTemp.sel=onVK_org(x,y)or sceneTemp.sel
end end
function mouseMove.setting_touch(x,y,dx,dy) function mouseMove.setting_touch(_,_,dx,dy)
if sceneTemp.sel and ms.isDown(1)and not WIDGET.sel then if sceneTemp.sel and ms.isDown(1)and not WIDGET.sel then
local B=VK_org[sceneTemp.sel] local B=VK_org[sceneTemp.sel]
B.x,B.y=B.x+dx,B.y+dy B.x,B.y=B.x+dx,B.y+dy
end end
end end
function mouseUp.setting_touch(x,y,k) function mouseUp.setting_touch()
if sceneTemp.sel then if sceneTemp.sel then
local B=VK_org[sceneTemp.sel] local B=VK_org[sceneTemp.sel]
local k=snapLevelValue[sceneTemp.snap] local k=snapLevelValue[sceneTemp.snap]
B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k
end end
end end
function touchDown.setting_touch(id,x,y) function touchDown.setting_touch(_,x,y)
sceneTemp.sel=onVK_org(x,y)or sceneTemp.sel sceneTemp.sel=onVK_org(x,y)or sceneTemp.sel
end end
function touchUp.setting_touch(id,x,y) function touchUp.setting_touch()
if sceneTemp.sel then if sceneTemp.sel then
local B=VK_org[sceneTemp.sel] local B=VK_org[sceneTemp.sel]
local k=snapLevelValue[sceneTemp.snap] local k=snapLevelValue[sceneTemp.snap]
B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k B.x,B.y=int(B.x/k+.5)*k,int(B.y/k+.5)*k
end end
end end
function touchMove.setting_touch(id,x,y,dx,dy) function touchMove.setting_touch(_,_,_,dx,dy)
if sceneTemp.sel and not WIDGET.sel then if sceneTemp.sel and not WIDGET.sel then
local B=VK_org[sceneTemp.sel] local B=VK_org[sceneTemp.sel]
B.x,B.y=B.x+dx,B.y+dy B.x,B.y=B.x+dx,B.y+dy
@@ -2404,7 +2403,7 @@ do--music
end end
end end
function wheelMoved.music(x,y) function wheelMoved.music(_,y)
wheelScroll(y) wheelScroll(y)
end end
function keyDown.music(key) function keyDown.music(key)
@@ -2508,7 +2507,7 @@ do--dict
local function clearResult() local function clearResult()
local S=sceneTemp local S=sceneTemp
local result=S.result local result=S.result
for i=1,#result do rem(result)end for _=1,#result do rem(result)end
S.select,S.scroll,S.lastSearch=1,0 S.select,S.scroll,S.lastSearch=1,0
end end
local function search() local function search()
@@ -2768,16 +2767,8 @@ do--stat
end end
end end
do--login do--login
function Pnt.login()
local S=sceneTemp
end
end end
do--account do--account
function Pnt.account()
local S=sceneTemp
end
end end
do--minigame do--minigame
function sceneInit.minigame() function sceneInit.minigame()
@@ -2951,7 +2942,7 @@ do--p15
SCN.back() SCN.back()
end end
end end
function mouseDown.p15(x,y,k) function mouseDown.p15(x,y)
tapBoard(x,y) tapBoard(x,y)
end end
function mouseMove.p15(x,y) function mouseMove.p15(x,y)
@@ -2959,10 +2950,10 @@ do--p15
tapBoard(x,y) tapBoard(x,y)
end end
end end
function touchDown.p15(id,x,y) function touchDown.p15(_,x,y)
tapBoard(x,y) tapBoard(x,y)
end end
function touchMove.p15(id,x,y,dx,dy) function touchMove.p15(_,x,y)
if sceneTemp.slide then if sceneTemp.slide then
tapBoard(x,y) tapBoard(x,y)
end end
@@ -3157,10 +3148,10 @@ do--schulte_G
end end
end end
function mouseDown.schulte_G(x,y,k) function mouseDown.schulte_G(x,y)
tapBoard(x,y) tapBoard(x,y)
end end
function touchDown.schulte_G(id,x,y) function touchDown.schulte_G(_,x,y)
tapBoard(x,y) tapBoard(x,y)
end end
function keyDown.schulte_G(key) function keyDown.schulte_G(key)
@@ -3312,7 +3303,7 @@ do--pong
start() start()
end end
end end
function touchMove.pong(id,x,y,dx,dy) function touchMove.pong(_,x,y)
sceneTemp[x<640 and"p1"or"p2"].y0=y sceneTemp[x<640 and"p1"or"p2"].y0=y
end end
function mouseMove.pong(x,y) function mouseMove.pong(x,y)
@@ -3438,7 +3429,7 @@ do--history
end end
end end
function wheelMoved.history(x,y) function wheelMoved.history(_,y)
wheelScroll(y) wheelScroll(y)
end end
function keyDown.history(key) function keyDown.history(key)

View File

@@ -5,7 +5,6 @@ local function C(x,y)
gc.setCanvas(_) gc.setCanvas(_)
return _ return _
end end
local c
local TEXTURE={} local TEXTURE={}
gc.setDefaultFilter("nearest","nearest") gc.setDefaultFilter("nearest","nearest")