From 1f7e61911f62d2cb07d1c4ec36700fb5b46a28a2 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 26 Jun 2016 20:34:10 +0200 Subject: Scaling --- main.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 92d53b8..d5552d0 100644 --- a/main.lua +++ b/main.lua @@ -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 -- cgit v1.1