修正一处变量名漏改

整理代码
This commit is contained in:
MrZ626
2021-09-23 15:16:58 +08:00
parent d78fc5bf9c
commit 84058f9833
2 changed files with 28 additions and 32 deletions

View File

@@ -36,10 +36,32 @@ local function _getNewStatTable()
end
return T
end
local playerActions={
Player.act_moveLeft, --1
Player.act_moveRight, --2
Player.act_rotRight, --3
Player.act_rotLeft, --4
Player.act_rot180, --5
Player.act_hardDrop, --6
Player.act_softDrop, --7
Player.act_hold, --8
Player.act_func1, --9
Player.act_func2, --10
Player.act_insLeft, --11
Player.act_insRight, --12
Player.act_insDown, --13
Player.act_down1, --14
Player.act_down4, --15
Player.act_down10, --16
Player.act_dropLeft, --17
Player.act_dropRight, --18
Player.act_zangiLeft, --19
Player.act_zangiRight,--20
}
local function _pressKey(P,keyID)
if P.keyAvailable[keyID]and P.alive then
P.keyPressing[keyID]=true
P.actList[keyID](P)
playerActions[keyID](P)
P.stat.key=P.stat.key+1
end
end
@@ -52,7 +74,7 @@ local function _pressKey_Rec(P,keyID)
ins(L,P.frameRun)
ins(L,keyID)
P.keyPressing[keyID]=true
P.actList[keyID](P)
playerActions[keyID](P)
P.stat.key=P.stat.key+1
end
end
@@ -172,7 +194,6 @@ local function _newEmptyPlayer(id,mini)
P.waiting,P.falling=-1,-1
P.freshTime=0
P.spinLast=false
P.spinSeq=0--For Ospin, each digit mean a spin
P.ctrlCount=0--Key press time, for finesse check
--Game states

View File

@@ -1,16 +1,16 @@
-------------------------------------------------
--Var P in other files represent Player object!--
-------------------------------------------------
local Player={}--Player class
local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min,abs,modf=math.max,math.min,math.abs,math.modf
local ins,rem=table.insert,table.remove
local assert,ins,rem=assert,table.insert,table.remove
local resume,yield,status=coroutine.resume,coroutine.yield,coroutine.status
local assert=assert
local SFX,BGM,VOC,VIB,SYSFX=SFX,BGM,VOC,VIB,SYSFX
local FREEROW,TABLE,TEXT,NET,TASK=FREEROW,TABLE,TEXT,NET,TASK
local FREEROW,TABLE,TEXT,TASK=FREEROW,TABLE,TEXT,TASK
local PLAYERS,PLY_ALIVE,GAME=PLAYERS,PLY_ALIVE,GAME
local ply_draw=require"parts.player.draw"
@@ -855,7 +855,6 @@ function Player:hold(ifpre)
::BREAK_success::
self.spinLast=false
self.spinSeq=0
local hb=self:getBlock(C.id)
hb.name=C.name
hb.color=C.color
@@ -864,7 +863,6 @@ function Player:hold(ifpre)
self.curX,self.curY=x,y
else--Normal hold
self.spinLast=false
self.spinSeq=0
if C then
local hb=self:getBlock(C.id)
@@ -922,7 +920,6 @@ function Player:popNext(ifhold)--Pop nextQueue to hand
self.holdTime=min(self.holdTime+1,ENV.holdCount)
end
self.spinLast=false
self.spinSeq=0
self.ctrlCount=0
self.cur=rem(self.nextQueue,1)
@@ -2105,7 +2102,7 @@ local function update_remote_alive(P,dt)
end
P.streamProgress=P.streamProgress+2
else--No event now, run one frame
update.alive(P,dt/frameRate)
update_alive(P,dt/frameRate)
P.stat.time=P.frameRun/60
end
else--Pause state, no actions, quit loop
@@ -2578,27 +2575,5 @@ function Player:act_zangiRight()
self:act_hardDrop()
end
end
Player.actList={
Player.act_moveLeft, --1
Player.act_moveRight, --2
Player.act_rotRight, --3
Player.act_rotLeft, --4
Player.act_rot180, --5
Player.act_hardDrop, --6
Player.act_softDrop, --7
Player.act_hold, --8
Player.act_func1, --9
Player.act_func2, --10
Player.act_insLeft, --11
Player.act_insRight, --12
Player.act_insDown, --13
Player.act_down1, --14
Player.act_down4, --15
Player.act_down10, --16
Player.act_dropLeft, --17
Player.act_dropRight, --18
Player.act_zangiLeft, --19
Player.act_zangiRight,--20
}
--------------------------</Action>--------------------------
return Player