Flasher Archive

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


Subject: Re: FLASH: ActionScript Help
From: Gregg Caines
Date: Tue, 31 Oct 2000 00:10:43 GMT

Well collision detection requires that you know the coordinates
of each point on the entire perimeter of the object. The easiest
method is to make the perimeters for the objects simple squares
and create some algorithm to check if the two squares overlap.
You'll need to use width, height, x, and y properties and you'll
need to check for collision with each of the four corners.
The corners for a movie clip will be at these coordinates:
(x,y)
(x+width,y)
(x,y+height)
(x+width,y+height)

For example, you'll know if a given corner of MC1 is inside MC2
if both of its coordinates are greater than or equal to the coordinates
of MC2's upper left corner and less than or equal to the coordinates
of MC2's lower right corner. You'll need to test all 4 corners too...

Also, if the movie clips are different sizes, make sure you're testing
the corners of the smaller one.

Hopefully that makes a little sense...

---------------------------------------------------
Gregg Caines
n e o m e t r i x systems inc.
http://www.neometrixsystems.com
gcainesatneometrixsystems [dot] com


> I tried that and it did work, however I am having trouble associating that
> set of variables with the set from another object to determine collision.
>
> The second object is also a motion clip which moves across the screen via
> ActionScript.
>
> So, basically I can get the coordinates for both objects, I just don't
know
> how to make them
> talk to each other.
>
> Thanks,
> George Gleissner
> Web Production Specialist
> Association of Legal Administrators
> 847.247.5572
> ggleissneratalanet [dot] org



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
  RE: FLASH: ActionScript Help, George Gleissner

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