Hi. I need help with my Greenfoot project.
I am trying to acces a method from this object called Bee. The method is in another actor's code, called Butt(short for Butterfly :)))
Can you please help ?
public class Bee extends Actor
{
int a=0;
public void act()
{
Click();
Butt();
}
public void Click()
{
if (Greenfoot.mouseClicked(this))
{
Butt();
}
}
public void Butt()
{
Butt butt = (Butt) getOneObjectAtOffset(0, 0, Butt.class);
butt.yaz();
}
}
public class Butt extends Actor
{
public int a=0;
public void act()
{
yaz();
}
public void yaz()
{
World world;
world = getWorld();
if(a==2)
world.removeObject(this);
}
}
Please please please help me.
Thanks in advance :)

