summaryrefslogtreecommitdiffhomepage
path: root/not/Camera.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/Camera.lua')
-rw-r--r--not/Camera.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/not/Camera.lua b/not/Camera.lua
index 025e9e5..4f57327 100644
--- a/not/Camera.lua
+++ b/not/Camera.lua
@@ -22,9 +22,15 @@ function Camera:initShake ()
end
-- TODO: Even more magic numbers present in Camera. Translate method.
-function Camera:translate ()
+function Camera:translate (ratio)
local x, y = self:getPositionScaled()
local dx, dy = self:getShakeScaled()
+ if ratio then
+ dx = dx * ratio
+ dy = dy * ratio
+ x = x * ratio
+ y = y * ratio
+ end
love.graphics.push()
love.graphics.translate(160*getScale() - x - dx, 100*getScale() - y - dy)
end