调整远程玩家加速速率,远程玩家时间显示暂时改为运行帧数/60

This commit is contained in:
MrZ626
2021-06-09 14:53:41 +08:00
parent 5b57c84034
commit 3cfa230d2b

View File

@@ -1,5 +1,5 @@
local max,min=math.max,math.min
local int,abs,rnd=math.floor,math.abs,math.random
local int,abs=math.floor,math.abs
local rem=table.remove
local assert,resume,status=assert,coroutine.resume,coroutine.status
@@ -411,13 +411,12 @@ end
function update.remote_alive(P,dt)
local frameRate=(P.stream[#P.stream-1]or 0)-P.frameRun
frameRate=
frameRate<20 and 1 or
frameRate<30 and rnd(2)or
frameRate<60 and 2 or
frameRate<90 and 3 or
frameRate<26 and 1 or
frameRate<50 and 2 or
frameRate<80 and 3 or
frameRate<120 and 5 or
frameRate<150 and 7 or
frameRate<180 and 10 or
frameRate<160 and 7 or
frameRate<200 and 10 or
20
for _=1,frameRate do
local eventTime=P.stream[P.streamProgress]
@@ -460,6 +459,7 @@ function update.remote_alive(P,dt)
P.streamProgress=P.streamProgress+2
else--No event now, run one frame
update.alive(P,dt/frameRate)
P.stat.time=P.frameRun/60
end
else--Pause state, no actions, quit loop
break