Hi
Sorry for asking such a question but I have searched here and google for this but I am not getting the correct search results when I do.
** EDIT **
Also I apologise for the title , it sounded right in my head but now that I look back at it, it does not really mean what I am after .So sorry for those of you who have read the title thinking one thing and then reading the post realising that I am meaning something slightly different :(
Currently my project consists of a player object which when making contact with certain other objects , after so many collisions, the other objects are destroyed.
That part I have got working but what I am trying to do is only one part of the player object needs to make contact with the other objects for this to work.
My collision code is from this page - > https://coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/
Using this method :
local function hasCollided( obj1, obj2 ) if ( obj1 == nil ) then -- Make sure the first object exists return false end if ( obj2 == nil ) then -- Make sure the other object exists return false end local left = obj1.contentBounds.xMin \<= obj2.contentBounds.xMin and obj1.contentBounds.xMax \>= obj2.contentBounds.xMin local right = obj1.contentBounds.xMin \>= obj2.contentBounds.xMin and obj1.contentBounds.xMin \<= obj2.contentBounds.xMax local up = obj1.contentBounds.yMin \<= obj2.contentBounds.yMin and obj1.contentBounds.yMax \>= obj2.contentBounds.yMin local down = obj1.contentBounds.yMin \>= obj2.contentBounds.yMin and obj1.contentBounds.yMin \<= obj2.contentBounds.yMax return (left or right) and (up or down) end
and so I have tried to change the results of this but as I am trying to only have contact from the players left and lowest point no combination seems to work from this method/function.
** edit **
Also if this makes any difference - the player object is moved by dragging.
Furthermore at some I will need to figure out how to “flip” the players object so that the left side of the object becomes the right side and therefore the collision detection would need to be able to handle this also
Thanks
TimCS