i have a gun that shoots balls whit bullets. When a bullet hits the ball the image changes, and the point score should go up whit one, showing in a scoreboard, but goes op whit a larger number, hope someone can see what im doing wrong.
my scoreboard class
public class ScoreBoard extends Actor
{
private static final String scoreLable = "Score: ";
private GreenfootImage box;
public ScoreBoard()
{
box = new GreenfootImage(60,30);
box.setColor(new Color(255,255,255));
box.fillRect(0,0,100,30);
updateStatus(0);
}
public void updateStatus(int pinkScore)
{
GreenfootImage img = new GreenfootImage(box);
img.setColor(Color.YELLOW);
img.drawString(scoreLable + pinkScore, 5,12);
setImage(img);
}
my world class
public class MyWorld extends World
{
private int pinkScore = 0;
private ScoreBoard pinkScoreBoard;
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(800, 600, 1);
addGun();
pinkScoreBoard = new ScoreBoard();
addObject(pinkScoreBoard,30,385);
pinkScoreBoard.updateStatus(pinkScore);
}
public void increasePinkScore()
{
pinkScore = pinkScore+1;
pinkScoreBoard.updateStatus(pinkScore);
}
public int getPinkScore()
{
return pinkScore;
}
}
my ball class
public void hitPinkBall()
{
Actor actor = getOneIntersectingObject (Bullet.class);
if (actor != null)
{
MyWorld myWorld1 = (MyWorld)getWorld();
myWorld1.increasePinkScore();
setImage("pinkSplach.png");
setRotation(90);
}

