I have one object shooting another object and there are multiple of the item i am shooting at and when the bullet hits the object that i am shooting at I am shooting at it removes it but i get an error about there not being an object for me to do stuff with even though there are multiple of that object in the world.
Here is the code for the object i want to remove
(Shooter is the bullet)
If you need the code for any of the other objects let me know.
I get an error for line 18,30, and 37.
public class Apple extends Actor
{
private int numApples = 3;
/**
* Act - do whatever the Apple wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
remove();
move(4);
edge();
randomTurn();
}
public void remove()
{
if (isTouching( Camel.class))
{
getWorld().removeObject(this);
}
if (isTouching (Shooter.class))
{
getWorld().removeObject(this);
}
}
