Intersect Point

Ender Nafi Elekcioglu endernafi at gmail.com
Thu Oct 24 20:03:14 EDT 2013


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 …~



More information about the use-livecode mailing list