Hi guys, I'm writing a mini-game at the moment that utilises some AI. there are balls of various points floating around in a 2d environment that the AI has to choose between.
Now of course they could just go for the highest scoring ball or they could go for the closest. Is there a neat way of creating a sorted array or a melding of the two?
For example, red = 1 point, blue = 2, black = 3. There is a blue ball close to the AI but he chooses to go for black seeing as it's the highest. So he should take into account some kind of value for closeness and pointage. If that's even a word. No, firefox just flagged it. What the hell, I'll keep it.
Anyone got any ideas?
would complile an array of all the balls, highest being closest and most points, lowest being lowest points and furthest away.
Now of course they could just go for the highest scoring ball or they could go for the closest. Is there a neat way of creating a sorted array or a melding of the two?
For example, red = 1 point, blue = 2, black = 3. There is a blue ball close to the AI but he chooses to go for black seeing as it's the highest. So he should take into account some kind of value for closeness and pointage. If that's even a word. No, firefox just flagged it. What the hell, I'll keep it.
Anyone got any ideas?
compiledBestBalls()
would complile an array of all the balls, highest being closest and most points, lowest being lowest points and furthest away.