Hello friends,
This is my code for Bomb.class. When it hits object of princi.class both the objects must be removed from the world. I have my princi object removed but Bomb object keeps moving in the user interface. I m pretty sure Bomb object is gets null value after intersection as it thrown exception of Actor not found when I tried to use it after intersection with princi object. But the image keeps moving in user interface.
This is my code for Bomb.class
Thanks in advance.
public void act()
{
this.setLocation(this.getX(),this.getY()-1);
Actor p=getOneIntersectingObject(princi.class);
if (p!=null) {
getWorld().removeObject(p);
getWorld().removeObject(this);
return;
}
if (getWorld() != null && getX() <= 0) {
getWorld().removeObject(this);
return;
}
}

