I am using a counter to record the score in my game. How do I add a method in the world to let the counter return its score value and add a message?


public class Punktestand extends Actor { public Punktestand(String text) { GreenfootImage img = new GreenfootImage(text.length()*20, 30); img.drawString(text,2,20); setImage(img); } public void setText(String text) { GreenfootImage img = getImage(); img.clear(); img.drawString(text,2,20); } }