Hi guys.
I want to display the number of leaves eaten on the screen in Greenfoot in the most simplest way possible. How can I do this?


1 2 3 4 5 6 7 8 9 | private void updateCount() { // create a replacement cell image for the background GreenfootImage image = new GreenfootImage( "cell.jpg" ); // draw the score on the cell image image.drawString( "" +leavesEaten, 8 , 24 ); // draw the cell image onto the background getWorld().getBackground().drawImage(image, 0 , 0 ); } |