diff options
author | Aki <nthirtyone@gmail.com> | 2016-07-17 11:44:05 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-07-17 11:44:05 +0200 |
commit | ccb596c7bfe6a83737d3847ca3930c8c1b335297 (patch) | |
tree | 0fc7d6ff9c0e8faf1248ebfb6859af4cf8f1b2c3 /player.lua | |
parent | 9dbd5f6101234489d74bebef7db8027b34c6a078 (diff) | |
download | roflnauts-ccb596c7bfe6a83737d3847ca3930c8c1b335297.zip roflnauts-ccb596c7bfe6a83737d3847ca3930c8c1b335297.tar.gz roflnauts-ccb596c7bfe6a83737d3847ca3930c8c1b335297.tar.bz2 |
Dynamics and movement
Diffstat (limited to 'player.lua')
-rw-r--r-- | player.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -35,7 +35,7 @@ Player = { salto = false, jumpactive = false, jumpdouble = true, - jumptimer = 0.14, + jumptimer = 0.16, jumpnumber = 2, -- Keys controller = nil, @@ -198,7 +198,7 @@ function Player:update (dt) if self.punchdir == 0 then self.body:setLinearVelocity(0,0) else - self.body:setLinearVelocity(32*self.facing,0) + self.body:setLinearVelocity(38*self.facing,0) end end @@ -359,6 +359,7 @@ function Player:hit (ox, oy, sx, sy, vx, vy) end -- Hittest +-- Should be replaced with actual sensor; after moving collision callbacks into Player function Player:testHit (target, ox, oy, sx, sy) local x, y = self.body:getPosition() for v=0,2 do @@ -374,7 +375,7 @@ function Player:damage (horizontal, vertical) self:createEffect("hit") local x,y = self.body:getLinearVelocity() self.body:setLinearVelocity(x,0) - self.body:applyLinearImpulse((32+12*self.combo)*horizontal, (68+10*self.combo)*vertical + 15) + self.body:applyLinearImpulse((42+10*self.combo)*horizontal, (68+10*self.combo)*vertical + 15) self:changeAnimation("damage") self.combo = math.min(20, self.combo + 1) self.punchcd = 0.08 |