At the moment I am trying to add a counter where the counter will go up when my character collects a collectible. I'm following a tutorial on www.csnewbs.com and I'm nearly finished, but when I get to step 3 and put 'counter' in every instance of 'plane' code in all my worlds relevant (I have multiple worlds-not sure if this is the issue) the game says it can't find variable 'counter'. I've checked my game and really can't see the error. Here is one of my world for example:
import greenfoot.*;
/**
* Write a description of class Sky here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Sky extends World
{
/**
* Constructor for objects of class Sky.
*
*/
public Sky()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
prepare();
}
/**
* Prepare the world for the start of the program. That is: create the initial
* objects and add them to the world.
*/
private void prepare()
{
Counter counter3 = new Counter();
addObject(counter3, 66, 33);
Plane plane3 = new Plane(counter);
addObject(plane3, 12, 227);
}
}

