Help with Critter in Gridworld?
So, I'm having trouble making this critter that can only process one critter at a time, eat it, then repeat this cycle until it has processed a critter three times. After it processes three times, it can multiply. Also, it can only look up to 8 squares for things to eat and it can only look in the current row it's in. Finally, I can't override any methods except for processActors, makeMove, getMoveLocations, getActors, and selectMoveLocation.
I tried to make the critter do the processing one at a time thing in processActors but I can't maintain it, I can't make it process only one at a time. How do I do that? Also, if anyone could help me on the other parts too, I would be much obliged.
This is what I have so far:
public class TomaCritter extends Critter
public void processActors (ArrayList < Actor > actors)
int critterLimiter = 0;
int critters = actors.size();
Actor jim = actors.get(critters);
if (critterLimiter >= 3)
critterLimiter = 0;