summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-08 13:03:27 +0200
committerAki <nthirtyone@gmail.com>2016-08-08 13:03:27 +0200
commit1bf857aa6e760089534bec5c17783d74f035d983 (patch)
tree78f1a8245878f3fc47c383725e3b723af268388d
parentef0eb088ab25d819c590c870ae20a9f546c059de (diff)
downloadroflnauts-1bf857aa6e760089534bec5c17783d74f035d983.zip
roflnauts-1bf857aa6e760089534bec5c17783d74f035d983.tar.gz
roflnauts-1bf857aa6e760089534bec5c17783d74f035d983.tar.bz2
Hotfix for destroyed bodies
-rw-r--r--player.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/player.lua b/player.lua
index 366fe5d..db6a683 100644
--- a/player.lua
+++ b/player.lua
@@ -97,6 +97,8 @@ end
-- Update callback of `Player`
function Player:update (dt)
+ -- hotfix? for destroyed bodies
+ if self.body:isDestroyed() then return end
-- # LOCALS
-- velocity: x, y
local x,y = self.body:getLinearVelocity()
@@ -377,7 +379,7 @@ function Player:damage (horizontal, vertical)
self.body:setLinearVelocity(x,0)
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.combo = math.min(80, self.combo + 1)
self.punchcd = 0.07 + self.combo*0.005
self:playSound(2)
end