玩家出场动画加速

This commit is contained in:
MrZ626
2020-12-19 16:01:37 +08:00
parent d4a23ee68c
commit 1f5698ce15

View File

@@ -6,7 +6,6 @@ local Player={}--Player class
local int,ceil,rnd=math.floor,math.ceil,math.random local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min=math.max,math.min local max,min=math.max,math.min
local lg=math.log10
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local ct=coroutine local ct=coroutine
@@ -154,15 +153,13 @@ local function task_movePosition(P,x,y,size)
local x1,y1,size1=P.x,P.y,P.size local x1,y1,size1=P.x,P.y,P.size
while true do while true do
coroutine.yield() coroutine.yield()
local d=((x1-x)^2+(y1-y)^2)^.5 if (x1-x)^2+(y1-y)^2<1 then
if d<.626 then
P:setPosition(x,y,size) P:setPosition(x,y,size)
return true return true
else else
d=max(.085-lg(d)*.02,.03) x1=x1+(x-x1)*.126
x1=x1+(x-x1)*d y1=y1+(y-y1)*.126
y1=y1+(y-y1)*d size1=size1+(size-size1)*.126
size1=size1+(size-size1)*d
P:setPosition(x1,y1,size1) P:setPosition(x1,y1,size1)
end end
end end
@@ -1279,7 +1276,7 @@ do--Player.drop(P)--Place piece
cscore=int(cscore) cscore=int(cscore)
if ENV.score then if ENV.score then
P:showText(cscore,(P.curX+P.sc[2]-5.5)*30,(10-P.curY-P.sc[1])*30+P.fieldBeneath+P.fieldUp,int(8-120/(cscore+20))*5,"score",2) P:showText(cscore,(P.curX+P.sc[2]-5.5)*30,(10-P.curY-P.sc[1])*30+P.fieldBeneath+P.fieldUp,40-600/(cscore+20),"score",2)
end end
piece.row,piece.dig=cc,gbcc piece.row,piece.dig=cc,gbcc