Hello,
So currently, I'm trying to link my score counter to my worms instead of crabs.
I have this piece of code
and I assumed to call it in my world, I would just do
However, I'm getting an error message: "cannot find symbol - variable counter". Why is that? I'm really confused because a similar scenario works perfectly fine with my lobster:
and calling it in myWorld with
and no error message pops up.
I think I'm not understanding something, but I'm not quite sure what. Any help would be appreciated. Thanks!
public Worm(Counter pointCounter)
{
counter = pointCounter;
}Worm worm = new Worm(counter);
addObject(worm, Greenfoot.getRandomNumber(460)+50, Greenfoot.getRandomNumber(460)+50);public Lobster(Lives pointCounter)
{
lives = pointCounter;
}Lobster lobster = new Lobster(lives);
addObject(lobster, 400, 400);
