修复暂停后回放操作被打断

This commit is contained in:
MrZ626
2021-07-10 16:46:52 +08:00
parent bbf46a0d6d
commit 3b56679a32

View File

@@ -19,15 +19,13 @@ local function _step()floatRepRate=floatRepRate+1 end
local scene={} local scene={}
function scene.sceneInit(org) function scene.sceneInit()
if GAME.init then if GAME.init then
resetGameData() resetGameData()
GAME.init=false GAME.init=false
end
replaying=GAME.replaying
if org~='pause'then
floatRepRate,replayRate=0,1 floatRepRate,replayRate=0,1
end end
replaying=GAME.replaying
noKey=replaying noKey=replaying
noTouch=not SETTING.VKSwitch or noKey noTouch=not SETTING.VKSwitch or noKey
WIDGET.active.restart.hide=replaying WIDGET.active.restart.hide=replaying
@@ -40,7 +38,7 @@ scene.mouseDown=NULL
local function restart() local function restart()
resetGameData(PLAYERS[1].frameRun<240 and'q') resetGameData(PLAYERS[1].frameRun<240 and'q')
noKey=replaying noKey=replaying
noTouch=noKey noTouch=replaying
end end
function scene.touchDown(x,y) function scene.touchDown(x,y)
if noTouch then return end if noTouch then return end
@@ -176,7 +174,7 @@ local function update_common(dt)
checkWarning() checkWarning()
end end
function scene.update(dt) function scene.update(dt)
local repPtr=replaying local repPtr=GAME.replaying
if repPtr then if repPtr then
floatRepRate=floatRepRate+replayRate floatRepRate=floatRepRate+replayRate
while floatRepRate>=1 do while floatRepRate>=1 do
@@ -196,7 +194,7 @@ function scene.update(dt)
end end
repPtr=repPtr+2 repPtr=repPtr+2
end end
replaying=repPtr GAME.replaying=repPtr
end end
update_common(dt) update_common(dt)
end end