From 53e8d75edc401d613a1fee9795532cc6d98f7132 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 19 Jul 2017 15:12:10 +0200 Subject: Added clash effect for clashes --- not/World.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/not/World.lua b/not/World.lua index 92b71ea..992eef8 100644 --- a/not/World.lua +++ b/not/World.lua @@ -350,6 +350,11 @@ function World.beginContact (a, b, coll) if b:getCategory() == 3 then a:getBody():getUserData():damage(b:getUserData()[2]) b:getBody():getUserData():damage(a:getUserData()[2]) + local x1,y1 = b:getBody():getUserData():getPosition() + local x2,y2 = a:getBody():getUserData():getPosition() + local x = (x2 - x1) / 2 + x1 - 12 + local y = (y2 - y1) / 2 + y1 - 15 + a:getBody():getUserData().world:createEffect("clash", x, y) end end if b:getCategory() == 3 then -- cgit v1.1