修改两处变量名,“累计值然后进行若干次操作”的变量使用trigXXX的格式
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
local love=love
|
local love=love
|
||||||
local max,min=math.max,math.min
|
local max,min=math.max,math.min
|
||||||
local float=0
|
local trigDist=0
|
||||||
return function(y,key1,key2)
|
return function(y,key1,key2)
|
||||||
if y>0 then
|
if y>0 then
|
||||||
float=max(float,0)+y^1.2
|
trigDist=max(trigDist,0)+y^1.2
|
||||||
elseif y<0 then
|
elseif y<0 then
|
||||||
if float>0 then float=0 end
|
if trigDist>0 then trigDist=0 end
|
||||||
float=min(float,0)-(-y)^1.2
|
trigDist=min(trigDist,0)-(-y)^1.2
|
||||||
end
|
end
|
||||||
while float>=1 do
|
while trigDist>=1 do
|
||||||
love.keypressed(key1 or"up")
|
love.keypressed(key1 or"up")
|
||||||
float=float-1
|
trigDist=trigDist-1
|
||||||
end
|
end
|
||||||
while float<=-1 do
|
while trigDist<=-1 do
|
||||||
love.keypressed(key2 or"down")
|
love.keypressed(key2 or"down")
|
||||||
float=float+1
|
trigDist=trigDist+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local PLAYERS=PLAYERS
|
|||||||
|
|
||||||
local noTouch,noKey=false,false
|
local noTouch,noKey=false,false
|
||||||
local touchMoveLastFrame=false
|
local touchMoveLastFrame=false
|
||||||
local floatGameRate,gameRate
|
local trigGameRate,gameRate
|
||||||
local modeTextPos
|
local modeTextPos
|
||||||
|
|
||||||
local replaying
|
local replaying
|
||||||
@@ -101,13 +101,13 @@ local function _rep5()
|
|||||||
gameRate=5
|
gameRate=5
|
||||||
_updateRepButtons()
|
_updateRepButtons()
|
||||||
end
|
end
|
||||||
local function _step()floatGameRate=floatGameRate+1 end
|
local function _step()trigGameRate=trigGameRate+1 end
|
||||||
|
|
||||||
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=replaying
|
noTouch=replaying
|
||||||
floatGameRate,gameRate=0,1
|
trigGameRate,gameRate=0,1
|
||||||
_updateRepButtons()
|
_updateRepButtons()
|
||||||
end
|
end
|
||||||
local function _checkGameKeyDown(key)
|
local function _checkGameKeyDown(key)
|
||||||
@@ -137,12 +137,12 @@ function scene.sceneInit(org)
|
|||||||
noTouch=not SETTING.VKSwitch or replaying
|
noTouch=not SETTING.VKSwitch or replaying
|
||||||
|
|
||||||
if org~='depause'and org~='pause'then
|
if org~='depause'and org~='pause'then
|
||||||
floatGameRate,gameRate=0,1
|
trigGameRate,gameRate=0,1
|
||||||
elseif not replaying then
|
elseif not replaying then
|
||||||
if GAME.tasUsed then
|
if GAME.tasUsed then
|
||||||
floatGameRate,gameRate=0,0
|
trigGameRate,gameRate=0,0
|
||||||
else
|
else
|
||||||
floatGameRate,gameRate=0,1
|
trigGameRate,gameRate=0,1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -309,9 +309,9 @@ local function _update_common(dt)
|
|||||||
checkWarning()
|
checkWarning()
|
||||||
end
|
end
|
||||||
function scene.update(dt)
|
function scene.update(dt)
|
||||||
floatGameRate=floatGameRate+gameRate
|
trigGameRate=trigGameRate+gameRate
|
||||||
while floatGameRate>=1 do
|
while trigGameRate>=1 do
|
||||||
floatGameRate=floatGameRate-1
|
trigGameRate=trigGameRate-1
|
||||||
if GAME.replaying then
|
if GAME.replaying then
|
||||||
_update_replay(GAME.replaying)
|
_update_replay(GAME.replaying)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user