Hi, my problem is named in the title. I hope someone can help me.
Here is the method causing the problem:
If required: the actor "timer" just reduces the variable timer by 1 per act cycle if the value of the varible is over 0
private void sternBenutzen()
{
SuperStern superStern = (SuperStern) getOneIntersectingObject(SuperStern.class);
Timer timer = new Timer();
if(superStern != null && status == "figur")
{
statusAlt = status;
status = "sternFigur";
timer.timer = 1200;
getWorld().addObject(timer, getWorld().getWidth()/2, getWorld().getHeight()/2);
timer.setImage(new GreenfootImage("Zeit übrig : " + timer.timer/60, 20, Color.WHITE, new Color(0, 0, 0, 0 )));
if(xRichtung == 1)
{
// setImage(sternRechtsBlickend);
}
if(xRichtung == -1)
{
// setImage(sternLinksBlickend);
}
superStern = null;
getWorld().removeObject(superStern);
}
if(timer.timer == 0)
{
status = statusAlt;
statusAlt = null;
}
}
