i'm trying to track an object in the world and then turn towards it. There is this error that happens saying that I can't use the getX/Y(); function because its static. Is there a way to fix this?
import greenfoot.*;
/**
* Write a description of class Predator here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Predator extends Actor
{
/**
* Act - do whatever the Predator wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
tracking();
}
public void tracking()
{
turnTowards(prey.getX(), prey.getY());
}
}
