drmcnellis / collisiondetectionkit

Automatically exported from code.google.com/p/collisiondetectionkit
0 stars 0 forks source link

Add ability to change target in CollisionList #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, you can only specify the target for a CollisionList in the 
constructor.

It would be helpful to be able to change the target of a CollisionList after 
the instance has been 
created.

Please add a target property to CollisionList.

This would be useful when you need to do multiple 1 to many collision checks, 
where the many 
are the same for each check (although the 1 is different).

This would allow you to reuse the same CollisionList instance across multiple 
one to many 
checks.

You could possibly use CollisionGroup for this, but that is not always as 
efficient:

1. it may do unnecessary checks, if you dont care that some items hit others.
2. the same items may appear in the collisions array, making it more difficult 
to work with them 
(i.e. removing colliding items from the display list).

Original issue reported on code.google.com by mikechambers on 17 Jun 2009 at 8:59

GoogleCodeExporter commented 9 years ago
I'm happy to report that this ability already exists.  You can change the target
using the CollisionList's swapTarget() method.  Pass it the new target you want 
and
it's done!  You can read about it in the documentation here:
http://www.coreyoneil.com/Flash/CDK/documentation/CollisionList.html#swapTarget

By the by, I'm a big fan Mike.  :D  If there are any open seats at Adobe for the
Flash team, drop me a line?  Pretty please??  ;)

Original comment by lessthan...@gmail.com on 17 Jun 2009 at 9:39

GoogleCodeExporter commented 9 years ago
Awesome. That is exactly what I was looking for.

mike chambers

mesh@adobe.com

Original comment by mikechambers on 18 Jun 2009 at 9:41