Super_Hippo wrote...
I also started with Greenfoot in school like four and a half years ago, but I continued programming with it and it became a hobby. Give it a chance, it's a lot of fun if you understand what you are doing.
If a line starts with a for example "private", it can't be in a method. It is either a method itself (e. g. the theCounter method) or a variable (e. g. counter, timer, time...).
The variables belong to the beginning of the class, just where in line 21, you already have a time variable. So instead of this line, insert these:
private Counter counter[] = {new Counter("Roter Boxer: "), new Counter("Blauer Boxer: ")};
private Counter timer = new Counter("Zeit: ");
private int time = 30*55; //about 30 seconds//the coordinates should be altered so they are added to the correct position addObject(counter[0], 70, 30); addObject(counter[1], 120, 30); addObject(timer, 170, 30);
public Counter getCounter(int i) {return counter[i];}public void act()
{
if (--time % 55 == 0)
{
timer.add(-1);
if (time==0)
{
if (counter[0].getValue() > counter[1].getValue()) //red won
else if (counter[0].getValue() < counter[1].getValue()) //blue won
else //draw -- Unentschieden
}
}
}


