i’m using the collision detection kit
http://www.coreyoneil.com/portfolio/index.php?project=5
im using the CollisionList class.
it’s instantiated like this:
var collisions:CollisionList= new CollisionList(ship);//ship is added as the object to check collisions for.
then you add all the objects you want to check for collisions with the ship like…
collisions.addItem(rocks);
then later you make an array
var collisionsArray:Array = collisions.checkCollisions();
if(collisionsArray.length)
{
doSomeStuff();
}
i need a different response depending on wether the ship hits an upBumper, a leftBumper, a rightBumper, or a downBumper.
i have each in its own class but i don’t know about working with arrays.
above I think i’m saying that if the Array collisionsArray has length(a collision has occurred so an object has been added to the array) then on we go to doSomeStuff(). Am i with it so far???
if yes then how could i do different things depending on the object that has been colided with…can i get the name as a string then if string equals…???