整理代码

This commit is contained in:
MrZ626
2021-07-13 22:26:10 +08:00
parent 51e709acf6
commit 9818685856
3 changed files with 44 additions and 43 deletions

View File

@@ -564,16 +564,16 @@ function love.run()
--UPDATE --UPDATE
STEP() STEP()
TASK.update()
WS.update(dt)
VOC.update() VOC.update()
BG.update(dt) BG.update(dt)
TEXT.update()
MES.update(dt)
WS.update(dt)
TASK.update()
SYSFX.update(dt) SYSFX.update(dt)
if SCN.update then SCN.update(dt)end if SCN.update then SCN.update(dt)end
if SCN.swapping then SCN.swapUpdate()end if SCN.swapping then SCN.swapUpdate()end
WIDGET.update() WIDGET.update()
TEXT.update()
MES.update(dt)
--DRAW --DRAW
if not MINI()then if not MINI()then

View File

@@ -12,9 +12,9 @@ return{
{name='drought_n', x=-400, y=0, size=40,shape=1,icon="drought", unlock={'drought_l'}}, {name='drought_n', x=-400, y=0, size=40,shape=1,icon="drought", unlock={'drought_l'}},
{name='drought_l', x=-600, y=0, size=40,shape=1,icon="mess"}, {name='drought_l', x=-600, y=0, size=40,shape=1,icon="mess"},
{name='dig_10l', x=-200, y=-400, size=40,shape=1,icon="dig_sprint", unlock={'dig_40l'}}, {name='dig_10l', x=-200, y=-400, size=40,shape=1,icon="dig_sprint",unlock={'dig_40l'}},
{name='dig_40l', x=-400, y=-400, size=40,shape=1,icon="dig_sprint", unlock={'dig_100l'}}, {name='dig_40l', x=-400, y=-400, size=40,shape=1,icon="dig_sprint",unlock={'dig_100l'}},
{name='dig_100l', x=-600, y=-400, size=40,shape=1,icon="dig_sprint", unlock={'dig_400l'}}, {name='dig_100l', x=-600, y=-400, size=40,shape=1,icon="dig_sprint",unlock={'dig_400l'}},
{name='dig_400l', x=-800, y=-200, size=40,shape=1,icon="dig_sprint"}, {name='dig_400l', x=-800, y=-200, size=40,shape=1,icon="dig_sprint"},
{name='marathon_n', x=0, y=-600, size=60,shape=1,icon="marathon",unlock={'marathon_h','rhythm_e','solo_e','round_e','blind_e','classic_fast','survivor_e','bigbang','zen'}}, {name='marathon_n', x=0, y=-600, size=60,shape=1,icon="marathon",unlock={'marathon_h','rhythm_e','solo_e','round_e','blind_e','classic_fast','survivor_e','bigbang','zen'}},
@@ -74,7 +74,7 @@ return{
{name='dig_u', x=700, y=-1000,size=40,shape=1,icon="dig"}, {name='dig_u', x=700, y=-1000,size=40,shape=1,icon="dig"},
{name='bigbang', x=400, y=-400, size=50,shape=1,icon="bigbang", unlock={'c4wtrain_n','pctrain_n','tech_n'}}, {name='bigbang', x=400, y=-400, size=50,shape=1,icon="bigbang", unlock={'c4wtrain_n','pctrain_n','tech_n'}},
{name='c4wtrain_n', x=700, y=-400, size=40,shape=1,icon="pc",unlock={'c4wtrain_l'}}, {name='c4wtrain_n', x=700, y=-400, size=40,shape=1,icon="pc", unlock={'c4wtrain_l'}},
{name='c4wtrain_l', x=900, y=-400, size=40,shape=1,icon="pc"}, {name='c4wtrain_l', x=900, y=-400, size=40,shape=1,icon="pc"},
{name='pctrain_n', x=700, y=-250, size=40,shape=1,icon="pc", unlock={'pctrain_l','pc_n'}}, {name='pctrain_n', x=700, y=-250, size=40,shape=1,icon="pc", unlock={'pctrain_l','pc_n'}},

View File

@@ -584,18 +584,19 @@ function Player:resetBlock()--Reset Block's position and execute I*S
end end
function Player:spin(d,ifpre) function Player:spin(d,ifpre)
local kickData=self.RS[self.cur.id] local cur=self.cur
local kickData=self.RS[cur.id]
if type(kickData)=='table'then if type(kickData)=='table'then
local idir=(self.cur.dir+d)%4 local idir=(cur.dir+d)%4
kickData=kickData[self.cur.dir*10+idir] kickData=kickData[cur.dir*10+idir]
if not kickData then if not kickData then
self:freshBlock('move') self:freshBlock('move')
SFX.play(ifpre and'prerotate'or'rotate',nil,self:getCenterX()*.15) SFX.play(ifpre and'prerotate'or'rotate',nil,self:getCenterX()*.15)
return return
end end
local icb=BLOCKS[self.cur.id][idir] local icb=BLOCKS[cur.id][idir]
local isc=SCS[self.cur.id][idir] local isc=SCS[cur.id][idir]
local ix,iy=self.curX+self.cur.sc[2]-isc[2],self.curY+self.cur.sc[1]-isc[1] local ix,iy=self.curX+cur.sc[2]-isc[2],self.curY+cur.sc[1]-isc[1]
for test=1,#kickData do for test=1,#kickData do
local x,y=ix+kickData[test][1],iy+kickData[test][2] local x,y=ix+kickData[test][1],iy+kickData[test][2]
if not self:ifoverlap(icb,x,y)and(self.freshTime>0 or kickData[test][2]<=0)then if not self:ifoverlap(icb,x,y)and(self.freshTime>0 or kickData[test][2]<=0)then
@@ -603,8 +604,8 @@ function Player:spin(d,ifpre)
if self.gameEnv.moveFX and self.gameEnv.block then if self.gameEnv.moveFX and self.gameEnv.block then
self:createMoveFX() self:createMoveFX()
end end
self.curX,self.curY,self.cur.dir=ix,iy,idir self.curX,self.curY,cur.dir=ix,iy,idir
self.cur.sc,self.cur.bk=isc,icb cur.sc,cur.bk=isc,icb
self.spinLast=test==2 and 0 or 1 self.spinLast=test==2 and 0 or 1
local t=self.freshTime local t=self.freshTime