summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-01-14 18:19:50 +0100
committerAki <nthirtyone@gmail.com>2017-01-14 18:19:50 +0100
commit7e7e5737d25134733dbd16805aef9c1f396d6ec0 (patch)
tree3d755601d6774c380874d804d4afa1fb64452123
parent1b8ec8fafa84615f9a678bcdf2e9f2cee517caa6 (diff)
downloadroflnauts-7e7e5737d25134733dbd16805aef9c1f396d6ec0.zip
roflnauts-7e7e5737d25134733dbd16805aef9c1f396d6ec0.tar.gz
roflnauts-7e7e5737d25134733dbd16805aef9c1f396d6ec0.tar.bz2
Adjusted sizes for temporary fixtures; made debug more transparent
-rw-r--r--player.lua16
1 files 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