I have 2 class
in first class i have this function
I want when i'm clicking on second object to call this function for first object.
public void Animation()
{
GreenfootImage menu = getImage();
int x=menu.getWidth();
int y=menu.getHeight();
while(y>0)
{
{
x--;
x--;
y--;
if(x==10) break;
if(y==10) break;
if(x%17==0) Greenfoot.delay(1);
if(x%20==0 )menu.scale(x,y);
}
if(x<100) setLocation(getX(),getY()+3);
}
}

