I'm trying to make a game where My player (olifant) steps on actor (knop) and if he steps on it; actor(knop) and actor(door) need to dissapear. I can make actor(knop) disappear but not actor(door).
It gives me an error at removeObject(door); 'cannot find symbol - variable door'
Can somebody please write a code where i can make both dissapear? I'm working for like hours now
public void act()
{
hitByolifant();
// Add your action code here.
}
public void hitByolifant()
{
Actor olifant = getOneIntersectingObject(olifant.class);//Ik link nu de Projectile.class met de zombie.
if(olifant !=null)//Als er een Projectile de zombie raakt, dan verliest de Zombie hp, en verwijdert greenfoot de Projectile.
{
getWorld().removeObject(this);
getWorld().removeObject(door);
}
}
