In my tower defence game the monsters are supposed to travel along different pieces of track to get to the end, as it stands now the actor can move right, up and left but as soon as i introduce down it has a compile error
Can anyone see what im doing wrong here
public void move()
{
Actor righttrack = getOneIntersectingObject(trackmoveright.class);
Actor uptrack = getOneIntersectingObject(trackmoveup.class);
Actor downtrack = getOneIntersectingObject(trackmovedown.class);
Actor lefttrack = getOneIntersectingObject(trackmoveleft.class);
/**
if (righttrack!=null)
{
setLocation(getX() + 1, getY());
return;
}
if (uptrack != null)
{
setLocation(getX(), getY() -1);
return;
}
/**
if (downtrack != null);
{
setLocation(getX(), getY() +1);
return;
}
if (lefttrack != null);
{
setLocation(getX() -1, getY());
return;
}
*/
}
