整理代码
This commit is contained in:
@@ -461,10 +461,15 @@ local devColor={
|
|||||||
}
|
}
|
||||||
love.draw,love.update=nil--remove default draw/update
|
love.draw,love.update=nil--remove default draw/update
|
||||||
function love.run()
|
function love.run()
|
||||||
local SCN=SCN
|
local love=love
|
||||||
local SETTING=SETTING
|
|
||||||
|
|
||||||
|
local SCN,WIDGET=SCN,WIDGET
|
||||||
|
local VOC,BG,SYSFX=VOC,BG,SYSFX
|
||||||
|
local TASK,LOG,TEXT=TASK,LOG,TEXT
|
||||||
|
|
||||||
|
local SETTING=SETTING
|
||||||
local TIME=TIME
|
local TIME=TIME
|
||||||
|
|
||||||
local STEP,WAIT=love.timer.step,love.timer.sleep
|
local STEP,WAIT=love.timer.step,love.timer.sleep
|
||||||
local FPS=love.timer.getFPS
|
local FPS=love.timer.getFPS
|
||||||
local MINI=love.window.isMinimized
|
local MINI=love.window.isMinimized
|
||||||
@@ -506,12 +511,12 @@ function love.run()
|
|||||||
TASK.update()
|
TASK.update()
|
||||||
WS.update(dt)
|
WS.update(dt)
|
||||||
VOC.update()
|
VOC.update()
|
||||||
BG.update(dt)
|
BG.update(dt)--BG animation
|
||||||
SYSFX.update(dt)
|
SYSFX.update(dt)
|
||||||
WIDGET.update()--Widgets animation
|
WIDGET.update()--Widgets animation
|
||||||
if SCN.update then SCN.update(dt)end--Scene Updater
|
if SCN.update then SCN.update(dt)end--Scene updater
|
||||||
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
|
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
|
||||||
TEXT.update()
|
TEXT.update()--Update global texts animation
|
||||||
LOG.update()
|
LOG.update()
|
||||||
|
|
||||||
--DRAW
|
--DRAW
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return{
|
|||||||
for _=1,3 do P:getNext(7)end
|
for _=1,3 do P:getNext(7)end
|
||||||
while true do
|
while true do
|
||||||
YIELD()
|
YIELD()
|
||||||
if not P.nextQueue[1] then
|
if not P.nextQueue[1]then
|
||||||
local height=FREEROW.get(0)
|
local height=FREEROW.get(0)
|
||||||
local max=#P.field
|
local max=#P.field
|
||||||
if max>0 then
|
if max>0 then
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ return{
|
|||||||
end,
|
end,
|
||||||
score=function(P)return{P.stat.time,P.stat.piece}end,
|
score=function(P)return{P.stat.time,P.stat.piece}end,
|
||||||
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
|
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
|
||||||
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
|
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1]and a[2]<b[2])end,
|
||||||
getRank=function(P)
|
getRank=function(P)
|
||||||
if P.stat.row<40 then return end
|
if P.stat.row<40 then return end
|
||||||
local T=P.stat.time
|
local T=P.stat.time
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ return{
|
|||||||
end,
|
end,
|
||||||
score=function(P)return{P.stat.time,P.stat.piece}end,
|
score=function(P)return{P.stat.time,P.stat.piece}end,
|
||||||
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
|
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
|
||||||
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
|
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1]and a[2]<b[2])end,
|
||||||
getRank=function(P)
|
getRank=function(P)
|
||||||
if P.stat.row<40 then return end
|
if P.stat.row<40 then return end
|
||||||
local T=P.stat.time
|
local T=P.stat.time
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ function draw.drawNext_norm(P)
|
|||||||
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||||
local k=#bk>2 and 2.2/#bk or 1
|
local k=#bk>2 and 2.2/#bk or 1
|
||||||
gc_scale(k)
|
gc_scale(k)
|
||||||
for i=1,#bk do for j=1,#bk[1] do
|
for i=1,#bk do for j=1,#bk[1]do
|
||||||
if bk[i][j]then
|
if bk[i][j]then
|
||||||
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
|
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
|
||||||
end
|
end
|
||||||
@@ -497,7 +497,7 @@ function draw.drawNext_hidden(P)
|
|||||||
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||||
local k=#bk>2 and 2.2/#bk or 1
|
local k=#bk>2 and 2.2/#bk or 1
|
||||||
gc_scale(k)
|
gc_scale(k)
|
||||||
for i=1,#bk do for j=1,#bk[1] do
|
for i=1,#bk do for j=1,#bk[1]do
|
||||||
if bk[i][j]then
|
if bk[i][j]then
|
||||||
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
|
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user