public class Fries extends Actor
{
private int height;
private int width;
public Fries (int height, int width)
{
this.height = height;
this.width = width;
}
public void resizeImage()
{
GreenfootImage img = getImage();
img.scale(height - 1, width - 1);
}
/**
* Act - do whatever the Fries wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
List<Ant> touchingAnts = getIntersectingObjects(Ant.class);
for (Ant a: touchingAnts)
{
resizeImage();
}
}
}
