Closed liboan closed 10 years ago
We could make a function checkCollisionsArrays(array1, array2)
that checks all objects of two arrays against each other, and call it in the update function. Would that work?
Isn't that just going to have us traverse the arrays an extra time anyways? Id prefer collision checks to occur while we are updating individual enemies, not afterwards.
We could assign every enemy a property that points to the bullet array...maybe that will work On Aug 23, 2014 7:05 PM, "Rudy Raveendran" notifications@github.com wrote:
We could make a function checkCollisionsArrays(array1, array2) that checks all objects of two arrays against each other, and call it in the update function. Would that work?
— Reply to this email directly or view it on GitHub https://github.com/WWPOL/Earth-Invader/issues/9#issuecomment-53169614.
All set
As of now there is no way for us to check for collisions inside a class update function, for example, while updating all enemies check each against the array of bullets.
I'd like to prevent adding another loop in the main update function to specifically check for collisions.