mirror of
https://github.com/vrld/hump.git
synced 2024-10-15 09:04:18 +00:00
Fix #57: remove writing to global variable in smooth.linear
This commit is contained in:
parent
2cf3f19ff0
commit
2de9a30153
@ -42,7 +42,7 @@ function camera.smooth.linear(speed)
|
||||
return function(dx,dy, s)
|
||||
-- normalize direction
|
||||
local d = math.sqrt(dx*dx+dy*dy)
|
||||
dts = math.min((s or speed) * love.timer.getDelta(), d) -- prevent overshooting the goal
|
||||
local dts = math.min((s or speed) * love.timer.getDelta(), d) -- prevent overshooting the goal
|
||||
if d > 0 then
|
||||
dx,dy = dx/d, dy/d
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user