summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-21 17:51:03 +0200
committerAki <nthirtyone@gmail.com>2017-09-21 17:51:03 +0200
commit5b69916da9b58818da16841a0213716c55b3f07a (patch)
treedf83827a14e44ae538ff34a84672ceca90432e9c
parent99a968d29f580aabc5350e608e545f9162458f0e (diff)
downloadroflnauts-5b69916da9b58818da16841a0213716c55b3f07a.zip
roflnauts-5b69916da9b58818da16841a0213716c55b3f07a.tar.gz
roflnauts-5b69916da9b58818da16841a0213716c55b3f07a.tar.bz2
Debug drawing for Traps
-rw-r--r--not/PhysicalBody.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua
index 01a725b..5081836 100644
--- a/not/PhysicalBody.lua
+++ b/not/PhysicalBody.lua
@@ -62,20 +62,27 @@ function PhysicalBody:update (dt)
PhysicalBody.__super.update(self, dt)
end
--- Draw of `PhysicalBody`.
function PhysicalBody:draw (debug)
PhysicalBody.__super.draw(self, debug)
if debug then
for _,fixture in pairs(self.body:getFixtureList()) do
local category = fixture:getCategory()
+ -- TODO: Fixture drawing of PhysicalBodies could take activity into account in every case.
if category == 1 then
- love.graphics.setColor(255, 69, 0, 140)
+ love.graphics.setColor(255, 69, 0, 150)
end
if category == 2 then
- love.graphics.setColor(137, 255, 0, 120)
+ love.graphics.setColor(137, 255, 0, 150)
end
if category == 3 then
- love.graphics.setColor(137, 0, 255, 40)
+ love.graphics.setColor(137, 0, 255, 50)
+ end
+ if category == 4 then
+ if self.body:isActive() then
+ love.graphics.setColor(255, 230, 0, 50)
+ else
+ love.graphics.setColor(255, 230, 0, 10)
+ end
end
local camera = self.world.camera
love.graphics.polygon("fill", self.body:getWorldPoints(fixture:getShape():getPoints()))