If you have time, you can also check my "PikaTelo" as snake tail after you find the mistake with scoreboard. Because I try to make that when my "Pika" crash in its tail, the world restart. But I kinda complicated.. You'll see if you check (in Pika class - method "crush").
And thanks for help !
Ok. I added a method to both the Pika and Pika1 classes.
private void newWorld()
{
Zid zid = new Zid();
zid.counter1.setValue(counter1.getValue());
zid.counter.setValue(((Zid)getWorld()).counter.getValue());
Greenfoot.setWorld(zid);
}
Then I replaced lines 79 and 228 with 'newWorld();' (the 'Greenfoot.setWorld(new Zid());' lines in both classes).
Finally, remove both the konecRunde and the zacetekNoveRunde methods from both classes; and all calls to them.
Oh, I forgot. Your counter fields in your world class were never being set because you are creating local fields in the prepare method instead of using the world instance fields. Remove 'Counter ' from the beginning of the two lines that create (using the 'new' keyword') the Counter objects.
Ok. I kinda fix the problem, so my counter actually works now.
I set the limit value in the Counter class and now it works correct.
Thank you for all the help !