I'm making a game where the user controls a shark and has to move around, eating the fish and dodging the trash. The user gets a point whenever they eat a fish. I've been having an issue where the program says it can't find a method and I can't seem to figure it out.
Here is where the error is. its in the Food class (the fish, what the shark eats)
this is the method in question, it is in the MyWorld class
Any help would be amazing, thanks for reading!
Actor foodHit = getOneIntersectingObject(Shark.class);
if(foodHit!=null)
{
World MyWorld = (World)MyWorld;
Counter counter = World.getCounter(); //error is here, "cannot find symbol - method getCounter()"
counter.addScore();
MyWorld.removeObject(this);
}public Counter getCounter()
{
return counter;
}
