大量指数接近动画改为基于时间而不是帧

This commit is contained in:
MrZ626
2021-12-22 02:19:42 +08:00
parent 20a1d2bcc1
commit a8628275a0
13 changed files with 49 additions and 39 deletions

View File

@@ -174,7 +174,7 @@ function scene.update(dt)
end
end
life1=life1*.7+life*.3
life1=MATH.expApproach(life1,life,dt*16)
if play then
if inv>0 then

View File

@@ -280,13 +280,13 @@ function scene.touchDown(x)
end
end
function scene.update()
function scene.update(dt)
if state==1 then
local t=TIME()
time=t-startTime
local v=0
for i=2,20 do v=v+i*(i-1)*.3/(t-keyTime[i])end
speed=speed*.99+v*.01
speed=MATH.expApproach(speed,v,dt)
if speed>maxSpeed then maxSpeed=speed end
if arcade then

View File

@@ -31,11 +31,11 @@ function scene.keyDown(key,isRep)
end
end
function scene.update()
function scene.update(dt)
local t=TIME()
local v=0
for i=2,40 do v=v+i*(i-1)*.075/(t-keyTime[i])end
speed=speed*.99+v*.01
speed=MATH.expApproach(speed,v,dt)
if speed>maxSpeed then
maxSpeed=speed
end

View File

@@ -298,7 +298,7 @@ local function _update_common(dt)
end
--Warning check
checkWarning()
checkWarning(dt)
end
function scene.update(dt)
trigGameRate=trigGameRate+gameRate

View File

@@ -134,7 +134,7 @@ function scene.update(dt)
end
local L=scene.widgetList
for i=1,8 do
L[i].x=L[i].x*.9+(widgetX0[i]-400+(WIDGET.isFocus(L[i])and(i<5 and 100 or -100)or 0))*.1
L[i].x=MATH.expApproach(L[i].x,(widgetX0[i]-400+(WIDGET.isFocus(L[i])and(i<5 and 100 or -100)or 0)),dt*12)
end
end

View File

@@ -246,7 +246,7 @@ function scene.update(dt)
for p=1,#PLAYERS do PLAYERS[p]:update(dt)end
--Warning check
checkWarning()
checkWarning(dt)
--Upload stream
if not NET.spectate and P1.frameRun-lastUpstreamTime>8 then
@@ -265,7 +265,7 @@ function scene.update(dt)
lastUpstreamTime=PLAYERS[1].alive and P1.frameRun or 1e99
end
else
NETPLY.update()
NETPLY.update(dt)
end
if newMessageTimer>0 then
newMessageTimer=newMessageTimer-1

View File

@@ -22,9 +22,9 @@ function scene.sceneInit()
end
end
function scene.update()
function scene.update(dt)
for i=1,7 do
minoRot[i]=minoRot[i]*.8+minoRot0[i]*.2
minoRot[i]=MATH.expApproach(minoRot[i],minoRot0[i],dt*12)
end
end
function scene.draw()