summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-06 02:57:06 +0200
committerAki <nthirtyone@gmail.com>2017-09-06 02:57:06 +0200
commit234adbc1468d75f829c8d8bfd0345fe0c16a6360 (patch)
tree0b7ca83ccbb1135095949d5c2c8e1289f19e65ed
parent53763cd13314152117a7e29712de81e2bfafee18 (diff)
downloadroflnauts-234adbc1468d75f829c8d8bfd0345fe0c16a6360.zip
roflnauts-234adbc1468d75f829c8d8bfd0345fe0c16a6360.tar.gz
roflnauts-234adbc1468d75f829c8d8bfd0345fe0c16a6360.tar.bz2
Some additional info dislayed in debug mode
-rw-r--r--main.lua12
-rw-r--r--not/World.lua3
2 files changed, 12 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index ac04383..a71b9e2 100644
--- a/main.lua
+++ b/main.lua
@@ -47,12 +47,18 @@ function love.draw ()
love.graphics.setFont(Font)
love.graphics.setColor(255, 0, 0, 255)
love.graphics.print("Debug ON", 10, 10, 0, scale, scale)
- love.graphics.setColor(255, 255, 255, 255)
- love.graphics.print("Current FPS: "..tostring(love.timer.getFPS()), 10, 10+9*scale, 0, scale, scale)
+ if dbg_msg then
+ love.graphics.setColor(255, 255, 255, 255)
+ love.graphics.print(dbg_msg, 10, 10+9*scale, 0, scale, scale)
+ end
end
end
-function love.update (dt) sceneManager:update(dt) end
+function love.update (dt)
+ dbg_msg = string.format("FPS: %d\n", love.timer.getFPS())
+ sceneManager:update(dt)
+end
+
function love.quit () Settings.save() end
-- Pass input to Controller
diff --git a/not/World.lua b/not/World.lua
index 62988ae..ebc7d9f 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -205,6 +205,9 @@ function World:update (dt)
table.remove(self.Rays, key)
end
end
+
+ -- Some additional debug info.
+ dbg_msg = string.format("%sMap: %s\nClouds: %d\n", dbg_msg, self.map.filepath, self:getCloudsCount())
end
-- Draw