Sure, each time the count on the counter changes:
(1) create a new image from the file
(2) create an image for the score text
(3) draw the score text image on the new file image
(4) set this as the new image for the object
Ok, but how do I do stap 3:
(3) draw the score text image on the new file image
I know how to draw text, but not how to do it in front of a .png image.
You will need to 'import java.awt.Color;' and use the 'new GreenfootImage(String text, int fontSize, Color foreground, Color background)' constructor for the text image using 'new Color(0, 0, 0, 0)' as the background color (which would be a transparent background).
You might want to download the Greenfoot 2.2.0 beta, and check out the Counter class, available from the Edit->Import Class menu. It does almost exactly what you want, so you can either use it, or learn from how it's written.
Thanks! I already got the 2.2 beta, but I didn't know that there's a counter class. Thank you for your help!
If anybody wants to see the result, look at the Jump! scenario on Greenfoot.
Looks good! If you want a fancier scoreboard to display at the end, you can use the same Import Class function to pull in the ScoreBoard class, which you can display at the end of the scenario.