全局变量spinCenters改名SCS
This commit is contained in:
@@ -516,7 +516,7 @@ function love.run()
|
||||
local R=int((t+1)/2)%7+1
|
||||
_=SKIN.libColor[SETTING.skin[R]]
|
||||
gc_setColor(_[1],_[2],_[3],min(abs(1-t%2),.3))
|
||||
_=spinCenters[R][0]
|
||||
_=SCS[R][0]
|
||||
gc_draw(TEXTURE.miniBlock[R],mx,my,t%3.14159265359*4,16,16,_[2]+.5,#BLOCKS[R][0]-_[1]-.5)
|
||||
gc_setColor(1,1,1)
|
||||
gc_draw(TEXTURE.cursor,mx,my,nil,nil,nil,6,6)
|
||||
|
||||
@@ -79,7 +79,7 @@ if _CC then
|
||||
P.holdTime=P.gameEnv.holdCount
|
||||
|
||||
P.cur=rem(P.nextQueue,1)
|
||||
P.cur.sc,P.cur.dir=spinCenters[P.cur.id][0],0--TODO
|
||||
P.cur.sc,P.cur.dir=SCS[P.cur.id][0],0--TODO
|
||||
P.curX,P.curY=blockPos[P.cur.id],21+ceil(P.fieldBeneath/30)-#P.cur.bk+min(int(#P.field*.2),2)
|
||||
|
||||
P:newNext()
|
||||
|
||||
@@ -10,7 +10,7 @@ local scs
|
||||
function back.init()
|
||||
colorLib=SKIN.libColor
|
||||
blocks=BLOCKS
|
||||
scs=spinCenters
|
||||
scs=SCS
|
||||
t=rnd()*2600
|
||||
end
|
||||
function back.update(dt)
|
||||
|
||||
@@ -142,7 +142,7 @@ do
|
||||
C.id=id
|
||||
C.bk=bk
|
||||
P.curX,P.curY=x,y
|
||||
P.cur.dir,P.cur.sc=dir,spinCenters[id][dir]
|
||||
P.cur.dir,P.cur.sc=dir,SCS[id][dir]
|
||||
P.spinLast=2
|
||||
P.stat.rotate=P.stat.rotate+1
|
||||
P:freshBlock("move")
|
||||
|
||||
@@ -181,14 +181,14 @@ do--drawableText
|
||||
}
|
||||
end
|
||||
|
||||
do--spinCenters
|
||||
do--SCS(spinCenters)
|
||||
local N1,N2,N3,N4={0,1},{1,0},{1,1},{.5,.5}
|
||||
local I1,I2,I3,I4={-.5,1.5},{1.5,-.5},{.5,1.5},{1.5,.5}
|
||||
local V4={1.5,1.5}
|
||||
local L1,L2={0,2},{2,0}
|
||||
local S1,S2={-.5,.5},{.5,-.5}
|
||||
local D={0,0}
|
||||
spinCenters={
|
||||
SCS={
|
||||
--Tetramino
|
||||
{[0]=N1,N2,N3,N3},--Z
|
||||
{[0]=N1,N2,N3,N3},--S
|
||||
|
||||
@@ -10,7 +10,6 @@ local ins,rem=table.insert,table.remove
|
||||
local ct=coroutine
|
||||
|
||||
local kickList=require"parts/kickList"
|
||||
local scs=spinCenters
|
||||
|
||||
--------------------------<FX>--------------------------
|
||||
function Player.showText(P,text,dx,dy,font,style,spd,stop)
|
||||
@@ -580,7 +579,7 @@ function Player.spin(P,d,ifpre)
|
||||
if type(iki)=="table"then
|
||||
local idir=(P.cur.dir+d)%4
|
||||
local icb=BLOCKS[P.cur.id][idir]
|
||||
local isc=scs[P.cur.id][idir]
|
||||
local isc=SCS[P.cur.id][idir]
|
||||
local ix,iy=P.curX+P.cur.sc[2]-isc[2],P.curY+P.cur.sc[1]-isc[1]
|
||||
iki=iki[P.cur.dir*10+idir]
|
||||
for test=1,#iki do
|
||||
@@ -677,7 +676,7 @@ function Player.getBlock(P,n)--Get a block(id=n) object
|
||||
return{
|
||||
id=n,
|
||||
bk=BLOCKS[n][dir],
|
||||
sc=scs[n][dir],
|
||||
sc=SCS[n][dir],
|
||||
dir=dir,
|
||||
name=n,
|
||||
color=E.bone and 17 or E.skin[n],
|
||||
@@ -689,7 +688,7 @@ function Player.getNext(P,n)--Push a block(id=n) to nextQueue
|
||||
ins(P.nextQueue,{
|
||||
id=n,
|
||||
bk=BLOCKS[n][dir],
|
||||
sc=scs[n][dir],
|
||||
sc=SCS[n][dir],
|
||||
dir=dir,
|
||||
name=n,
|
||||
color=E.bone and 17 or E.skin[n],
|
||||
|
||||
@@ -208,7 +208,7 @@ function scene.draw()
|
||||
local r=TIME()*2
|
||||
local R=int(r)%7+1
|
||||
gc.setColor(1,1,1,1-abs(r%1*2-1))
|
||||
gc.draw(TEXTURE.miniBlock[R],785,140,TIME()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
|
||||
gc.draw(TEXTURE.miniBlock[R],785,140,TIME()*10%6.2832,15,15,SCS[R][0][2]+.5,#BLOCKS[R][0]-SCS[R][0][1]-.5)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ function scene.draw()
|
||||
gc.rotate(SETTING.face[N]*1.57+sin(t*3-N*.5)*.08)
|
||||
local color=SETTING.skin[N]
|
||||
local B=BLOCKS[N][0]
|
||||
local x,y=-45-spinCenters[N][0][2]*30,15+spinCenters[N][0][1]*30
|
||||
local x,y=-45-SCS[N][0][2]*30,15+SCS[N][0][1]*30
|
||||
local col=#B[1]
|
||||
for i=1,#B do for j=1,col do
|
||||
if B[i][j]then
|
||||
|
||||
@@ -92,8 +92,8 @@ function scene.draw()
|
||||
local r=t*2
|
||||
local R=int(r)%7+1
|
||||
gc.setColor(1,1,1,1-abs(r%1*2-1))
|
||||
gc.draw(TEXTURE.miniBlock[R],680,50,t*10%6.2832,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
|
||||
gc.draw(TEXTURE.miniBlock[R],680,300,0,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
|
||||
gc.draw(TEXTURE.miniBlock[R],680,50,t*10%6.2832,15,15,SCS[R][0][2]+.5,#BLOCKS[R][0]-SCS[R][0][1]-.5)
|
||||
gc.draw(TEXTURE.miniBlock[R],680,300,0,15,15,SCS[R][0][2]+.5,#BLOCKS[R][0]-SCS[R][0][1]-.5)
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
|
||||
Reference in New Issue
Block a user