修改两处变量名,“累计值然后进行若干次操作”的变量使用trigXXX的格式
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user