Permalink
Browse files

Merge branch 'master' of github.com:ericz/shot3

  • Loading branch information...
2 parents ce8511d + 3a8ca1f commit 24030fa548f3f7ad8035cd7024fc683f1ba9e023 @ericz committed Feb 18, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 physics.js
View
@@ -57,8 +57,8 @@ physics = {
boxes = m.corners;
soft = m.softs;
console.log(boxes);
- leftAvg = (soft.left[0].y-soft.left[1].y)/2;
- rightAvg = (soft.right[0].y-soft.right[1].y)/2;
+ leftAvg = (soft.left[1].y-soft.left[0].y)/2;
+ rightAvg = (soft.right[1].y-soft.right[0].y)/2;
paddle1.x1 = soft.left[0].x+50;
paddle1.y1 = leftAvg-75;
paddle1.x2 = paddle1.x1+40;
@@ -183,6 +183,7 @@ physics = {
/*if (curBox == -1 && nextXBox != -1){
vel.x = -vel.x;
}*/
+ console.log(util.hardContains(ball,[{x:paddle1.x1,y:paddle1.y1},{x:paddle1.x2,y:paddle1.y2}]) , util.hardContains(ball,[{x:paddle2.x1,y:paddle2.y1},{x:paddle2.x2,y:paddle2.y2}]));
if (nextXBox == -1 || util.hardContains(ball,[{x:paddle1.x1,y:paddle1.y1},{x:paddle1.x2,y:paddle1.y2}]) || util.hardContains(ball,[{x:paddle2.x1,y:paddle2.y1},{x:paddle2.x2,y:paddle2.y2}])){
vel.x = -vel.x;
}

0 comments on commit 24030fa

Please sign in to comment.