i made the use of the code similar to the below one
if (getObjects(Fish.class).size() < 15) addObject(new Fish(),getWidth()-1, Greenfoot.getRandomNumber(getHeight());
but m not able to solve it
Download my new Help Methods scenario and open the 'XWorld' class code (you will need to change the view from 'Documentation' to 'Source code'). There is a method called 'choose' that would be helpful. You could either learn from the code and create your own for your situation or you could use the method as is, supplying the three GreenfootImage objects to choose from. If using as is, you will have to re-typecast the returned Object object back to a GreenfootImage object (refer to the 'MyWorld' class code where I add either a Bug or a Fly object into the world using the 'choose' method).
again my doubt of image is cleared bit
now another query is that after my one condtion is satisfied bt at that time i have to display text for few seconds and than make it go away
what should i do for that