From 4fc7dd447ef757a4952a51498b476e226c382064 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 24 Sep 2021 00:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=A4=E5=A4=84=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=90=8D=EF=BC=8C=E2=80=9C=E7=B4=AF=E8=AE=A1=E5=80=BC?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E8=BF=9B=E8=A1=8C=E8=8B=A5=E5=B9=B2=E6=AC=A1?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E2=80=9D=E7=9A=84=E5=8F=98=E9=87=8F=E4=BD=BF?= =?UTF-8?q?=E7=94=A8trigXXX=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/wheelScroll.lua | 16 ++++++++-------- parts/scenes/game.lua | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Zframework/wheelScroll.lua b/Zframework/wheelScroll.lua index d1062ccf..1374c654 100644 --- a/Zframework/wheelScroll.lua +++ b/Zframework/wheelScroll.lua @@ -1,19 +1,19 @@ local love=love local max,min=math.max,math.min -local float=0 +local trigDist=0 return function(y,key1,key2) if y>0 then - float=max(float,0)+y^1.2 + trigDist=max(trigDist,0)+y^1.2 elseif y<0 then - if float>0 then float=0 end - float=min(float,0)-(-y)^1.2 + if trigDist>0 then trigDist=0 end + trigDist=min(trigDist,0)-(-y)^1.2 end - while float>=1 do + while trigDist>=1 do love.keypressed(key1 or"up") - float=float-1 + trigDist=trigDist-1 end - while float<=-1 do + while trigDist<=-1 do love.keypressed(key2 or"down") - float=float+1 + trigDist=trigDist+1 end end diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index e752d8ac..002fb943 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -6,7 +6,7 @@ local PLAYERS=PLAYERS local noTouch,noKey=false,false local touchMoveLastFrame=false -local floatGameRate,gameRate +local trigGameRate,gameRate local modeTextPos local replaying @@ -101,13 +101,13 @@ local function _rep5() gameRate=5 _updateRepButtons() end -local function _step()floatGameRate=floatGameRate+1 end +local function _step()trigGameRate=trigGameRate+1 end local function _restart() resetGameData(PLAYERS[1].frameRun<240 and'q') noKey=replaying noTouch=replaying - floatGameRate,gameRate=0,1 + trigGameRate,gameRate=0,1 _updateRepButtons() end local function _checkGameKeyDown(key) @@ -137,12 +137,12 @@ function scene.sceneInit(org) noTouch=not SETTING.VKSwitch or replaying if org~='depause'and org~='pause'then - floatGameRate,gameRate=0,1 + trigGameRate,gameRate=0,1 elseif not replaying then if GAME.tasUsed then - floatGameRate,gameRate=0,0 + trigGameRate,gameRate=0,0 else - floatGameRate,gameRate=0,1 + trigGameRate,gameRate=0,1 end end @@ -309,9 +309,9 @@ local function _update_common(dt) checkWarning() end function scene.update(dt) - floatGameRate=floatGameRate+gameRate - while floatGameRate>=1 do - floatGameRate=floatGameRate-1 + trigGameRate=trigGameRate+gameRate + while trigGameRate>=1 do + trigGameRate=trigGameRate-1 if GAME.replaying then _update_replay(GAME.replaying) end