Intersect Point

Charles E Buchwald charles at buchwald.ca
Thu Oct 24 20:28:00 EDT 2013


Hi Ender,
Check out AnimationEngine. I think this will provide the collision detection you want, as well as many other animation features which you may find useful for the eventual bigger project. It's really easy to use, and it's all LC, not an external, so it's pretty easy to incorporate into your project.
- Charles


On 24 Oct 2013, at 7:03 PM, Ender Nafi Elekcioglu <endernafi at gmail.com> 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 lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Charles E. Buchwald
CEO/Director General

Museografica Digital
http://digital.museografica.com




More information about the use-livecode mailing list