var ball_y = ball._y; ... ball_y += Math.sin(ball._rotation*Math.PI/180); ball._y = ball_y; ball._rotation *= -1; ...