summaryrefslogtreecommitdiffhomepage
path: root/not/PhysicalBody.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-21 21:05:37 +0200
committerAki <nthirtyone@gmail.com>2017-09-21 21:05:37 +0200
commite9a450d65d4fb564691cdf651ef5771dd88303ae (patch)
treef49d29582dd6877f3b3c807c3f7d9d92d368f798 /not/PhysicalBody.lua
parenteb8302723cd85adca0fbaf505cfb315f1db0299a (diff)
parentb97985def64b8bd8f93a7b391b12333595432e52 (diff)
downloadroflnauts-e9a450d65d4fb564691cdf651ef5771dd88303ae.zip
roflnauts-e9a450d65d4fb564691cdf651ef5771dd88303ae.tar.gz
roflnauts-e9a450d65d4fb564691cdf651ef5771dd88303ae.tar.bz2
Merge branch 'maps'
Diffstat (limited to 'not/PhysicalBody.lua')
-rw-r--r--not/PhysicalBody.lua22
1 files changed, 15 insertions, 7 deletions
diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua
index 804c706..5081836 100644
--- a/not/PhysicalBody.lua
+++ b/not/PhysicalBody.lua
@@ -62,22 +62,30 @@ function PhysicalBody:update (dt)
PhysicalBody.__super.update(self, dt)
end
--- Draw of `PhysicalBody`.
-function PhysicalBody:draw (offset_x, offset_y, scale, debug)
- PhysicalBody.__super.draw(self, offset_x, offset_y, scale)
+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
- love.graphics.polygon("fill", self.world.camera:translatePoints(self.body:getWorldPoints(fixture:getShape():getPoints())))
+ 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()))
end
end
end