summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-24 00:43:10 +0200
committerAki <nthirtyone@gmail.com>2016-05-24 00:43:10 +0200
commitf600564657dc5a8a4f36043c46e7a34651d0c4a5 (patch)
tree7396ff51570c9fc924f6ae812d6f91a6359049e0
parent5f8c2f891d029ccce51a92eef2f11ab2115342f7 (diff)
downloadroflnauts-f600564657dc5a8a4f36043c46e7a34651d0c4a5.zip
roflnauts-f600564657dc5a8a4f36043c46e7a34651d0c4a5.tar.gz
roflnauts-f600564657dc5a8a4f36043c46e7a34651d0c4a5.tar.bz2
#14 Camera hotfix -- left for now
-rw-r--r--camera.lua7
-rw-r--r--conf.lua5
-rw-r--r--maps/default.lua2
3 files changed, 7 insertions, 7 deletions
diff --git a/camera.lua b/camera.lua
index 9c594fb..b33313c 100644
--- a/camera.lua
+++ b/camera.lua
@@ -7,7 +7,7 @@ Camera = {
y = 0,
dest_x = 0,
dest_y = 0,
- scale = 2,
+ scale = 4,
shake = 0,
timer = 0,
delay = 0,
@@ -112,7 +112,6 @@ 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
@@ -122,7 +121,7 @@ function Camera:follow ()
end
end
x = x / i - love.graphics.getWidth()/self.scale/2
- y = y / i - (love.graphics.getHeight()/2)/self.scale
+ y = y / i - love.graphics.getHeight()/self.scale/2 + 10*self.scale -- hotfix
return x,y
end
@@ -137,7 +136,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
diff --git a/conf.lua b/conf.lua
index 4d9f961..83175f0 100644
--- a/conf.lua
+++ b/conf.lua
@@ -1,8 +1,9 @@
+-- Game configuration
function love.conf(t)
t.title = "notnauts"
t.version = "0.10.1"
t.window.icon = "assets/icon.png"
- t.window.width = 290*2
- t.window.height = 180*2
+ t.window.width = 290*4
+ t.window.height = 180*4
t.console = true
end \ No newline at end of file
diff --git a/maps/default.lua b/maps/default.lua
index 584220a..a2d5275 100644
--- a/maps/default.lua
+++ b/maps/default.lua
@@ -1,7 +1,7 @@
-- Default map from original roflnauts
return {
center_x = 0,
- center_y = 60,
+ center_y = 0,
width = 320,
height = 240,
color_top = {193, 100, 99, 255},