basically my scoreboard form MyWorld is transferred to stage2 with the score from MyWorld
public stage2()
{
super(800, 600, 1);
addObject(MyWorld.getScoreboard(), 66, 550);
addObject(new Survivor(),400,300);
}if (getWorld() instanceof MyWorld && MyWorld.getScoreboard().getScore() >= 10100)
actCount++;
// some unrelated code, then
if (actCount <= 0 || actCount >= 10)
{
dn = 1;
switchImage();
actCount = 0;
}
else if (actCount >= 5)
{
dn = 0;
switchImage();
actCount = 0;
}if (dn == 1 && getX() <= 2 || dn == 0 && getX() >= 797) dn = (dn+1)%2; // changing direction actCount = (actCount+1)%(5*3); // repeating a 15-count if (actCount%5 == 0) setImage(images[dn][actCount/5]); // animating actor
move(speed*(1-dn*2));