diff options
author | Aki <nthirtyone@gmail.com> | 2016-05-24 00:16:52 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-05-24 00:16:52 +0200 |
commit | 5f8c2f891d029ccce51a92eef2f11ab2115342f7 (patch) | |
tree | cf5864fb12b3e50e27e83b55996f4141e58008f5 | |
parent | 227f6693728b777da1b4ec015087e187ace1fe8f (diff) | |
download | roflnauts-5f8c2f891d029ccce51a92eef2f11ab2115342f7.zip roflnauts-5f8c2f891d029ccce51a92eef2f11ab2115342f7.tar.gz roflnauts-5f8c2f891d029ccce51a92eef2f11ab2115342f7.tar.bz2 |
Fighting with camera
-rw-r--r-- | camera.lua | 7 | ||||
-rw-r--r-- | conf.lua | 4 |
2 files changed, 6 insertions, 5 deletions
@@ -7,7 +7,7 @@ Camera = { y = 0, dest_x = 0, dest_y = 0, - scale = 4, + scale = 2, shake = 0, timer = 0, delay = 0, @@ -112,6 +112,7 @@ end function Camera:follow () local m = self.world.map local x,y,i = m.center_x, m.center_y, 1 + print(x,y, love.graphics.getHeight(), self.scale, (love.graphics.getHeight()/2)/self.scale) for k,point in pairs(self.world.Nauts) do if point.body:getX() > m.center_x - m.width/2 and point.body:getX() < m.center_x + m.width/2 and point.body:getY() > m.center_y - m.height/2 and point.body:getY() < m.center_y + m.height/2 then @@ -121,7 +122,7 @@ function Camera:follow () end end x = x / i - love.graphics.getWidth()/self.scale/2 - y = y / i - love.graphics.getHeight()/self.scale/2 + y = y / i - (love.graphics.getHeight()/2)/self.scale return x,y end @@ -136,7 +137,7 @@ function Camera:update (dt) self.delay = self.delay - dt end else - self:setDestination(self:follow()) + --self:setDestination(self:follow()) end local dx, dy = self:getDestination() dx = (dx - self.x) * 6 * dt @@ -2,7 +2,7 @@ function love.conf(t) t.title = "notnauts" t.version = "0.10.1" t.window.icon = "assets/icon.png" - t.window.width = 290*4 - t.window.height = 180*4 + t.window.width = 290*2 + t.window.height = 180*2 t.console = true end
\ No newline at end of file |