diff options
author | Aki <nthirtyone@gmail.com> | 2016-06-26 20:34:10 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-06-26 20:34:10 +0200 |
commit | 1f7e61911f62d2cb07d1c4ec36700fb5b46a28a2 (patch) | |
tree | 92b1d9f0d49a066f5ca29f3b6fb492c48f2b75fa | |
parent | 75caedeaf6050620e0c33df986794559c2f49236 (diff) | |
download | roflnauts-1f7e61911f62d2cb07d1c4ec36700fb5b46a28a2.zip roflnauts-1f7e61911f62d2cb07d1c4ec36700fb5b46a28a2.tar.gz roflnauts-1f7e61911f62d2cb07d1c4ec36700fb5b46a28a2.tar.bz2 |
Scaling
-rw-r--r-- | camera.lua | 2 | ||||
-rw-r--r-- | conf.lua | 5 | ||||
-rw-r--r-- | main.lua | 19 | ||||
-rw-r--r-- | menu.lua | 2 |
4 files changed, 19 insertions, 9 deletions
@@ -7,7 +7,7 @@ Camera = { y = 0, dest_x = 0, dest_y = 0, - scale = 4, + scale = getScale(), shake = 0, timer = 0, delay = 0, @@ -2,6 +2,11 @@ function love.conf(t) t.title = "Roflnauts 2" t.version = "0.10.1" + --[[ + t.window.width = 320*3 + t.window.height = 180*3 + t.window.borderless = true + --]] t.window.fullscreentype = "desktop" t.window.fullscreen = true t.console = false @@ -1,6 +1,17 @@ -- "NOTNAUTS" -- WHOLE CODE HAS FLAG OF "need a cleanup" +-- Pretend you didn't see this +Scene = nil +function changeScene(scene) + Scene = scene +end + +function getScale() + return math.max(1, math.floor(love.graphics.getWidth() / 320)-1, math.floor(love.graphics.getHeight() / 180)-1) +end + +-- Require require "world" require "camera" require "menu" @@ -9,12 +20,6 @@ require "controller" -- Temporary debug debug = false --- Pretend you didn't see this -Scene = nil -function changeScene(scene) - Scene = scene -end - -- Load function love.load () -- Graphics @@ -99,6 +104,6 @@ end function love.draw () Scene:draw() if debug then - love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) + love.graphics.print("Current FPS: "..tostring(love.timer.getFPS()), 10, 10) end end
\ No newline at end of file @@ -15,7 +15,7 @@ Menu = { nauts = require "nautslist", portrait_sprite = nil, portrait_sheet = require "portraits", - scale = 4, + scale = getScale(), countdown = 6 } |