I am creating a game (for a project) where if the character ( controlled by keyboard) which is a penguin touches a fishnet, there will be 2 fish appearing on the screen. I have the method in my penguin class. However, when I transported this method to my world (which is called arctic), it appears as if my world can't find the method.
This is my code in the penguin class (this is without error)
public boolean isTouchingNet()
{
Actor net = getOneObjectAtOffset(0,0,fishnet.class);
if (net != null)
{
return false;
}
return true;
}
This is the code from my world (this has an error
it says that it can't find the method "isTouchingNet()"
public void addFish()
{
Actor penguin = (penguin) getObjects(penguin.class).get(0);
Actor fish = (fish) getObjects(fish.class).get(0);
if (penguin.isTouchingNet()= true)
{
addObject (fish, 300, 400); // this needs to be change into random
addObject (fish, 300, 500);
}


