整理代码
This commit is contained in:
@@ -35,7 +35,8 @@ local function dumpTable(L,t)
|
||||
local T=type(k)
|
||||
if T=="number"then
|
||||
if k==count then
|
||||
k="";count=count+1
|
||||
k=""
|
||||
count=count+1
|
||||
else
|
||||
k="["..k.."]="
|
||||
end
|
||||
|
||||
@@ -23,8 +23,8 @@ local function draw(L)
|
||||
gc.setCanvas(L.blackCanvas)C()
|
||||
gc.setCanvas(L.shadowCanvas)C()
|
||||
gc.setCanvas(L.renderCanvas)C()
|
||||
lightRenderShader:send("xresolution",L.size);
|
||||
shadowMapShader:send("yresolution",L.size);
|
||||
lightRenderShader:send("xresolution",L.size)
|
||||
shadowMapShader:send("yresolution",L.size)
|
||||
|
||||
--Get up-left of light
|
||||
local X=L.x-L.size*.5
|
||||
|
||||
@@ -141,7 +141,7 @@ local Widgets={
|
||||
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
|
||||
},
|
||||
music={
|
||||
newSlider({name="bgm", x=760, y=80, w=400, font=35,disp=SETval("bgm"),code=function(v)setting.bgm=v;BGM.freshVolume()end}),
|
||||
newSlider({name="bgm", x=760, y=80, w=400, font=35,disp=SETval("bgm"),code=function(v)setting.bgm=v BGM.freshVolume()end}),
|
||||
newButton({name="up", x=200, y=250, w=120, color="white", font=55,code=pressKey("up"),hide=function()return sceneTemp==1 end}),
|
||||
newButton({name="play", x=200, y=390, w=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
|
||||
newButton({name="down", x=200, y=530, w=120, color="white", font=55,code=pressKey("down"),hide=function()return sceneTemp==BGM.len end}),
|
||||
@@ -452,8 +452,8 @@ local Widgets={
|
||||
},
|
||||
setting_trackSetting={
|
||||
newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}),
|
||||
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}),
|
||||
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}),
|
||||
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i setting.VKCurW=math.max(setting.VKCurW,i)end}),
|
||||
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i setting.VKTchW=math.min(setting.VKTchW,i)end}),
|
||||
newButton({name="back", x=1140, y=640, w=180,h=80,color="white",font=35,code=BACK}),
|
||||
},
|
||||
setting_lang={
|
||||
|
||||
@@ -4,27 +4,32 @@ local death_lock={12,11,10,9,8}
|
||||
local death_wait={10,9,8,7,6}
|
||||
local death_fall={10,9,8,7,6}
|
||||
local function score(P)
|
||||
local MD=P.modeData
|
||||
|
||||
local c=#P.clearedRow
|
||||
if c==0 and P.modeData.point%100==99 then return end
|
||||
if c==0 and MD.point%100==99 then return end
|
||||
local s=c<3 and c+1 or c==3 and 5 or 7
|
||||
if P.combo>7 then s=s+2
|
||||
elseif P.combo>3 then s=s+1
|
||||
end
|
||||
P.modeData.point=P.modeData.point+s
|
||||
if P.modeData.point%100==99 then
|
||||
MD.point=MD.point+s
|
||||
|
||||
if MD.point%100==99 then
|
||||
SFX.play("blip_1")
|
||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
||||
elseif MD.point>=100*(MD.event+1)then
|
||||
--Level up!
|
||||
local s=P.modeData.event+1;P.modeData.event=s
|
||||
local s=MD.event+1;MD.event=s
|
||||
local E=P.gameEnv
|
||||
BG.set(s==1 and"rainbow"or s==2 and"rainbow2"or s==3 and"lightning"or s==4 and"lightning2"or"lightning")
|
||||
E.lock=death_lock[s]
|
||||
E.wait=death_wait[s]
|
||||
E.fall=death_fall[s]
|
||||
E.das=int(6.9-s*.4)
|
||||
if s==3 then P.gameEnv.bone=true end
|
||||
if s==3 then
|
||||
P.gameEnv.bone=true
|
||||
end
|
||||
if s==5 then
|
||||
P.modeData.point,P.modeData.event=500,4
|
||||
MD.point,MD.event=500,4
|
||||
P:win("finish")
|
||||
else
|
||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
||||
|
||||
@@ -3,18 +3,21 @@ local rush_lock={20,18,16,15,14}
|
||||
local rush_wait={12,10,9,8,7}
|
||||
local rush_fall={18,16,14,13,12}
|
||||
local function score(P)
|
||||
local MD=P.modeData
|
||||
|
||||
local c=#P.clearedRow
|
||||
if c==0 and P.modeData.point%100==99 then return end
|
||||
if c==0 and MD.point%100==99 then return end
|
||||
local s=c<3 and c+1 or c==3 and 5 or 7
|
||||
if P.combo>7 then s=s+2
|
||||
elseif P.combo>3 then s=s+1
|
||||
end
|
||||
P.modeData.point=P.modeData.point+s
|
||||
if P.modeData.point%100==99 then
|
||||
MD.point=MD.point+s
|
||||
|
||||
if MD.point%100==99 then
|
||||
SFX.play("blip_1")
|
||||
elseif P.modeData.point>=100*(P.modeData.event+1)then
|
||||
elseif MD.point>=100*(MD.event+1)then
|
||||
--Level up!
|
||||
local s=P.modeData.event+1;P.modeData.event=s
|
||||
local s=MD.event+1;MD.event=s
|
||||
local E=P.gameEnv
|
||||
BG.set(s==1 and"bg1"or s==2 and"bg2"or s==3 and"rainbow"or "rainbow2")
|
||||
E.lock=rush_lock[s]
|
||||
@@ -28,7 +31,7 @@ local function score(P)
|
||||
end
|
||||
|
||||
if s==5 then
|
||||
P.modeData.point,P.modeData.event=500,4
|
||||
MD.point,MD.event=500,4
|
||||
P:win("finish")
|
||||
else
|
||||
P:showTextF(text.stage(s),0,-120,80,"fly")
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
local gc=love.graphics
|
||||
local int=math.floor
|
||||
local function score(P)
|
||||
local MD=P.modeData
|
||||
|
||||
local c=#P.clearedRow
|
||||
if c==0 and P.modeData.point%100==99 then return end
|
||||
if c==0 and MD.point%100==99 then return end
|
||||
local s=c<3 and c+1 or c==3 and 5 or 7
|
||||
if P.combo>7 then s=s+2
|
||||
elseif P.combo>3 then s=s+1
|
||||
end
|
||||
local MD=P.modeData
|
||||
MD.point=MD.point+s
|
||||
|
||||
if MD.point%100==99 then SFX.play("blip_1")end
|
||||
if int(MD.point*.01)>MD.event then
|
||||
--Level up!
|
||||
|
||||
@@ -2063,7 +2063,10 @@ do--player.drop(P)--Place piece
|
||||
for x=1,c do
|
||||
local y
|
||||
for i=#B,1,-1 do
|
||||
if B[i][x]then y=i;goto L1 end
|
||||
if B[i][x]then
|
||||
y=i
|
||||
goto L1
|
||||
end
|
||||
end
|
||||
goto L2
|
||||
::L1::
|
||||
|
||||
@@ -871,9 +871,11 @@ do--mode
|
||||
end
|
||||
t=k/t
|
||||
if cam.sel then
|
||||
cam.x=(cam.x-180)*t+180;cam.y=cam.y*t
|
||||
cam.x=(cam.x-180)*t+180
|
||||
cam.y=cam.y*t
|
||||
else
|
||||
cam.x=cam.x*t;cam.y=cam.y*t
|
||||
cam.x=cam.x*t
|
||||
cam.y=cam.y*t
|
||||
end
|
||||
cam.k=k
|
||||
cam.keyCtrl=false
|
||||
@@ -967,18 +969,18 @@ do--mode
|
||||
local x,y,k=cam.x,cam.y,cam.k
|
||||
local F
|
||||
if not SCN.swapping then
|
||||
if kb.isDown("up", "w")then y=y-10*k;F=true end
|
||||
if kb.isDown("down","s")then y=y+10*k;F=true end
|
||||
if kb.isDown("left","a")then x=x-10*k;F=true end
|
||||
if kb.isDown("right","d")then x=x+10*k;F=true end
|
||||
if kb.isDown("up", "w")then y=y-10*k F=true end
|
||||
if kb.isDown("down","s")then y=y+10*k F=true end
|
||||
if kb.isDown("left","a")then x=x-10*k F=true end
|
||||
if kb.isDown("right","d")then x=x+10*k F=true end
|
||||
local js1=joysticks[1]
|
||||
if js1 then
|
||||
local k=js1:getAxis(1)
|
||||
if k~="c"then
|
||||
if k=="u"or k=="ul"or k=="ur"then y=y-10*k;F=true end
|
||||
if k=="d"or k=="dl"or k=="dl"then y=y+10*k;F=true end
|
||||
if k=="l"or k=="ul"or k=="dl"then x=x-10*k;F=true end
|
||||
if k=="r"or k=="ur"or k=="dr"then x=x+10*k;F=true end
|
||||
if k=="u"or k=="ul"or k=="ur"then y=y-10*k F=true end
|
||||
if k=="d"or k=="dl"or k=="dl"then y=y+10*k F=true end
|
||||
if k=="l"or k=="ul"or k=="dl"then x=x-10*k F=true end
|
||||
if k=="r"or k=="ur"or k=="dr"then x=x+10*k F=true end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user