Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Collision Detection
From: Matt Wobensmith
Date: Wed, 13 Dec 2000 00:34:22 GMT

Hi Scott -

You wrote:
>Has anyone here done collision detection using objects that are odd shapes.
<snip>
>Is there an easy way to do this? By the way, it's in Flash 5.


The new hitTest method makes this way easier than it was in Flash 4. You can
either a) detect when two clips' rectangular bounding boxes intersect, or b)
determine when one clip's center point intersects another clip's *shape*
bounds.

This works great, but keep in mind it doesn't do the shape collision with
two objects' shapes - just one. Hope this isn't too confusing??!

I made a sample ActionScript that uses this on the Flash Exchange, called
Bounce. If you haven't already seen it, it may be a good starting point.
It's easier just to view this than to try to explain it further. :>)

http://www.macromedia.com/exchange/flash


Matt

---------------
Matt Wobensmith
Macromedia

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: fscommand, Danny Ferry

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]