From 7e7e5737d25134733dbd16805aef9c1f396d6ec0 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 14 Jan 2017 18:19:50 +0100 Subject: Adjusted sizes for temporary fixtures; made debug more transparent --- player.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/player.lua b/player.lua index 1818e48..1fad1e3 100644 --- a/player.lua +++ b/player.lua @@ -72,11 +72,19 @@ function Player:new (game, world, x, y, name) o.current = o.animations.idle o:createEffect("respawn") -- New punch mechanics - o.hitbox_fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(6,-6,20,-6,20,6,6,6), 0) + o.hitbox_fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(0,-6,20,-6,20,6,0,6), 0) o.hitbox_fixture:setSensor(true) o.hitbox_fixture:setCategory(3) o.hitbox_fixture:setMask(1) - local fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(-6,-6,-20,-6,-20,6,-6,6), 0) + local fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(0,-6,-20,-6,-20,6,0,6), 0) + fixture:setSensor(true) + fixture:setCategory(3) + fixture:setMask(1) + local fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(-8,0,-8,-20,8,-20,8,0), 0) + fixture:setSensor(true) + fixture:setCategory(3) + fixture:setMask(1) + local fixture = love.physics.newFixture(o.body, love.physics.newPolygonShape(-8,0,-8,20,8,20,8,0), 0) fixture:setSensor(true) fixture:setCategory(3) fixture:setMask(1) @@ -318,9 +326,9 @@ function Player:draw(offset_x, offset_y, scale, debug) if debug then for _,fixture in pairs(self.body:getFixtureList()) do if fixture:getCategory() == 2 then - love.graphics.setColor(137, 255, 0, 140) + love.graphics.setColor(137, 255, 0, 120) else - love.graphics.setColor(137, 0, 255, 100) + love.graphics.setColor(137, 0, 255, 40) end love.graphics.polygon("fill", self.world.camera:translatePoints(self.body:getWorldPoints(fixture:getShape():getPoints()))) end -- cgit v1.1