Hi Rob:
I found your tutorial about collision. And I see many functions but I don’t know how to use them.
I tried something about the isSensor = true, about physics or non-physics I have read many post and I still don’t really get it to work
Do you have a sample code as easy as possible to copy and past in a STORYBOARD, because most of the code I found are in one single file, so when I try to have this on storyboard, the runtime keeps working, the physics will not stop, some of the objects will not move after the second time, the physics works only the first time, and so on, I have several post on this an no solution yet
Thank for everything Rob, as always I really appreciate your time.
As an exampl, I see this
--rectangle-based collision detection 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
But I don’t have any idea waht to do with it or how to make ti work in storyboard at all
Thanks Rob