I'm playing with the crab/lobster game scenario, and I've given the lobster the ability to seek and destroy the crab. I can't figure out how to make this dependant function only work when a crab(TestCrab) is on the world. Anyone have an idea? current TestLobster code is the following
public void act() { { Actor LC = (Actor)getWorld().getObjects(TestCrab.class).get(0); { turnTowards(LC.getX(), LC.getY()); move(3); } if(isTouching(TestCrab.class)) { removeTouching(TestCrab.class); } } }