Collision Detection w/o AE

Scott Rossi scott at tactilemedia.com
Sun Oct 8 12:10:46 CDT 2006


Recently, Mark Greenberg wrote:

> ... suggestions about collision detection.
> 
> ...The students are
> making an educational game about the solar system. It resembles the
> old Space Invaders, with asteroids falling from the sky and a space
> ship that slides left and right to shoot them.  The asteroids have
> the answers to questions on them.  The students need to script a
> handler for when the bullets hit the asteroids.

If the bullets are not large objects (ie they small images or graphics) you
could script something like this fairly easily using the within function.
Something like:

 if within(img "asteroid1",loc of grc bullet1) then runExplosion

The within function should correctly detect opaque and transparent regions
of an image.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com





More information about the use-livecode mailing list