Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

neelvaka

macrumors newbie
Original poster
Sep 15, 2007
16
0
yup yup fnny i no

but those familiar to coderally
im trying to hit cars with the most efficient way and the rite angle and direction the car is in when an opponent gets an x ammount away from me.

i have this so far:

Code:
if (getDistanceTo(getNearestOpponent()) <= 100) {
            	 throwSpareTire();
             }
...
...
...
...

IObject getNearestOpponent() {
            double minDistance = 1000000, distance;
            IObject theNearestOneO = null;
            for (int f = 0; f < Opponents.length; f++) {
                    distance = getDistanceTo(Opponents[f]);
                    if (distance < minDistance) {
                            minDistance = distance;
                            theNearestOneO = Opponents[f];
                    }
            }
            return theNearestOneO;
    }

help?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.