From 01eb227519733ce149035955b1f2ede80102496a Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 20 May 2016 22:40:57 +0200 Subject: Punch gravity defy changed --- main.lua | 2 +- player.lua | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/main.lua b/main.lua index 19fca2a..161c274 100644 --- a/main.lua +++ b/main.lua @@ -22,7 +22,7 @@ function love.load () w:createPlatform(290/2, 180/2, {-91,1, 90,1, 90,10, 5,76, -5,76, -91,10}, "assets/platform_big.png") w:createPlatform(290/2+140, 180/2+50, {-26,1, 26,1, 26,30, -26,30}, "assets/platform_small.png") w:createPlatform(290/2-140, 180/2+50, {-26,1, 26,1, 26,30, -26,30}, "assets/platform_small.png") - w:createPlatform(290/2, 180/2-50, {-17,1, 17,1, 17,17, -17,17}, "assets/platform_top.png") + w:createPlatform(290/2, 180/2-50, {-17,1, 17,1, 17,16, -17,16}, "assets/platform_top.png") w:createNaut(290/2-10, 180/2 - 80, "assets/leon.png") w:createNaut(290/2+10, 180/2 - 80, "assets/lonestar.png") diff --git a/player.lua b/player.lua index bb34961..83d0b30 100644 --- a/player.lua +++ b/player.lua @@ -162,11 +162,11 @@ function Player:update (dt) end -- Stop vertical - if self.punchcd > 0 then + if self.punchcd > 0.1 then if self.punchdir == 0 then self.body:setLinearVelocity(0,0) else - self.body:setLinearVelocity(25*self.facing,0) + self.body:setLinearVelocity(28*self.facing,0) end end @@ -205,7 +205,7 @@ function Player:keypressed (key) if love.keyboard.isDown(self.key_up) then -- Punch up self:changeAnimation("attack_up") - self:hit(2*f,-8,3*f,6, 0, -1) + self:hit(2*f,-10,3*f,7, 0, -1) elseif love.keyboard.isDown(self.key_down) and self.inAir then -- Punch down self:changeAnimation("attack_down") @@ -213,7 +213,8 @@ function Player:keypressed (key) else -- Punch horizontal self:changeAnimation("attack") - self:hit(3*f,-4,6*f,4, f, 0) + self:hit(2*f,-4,8*f,4, f, 0) + self.punchdir = 1 end end end @@ -264,8 +265,8 @@ end -- Spawn `Effect` relative to `Player` function Player:createEffect(name) if name == "trail" or name == "hit" then - -- 16px effect: -6 -7 - self.world:createEffect(name, self.body:getX()-6, self.body:getY()-7) + -- 16px effect: -7 -7 + self.world:createEffect(name, self.body:getX()-8, self.body:getY()-8) elseif name ~= nil then -- 24px effect: -12 -15 self.world:createEffect(name, self.body:getX()-12, self.body:getY()-15) -- cgit v1.1