I only have a counter class, instructions class, and balls class. The balls bounce off the walls and when they hit each other, they are both supposed to disappear. I can make one of them disappear with
/**
* canSee - Return true if we can see an object of class right where we are.
* False if there is no such object here.
*/
public boolean canSee(Class className)
{
Actor actor = getOneObjectAtOffset(0,0,className);
return actor != null;
}
/**
* hit - Try to hit an object of Class.
* Only successful if there's such an object where we currently are. Otherwise it won't work
*/
public void hit(Class className)
{
Actor actor = getOneObjectAtOffset(0,0,className);
if (actor != null)
{
getWorld().removeObject(actor);
}
}
but I can't make the other one disappear. What can I do?
