Skip to content

Instantly share code, notes, and snippets.

@shameerc
Created October 1, 2011 09:48
Show Gist options
  • Save shameerc/1255816 to your computer and use it in GitHub Desktop.
Save shameerc/1255816 to your computer and use it in GitHub Desktop.
Collision detection
// collission detection logic
function checkCollision(){
if(ball.y+radius==C_HEIGHT && (
(ball.x < bar.x) || (bar.x + barWidth) < ball.x ) ){
stopGame();
}
else if(ball.y+radius==C_HEIGHT ){
updatePonits();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment