I fixed part of my code like you posted, and went looking for a way to bounce the ball ad different angles. In my original code, this
Code:
ball.checkPaddles = function() {
if (ball.hitTest(player)) {
ball.dx = -ball.dx;
ball.dy = getDy(player);
}
if (ball.hitTest(opp)) {
ball.dx = -ball.dx;
ball.dy = getDy(opp);
}
}
function getDy(paddle) {
relY = ball._y - paddle._y;
relPerc - relY / paddle._height;
trace ("relPerc");
newDy = relPerc * 30;
trace("NewDy");
return newDy;
}
should have done it. For some reason it did not. Can you please look at this code as well?