Hi, struggling to make a game which uses score counter and I've got a problem.
using this in counter actor and
in anoter actor and this in my world. The problem is the following when i use "run" i can only see a part of the word "Score".
but if i stop it and Right click and void Score() it gets normal.....
. I am confused.
public class Score extends Actor
{
private int score=0;
public void Score()
{
setImage(new GreenfootImage(200, 30));
update();
}
public void addScore()
{
score++;
update();
}
public void update()
{
GreenfootImage img = getImage();
img.clear();
img.setColor(Color.WHITE);
img.drawString("Score: " + score/10,5 ,9 );
}
}((Score)getWorld().getObjects(Score.class).get(0)).addScore();
public Score score = new Score(); addObject (score, 200, 30);
