Hello. When two elements overlap on top, i have - {body.touching.up: true, body.touching.left: true}. On touching up i destroy enemy, on touch left - player. But overlap return touching them both. How can i solve this problem? Thank you.
Hello. When two elements overlap on top, i have - {body.touching.up: true, body.touching.left: true}. On touching up i destroy enemy, on touch left - player. But overlap return touching them both. How can i solve this problem? Thank you.
You can compare overlapX and overlapY of the bodies, or check player.body.velocity.y > 0
, or compare center
of the bodies.
Thank you. I will try tomorrow and write the answer here