Hello,
I had a query regarding Collision Detection in MIT App Inventor. I made a game in which there is a sack that moves on the bottom of the canvas and there are gifts and coals falling from the sky. I use Sack.collidedWith event to check for collisions. Initially, I was checking if "other" is equal to gift or coal and depending on that increasing or decreasing the score. Somehow that was triggering false positives. I replaced the = check with call sack.collidingWith and I passed the gift component as argument. I use this call instead of checking if "other" = gift. This call works perfectly with no false positives. Can anyone shed light on why the actual call works without any false positive whereas the = check for other leads to false positives. I am attaching both versions of events for better understanding.
1 Like
Can you export the aia for the false positive version and post it here?
Sure.
I have noticed that the false positive occurs more frequently when the sack is on the extreme left or right of the canvas.
GiftCatcherGameVer1.aia (381.1 KB)
I can confirm the false collisions.
It's as if the sack were considerably wider than it appears, when it is up against the edge.
I'm stumped.
I also thought that there might be something wrong with my sack's size but the game works perfectly fine when I replace the = check with the collidingWith call.
Thank you for taking the time out to have a look at my code.