Intersect Point

Andrew Kluthe andrew at
Thu Oct 24 20:24:53 EDT 2013

I don't work on this kind of stuff in livecode, is there a message that
gets sent when two objects touch in livecode?

 I believe this a good case for a pub-sub library like Andre Garzia's.

When the objects intersect have it throw a trigger to a specific callback
with its location in a parameter array and have that callback function
receive the location of the intersection and place the explosion sprite at
that location.

On Thu, Oct 24, 2013 at 7:03 PM, Ender Nafi Elekcioglu
<endernafi at>wrote:

> Hi all,
> I’m coding a very simple game just for an animation test of a bigger
> project.
> If two objects collide, they should merge and explode.
> For the objects, I’m using buttons whose icons set to the id’s of some
> png’s.
> For the explosion I use a separate *sprite* button.
> _ if intersect(object1, object2, “opaque pixels”)
> __ set the loc of spriteButton to collisionPoint
> __ send “animateTheExplosion” to me in 1 milliseconds
> __ play explosionSound
> __ delete object1
> __ delete object2
> But in this workflow, I need the *collisionPoint*.
> As far as I know, the intersect function doesn’t provide this info; just
> true or false.
> I have two questions about this:
> 1. What is the least expensive {time-consuming, processor-consuming, etc.}
> way to calculate the collision point of the objects?
> 2. Doesn’t the engine already have to calculate this collision point to
> determine if there is an intersection?
> What if the built-in intersect function provides us this point instead of
> true-false?
> Then we could construct our handler like this:
> *if intersect(object1, object2) is not empty then…*
> instead of
> *if intersect(object1, object2) then…*
> Is this a useful feature request to submit?
> Best,
> ~ Ender Nafi
> ~… together, we’re smarter …~
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:


Andrew Kluthe
andrew at

More information about the Use-livecode mailing list