diff options
author | Aki <nthirtyone@gmail.com> | 2017-07-19 15:14:32 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-07-19 15:14:32 +0200 |
commit | ca6b363b70117198266022316a4ebfc9c8d1cda8 (patch) | |
tree | 47e1249ff9ffa0fdf4d3315a9b5b049616058afc | |
parent | 53e8d75edc401d613a1fee9795532cc6d98f7132 (diff) | |
download | roflnauts-ca6b363b70117198266022316a4ebfc9c8d1cda8.zip roflnauts-ca6b363b70117198266022316a4ebfc9c8d1cda8.tar.gz roflnauts-ca6b363b70117198266022316a4ebfc9c8d1cda8.tar.bz2 |
Cleaned-up Contact functions
-rw-r--r-- | not/World.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/not/World.lua b/not/World.lua index 992eef8..86b1560 100644 --- a/not/World.lua +++ b/not/World.lua @@ -327,12 +327,13 @@ function World:draw () end -- Box2D callbacks --- beginContact +-- TODO: Rather than here, these contacts should be in `Hero` (most likely). +-- TODO: Explode these into more functions.\ +-- TODO: Stop using magical numbers: +-- [1] -> Platform +-- [2] -> Hero +-- [3] -> Punch sensor function World.beginContact (a, b, coll) - -- TODO: Stop using magical numbers: - -- [1] -> Platform - -- [2] -> Hero - -- [3] -> Punch sensor if a:getCategory() == 1 then local x,y = coll:getNormal() if y < -0.6 then @@ -363,10 +364,8 @@ function World.beginContact (a, b, coll) end end end --- endContact function World.endContact (a, b, coll) if a:getCategory() == 1 then - -- Move them to Hero b:getUserData().inAir = true end end |