|
|
Josh @ Dreamland
|
 |
Reply #2 Posted on: September 04, 2008, 06:45:33 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The former has existed since R1, but the latter doesn't exist in 'other programs,' and I prolly won't add it until I actually do some 3D.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Post made October 22, 2008, 10:32:26 am was deleted at the author's request.
|
score_under
|
 |
Reply #4 Posted on: October 22, 2008, 01:14:57 pm |
|
|
 Joined: Aug 2008
Posts: 308
|
Oh dear, imaginary numbers. #include <math.h>
double point_distance(double x1,double y1,double x2,double y2) { int x_diff,y_diff; x_diff = x2-x1; y_diff = y2-y1; return (double)sqrt((x_diff*x_diff)+(y_diff*y_diff)); } If I were to measure the distance from point (4,4) to point (0,0) without any checking on my part, this would cause a huge error as the numbers would suddenly mysteriously appear in the complex plane  Off the top of my head, #include <math.h>
double point_distance(double x1,double y1,double x2,double y2) { int x_diff,y_diff; x_diff = abs(x2-x1); y_diff = abs(y2-y1); return (double)sqrt((x_diff*x_diff)+(y_diff*y_diff)); } That should work better, right?
|
|
|
Logged
|
|
|
|
|
|
Post made November 15, 2008, 02:38:24 pm was deleted at the author's request.
|
|
|
Josh @ Dreamland
|
 |
Reply #10 Posted on: November 16, 2008, 08:59:04 am |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
XD @ i constant
Nah. C++ would just kill your game for you. ^_^
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|