Hi, how can I get my score from the first level (first world) to the second level (second world)?
my score:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
* Write a description of class Counter here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Counter extends Actor
{
/**
* Act - do whatever the Counter wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
private int totalCount = 0;
public Counter()
{
setImage(new GreenfootImage("Score = " + "0", 20, Color.BLACK, Color.WHITE));
}
/**
* Increase the total amount displayed on the counter, by a given amount.
*/
public void bumpCount(int amount)
{
totalCount += amount;
setImage(new GreenfootImage("Score = " + totalCount, 20, Color.BLACK, Color.WHITE));
}
}