How do I get a scoring mechanism for the crab scenerio? Like keeping track of how many worms are eaten by the crab and so forth? What is the code?
import greenfoot.*; import java.awt.Color; public class WormCounter extends Actor { public void act() { updateImage(); } private void updateImage() { setImage(new GreenfootImage("Worms Eaten:"+ /*change crab to the crab class' name*/ Class.worms, /*this 15 is the size*/15, Color.black, null)); } }