i cant seem to make it so that the fruit disappears when the fly touches it. could someone please tell me how in the comments? i also need to know how to make the fruit switch to a random costume each tim
In your touchingfuit method in the fly class, before returning, if actor is not null, then do getWorld().removeObject(touching) or if you want to make it move to a different location do touching.setLocation(Greenfoot.getRandomNumber(getWorld().getWidth()), Greenfoot.getRandomNumber(getWorld().getHeight())). to change its picture do: touching.setImage(new GreenfootImage("picture file")).
2010/3/27
2010/3/27
2010/3/27