Added a second c-helper function for calculating distance and switched the code in gameplay scene