I am working on a simulation that involves breeding ants. I would like to find out a way to, when two ants collide, check if the other is male or female, and then, if M & F, create a new ant.
Believe that you need a reference to the specific ant, like so. All you need is a int called gender.
Ant ant = (Ant) getOneIntersectingObject(Ant.class);
if(ant != null)
{
if(ant.gender != this.gender)
{
getWorld().addObject(new Ant(), x, y);
}
}