From 5b69916da9b58818da16841a0213716c55b3f07a Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 21 Sep 2017 17:51:03 +0200 Subject: Debug drawing for Traps --- not/PhysicalBody.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'not') 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())) -- cgit v1.1