diff options
author | Aki <nthirtyone@gmail.com> | 2017-07-19 15:12:10 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-07-19 15:12:10 +0200 |
commit | 53e8d75edc401d613a1fee9795532cc6d98f7132 (patch) | |
tree | 935080f330b5ad697481d2c8995073f369aba9d7 | |
parent | 657eb912abc89a71d16ea60516458ad6c72f6a4e (diff) | |
download | roflnauts-53e8d75edc401d613a1fee9795532cc6d98f7132.zip roflnauts-53e8d75edc401d613a1fee9795532cc6d98f7132.tar.gz roflnauts-53e8d75edc401d613a1fee9795532cc6d98f7132.tar.bz2 |
Added clash effect for clashes
-rw-r--r-- | not/World.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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 |