my game is where if a characterr touches another character it will increses in size to make it bigger?
public void scaleImage(GreenfootImage img, double size) { img.scale(((int) ((double) img.getWidth()*size/100.0)), (int) ((double) img.getHeight()*size/100.0)); }
if (/*whatever is the condition*/) { scaleImage(getImage(), 110); //110 is the percent value of the image so the image will be 10 % bigger than before; }
if (getImage().getWidth() < 500) { scaleImage(getImage(), 110); } //this will make your image grow until it reaches a width of 500 pixels;