I'm having trouble grasping the concept of authors using login when determining collisions between two circles (bubbles). You can find more information in the Calculating collisions section.
The author explains:
The bubble being fired follows a set of coordinates defined by the equations:
px = ex + tdx py = ey + tdy
where px and py are points on the trajectory of the bubble’s center point. The calculation of px and py happens in jQuery’s animate method and is the standard equation for moving a point along a line. Next, we’ll calculate t at the closest point on this line to the center of the bubble that we’re checking against:
var t = dx * distToBubble.x + dy * distToBubble.y;
I'm puzzled by the purpose of variable t
and why it's calculated with the formula:
var t = dx * distToBubble.x + dy * distToBubble.y;
?