Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed more stuff

  • Loading branch information...
commit 5c4f29d2dce0915048ca584f0d699df7aa166b35 1 parent a6c9a9e
Sharad Vikram sharadmv authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  physics.js
3  physics.js
View
@@ -183,6 +183,9 @@ physics = {
/*if (curBox == -1 && nextXBox != -1){
vel.x = -vel.x;
}*/
+ if ((nextXBall.x>=paddle1.x1&&nextXBall.x<=paddle1.x2&&nextXBall.y<=paddle1.y2&&nextXBall.y>=paddle1.y2)||(nextXBall.x<=paddle1.x2&&nextXBall.x>=paddle1.x1&&nextXBall.y<=paddle1.y2&&nextXBall.y>=paddle2.y1)){
+ vel.x = -vel.x;
+ }
console.log([{x:paddle1.x1,y:paddle1.y1},{x:paddle1.x2,y:paddle1.y2}],[{x:paddle2.x1,y:paddle2.y1},{x:paddle2.x2,y:paddle2.y2}]);
if (nextXBox == -1 || util.hardContains(nextXBall,[{x:paddle1.x1,y:paddle1.y1},{x:paddle1.x2,y:paddle1.y2}]) || util.hardContains(nextXBall,[{x:paddle2.x1,y:paddle2.y1},{x:paddle2.x2,y:paddle2.y2}])){
vel.x = -vel.x;
Please sign in to comment.
Something went wrong with that request. Please try again.