Question: inside the checkCollision() function i have to loop over the two objects since they are movable object to know if they are colliding or not
inside the checkCollision() function i have to loop over the two objects since they are movable object to know if they are colliding or not so if they are intersecting the gane will over esle the game still working normal. So please it is not working when i am looping to.check if the spaceShip intersect with the astroids the game should over
example: checkCollision() { for(var i =0; i < asteriods.length;i++) { if(isInside(spaceShip.locA, spaceShip.sizeA, astroids[i].locB, astroids[i].sizeB)) { gameOver(); } } }
but the checkCollision function is not working maybe i didn't put the parameters properly please assist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
