整理代码

This commit is contained in:
MrZ626
2021-09-19 04:20:16 +08:00
parent 4654e9f7c7
commit ec04da06d7
6 changed files with 24 additions and 19 deletions

View File

@@ -8,6 +8,7 @@ local gc_draw,gc_rectangle,gc_line,gc_printf=gc.draw,gc.rectangle,gc.line,gc.pri
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local SETTING,GAME,SCR=SETTING,GAME,SCR local SETTING,GAME,SCR=SETTING,GAME,SCR
local PLAYERS=PLAYERS

View File

@@ -45,10 +45,10 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1) PLY.newPlayer(1)
local P=PLAYERS[1] local P1=PLAYERS[1]
for _=1,8 do for _=1,8 do
P:garbageRise(13,1,generateLine(P.holeRND:random(10))) P1:garbageRise(13,1,generateLine(P1.holeRND:random(10)))
end end
P.fieldBeneath=0 P1.fieldBeneath=0
end, end,
} }

View File

@@ -3,6 +3,7 @@ local rem=table.remove
local WS,TIME=WS,TIME local WS,TIME=WS,TIME
local yield=YIELD local yield=YIELD
local PLAYERS=PLAYERS
local NET={ local NET={
allow_online=false, allow_online=false,

View File

@@ -16,6 +16,8 @@ local shader_alpha,shader_lighter=SHADER.alpha,SHADER.lighter
local shader_fieldSatur,shader_blockSatur=SHADER.fieldSatur,SHADER.blockSatur local shader_fieldSatur,shader_blockSatur=SHADER.fieldSatur,SHADER.blockSatur
local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor
local PLAYERS,PLY_ALIVE=PLAYERS,PLY_ALIVE
local RCPB={10,33,200,33,105,5,105,60} local RCPB={10,33,200,33,105,5,105,60}
local attackColor={ local attackColor={
{COLOR.dH,COLOR.Z}, {COLOR.dH,COLOR.Z},

View File

@@ -2,6 +2,7 @@ local gc,tc=love.graphics,love.touch
local sin=math.sin local sin=math.sin
local SCR,VK=SCR,VK local SCR,VK=SCR,VK
local GAME=GAME local GAME=GAME
local PLAYERS=PLAYERS
local noTouch,noKey=false,false local noTouch,noKey=false,false
local touchMoveLastFrame=false local touchMoveLastFrame=false
@@ -221,11 +222,11 @@ function scene.keyDown(key,isRep)
gameRate=gameRate==0 and .125 or 0 gameRate=gameRate==0 and .125 or 0
end end
_updateRepButtons() _updateRepButtons()
elseif key=='f2'then elseif key=="f2"then
if not isRep then if not isRep then
_speedDown() _speedDown()
end end
elseif key=='f3'then elseif key=="f3"then
if gameRate==0 then if gameRate==0 then
_step() _step()
elseif not isRep then elseif not isRep then

View File

@@ -33,8 +33,8 @@ function scene.sceneInit(org)
if org:find("setting")then if org:find("setting")then
TEXT.show(text.needRestart,640,410,50,'fly',.6) TEXT.show(text.needRestart,640,410,50,'fly',.6)
end end
local P=PLAYERS[1] local P1=PLAYERS[1]
local S=P.stat local S=P1.stat
timer1=org=='game'and 0 or 50 timer1=org=='game'and 0 or 50
timer2=timer1 timer2=timer1
@@ -98,8 +98,8 @@ function scene.sceneInit(org)
val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i] val[2*i-1],val[2*i]=val[i]*standard[2*i-1],val[i]*standard[2*i]
end end
if P.result=='win'and P.stat.piece>4 then if P1.result=='win'and P1.stat.piece>4 then
local acc=P.stat.finesseRate*.2/P.stat.piece local acc=P1.stat.finesseRate*.2/P1.stat.piece
rank= rank=
acc==1. and"Z"or acc==1. and"Z"or
acc>.97 and"S"or acc>.97 and"S"or
@@ -112,7 +112,7 @@ function scene.sceneInit(org)
if acc==1 then if acc==1 then
trophy=text.finesse_ap trophy=text.finesse_ap
trophyColor=COLOR.Y trophyColor=COLOR.Y
elseif P.stat.maxFinesseCombo==P.stat.piece then elseif P1.stat.maxFinesseCombo==P1.stat.piece then
trophy=text.finesse_fc trophy=text.finesse_fc
trophyColor=COLOR.lC trophyColor=COLOR.lC
else else