Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check collision

if(ball.y > rect.y - rect.height &&
   ball.x > rect.x - rect.widht &&
   ball.x < rect.x + rect.widht){
	vel.y *= -1;
  //collision check for pong game
}
 
PREVIOUS NEXT
Tagged: #javascript #check #collision
ADD COMMENT
Topic
Name
2+7 =