i got a problem on trying to make my score count.
the logic is: when my char hits an "garbage", it disappears and we add a point.
i don't know why, but the points doesn't change ...
we tried some solutions of this forum but they didn't work.
can someone help us? i will show the code below.
this is our score counter code:
this is our character code (the part of hitting the "garbage" and adding a point):
thanks!
PS: i'm brazilian and i don't know english very well, sorry.
public class pontos extends Actor
{
int pontos = 0;
public void act()
{
mostraPontos();
}
public void mostraPontos()
{
setImage(new GreenfootImage("Pontos : " + pontos, 24, Color.WHITE, new Color(0,0,0,0)));
}
public void addPontos()
{
pontos++;
}
}public void someObjetos()
{
Actor vidroSome;
vidroSome = getOneIntersectingObject (vidro.class);
if(vidroSome != null)
{
World terreno;
terreno = getWorld();
terreno.removeObject(vidroSome);
}
}
