Learn Create Your Own Split Screen

Next Page

We've already calculated the x and y distance, so now we can calculate the straight-line, or "actual distance" by using good ol' Pythagorean Theorem
var actual_distance = Math.sqrt(distance_x * distance_x + distance_y * distance_y); // Thanks, Pythagoras!