软降不再使场地旋转,修复旋转系统的错误修改,整理代码

This commit is contained in:
MrZ626
2021-03-25 20:49:00 +08:00
parent 1f115e6836
commit 8de29b0a90
3 changed files with 7 additions and 9 deletions

View File

@@ -131,12 +131,11 @@ do
local x,y=P.curX,P.curY
if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then
if P.sound then SFX.play("rotatekick",nil,P:getCenterX()*.15)end
local D=P.spinSeq%100*10+d
P.spinSeq=D
if D<100 then return end
P.spinSeq=P.spinSeq%100*10+d
if P.spinSeq<100 then return end
for i=1,#OspinList do
local L=OspinList[i]
if D==L[1]then
if P.spinSeq==L[1]then
local id,dir=L[2],L[3]
local bk=BLOCKS[id][dir]
x,y=P.curX+L[4],P.curY+L[5]

View File

@@ -5,7 +5,7 @@
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 max,min,modf=math.max,math.min,math.modf
local ins,rem=table.insert,table.remove
local resume,yield=coroutine.resume,coroutine.yield
@@ -613,8 +613,8 @@ function Player.spin(P,d,ifpre)
sfx="prerotate"
elseif P:ifoverlap(icb,ix,iy+1)and P:ifoverlap(icb,ix-1,iy)and P:ifoverlap(icb,ix+1,iy)then
sfx="rotatekick"
if abs(d)==1 then
P.fieldOff.va=P.fieldOff.va+d*P.gameEnv.shakeFX*6e-3
if d==1 or d==3 then
P.fieldOff.va=P.fieldOff.va+(2-d)*P.gameEnv.shakeFX*6e-3
else
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*3e-3
end
@@ -1889,7 +1889,7 @@ end
function Player.act_rotLeft(P)
if P.control and P.waiting==-1 and P.cur then
P.ctrlCount=P.ctrlCount+1
P:spin(-1)
P:spin(3)
P.keyPressing[4]=false
end
end

View File

@@ -253,7 +253,6 @@ function update.alive(P,dt)
end
if ENV.shakeFX then
P.fieldOff.vy=ENV.shakeFX*.2
P.fieldOff.va=P.fieldOff.va+P:getCenterX()*P.gameEnv.shakeFX*4e-5
end
end
else