'counter', on line 30, is referring to a Counter object that is created at line 11 when the 'correctButton' object is being created.
Remove line 11; and replace everything from line 26 through 50 with this;
if (Greenfoot.mouseClicked(this)) ((Timeworld)getWorld()).countScore();
