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

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

@@ -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