summaryrefslogtreecommitdiffhomepage
path: root/camera.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-13 21:39:50 +0200
committerAki <nthirtyone@gmail.com>2016-05-13 21:39:50 +0200
commit8d51222d41a348867706ceaec80d36e017a8d7ab (patch)
tree60a17c31c7f08505def499c2aaa57ce3c241b213 /camera.lua
parent6c1b6bdb22449c15450bd61cb1bf75a323cb40b9 (diff)
downloadroflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.zip
roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.gz
roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.bz2
Scaling
Diffstat (limited to 'camera.lua')
-rw-r--r--camera.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/camera.lua b/camera.lua
index 793b0d1..2893409 100644
--- a/camera.lua
+++ b/camera.lua
@@ -5,6 +5,7 @@
Camera = {
x = 0,
y = 0,
+ scale = 4,
follow = nil
}
@@ -39,11 +40,11 @@ end
-- Move follow
function Camera:moveFollow ()
- local x,y,i = 145, 90, 1
+ local x,y,i = 145, 120, 1
for k,point in pairs(Nauts) do
i = i + 1
x = math.max(math.min(point.body:getX(),290),0) + x
- y = math.max(math.min(point.body:getY(),180),0) + y
+ y = math.max(math.min(point.body:getY(),180),20) + y
end
x = x / i - 145
y = y / i - 90