Results 1 to 1 of 1
Thread: Help with Critter in Gridworld?
- 03-28-2013, 10:54 AM #1Member
- Join Date
- Dec 2012
- Rep Power
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;
Last edited by Estrex; 03-28-2013 at 09:03 PM.
- By Green_Ghoul in forum New To JavaReplies: 2Last Post: 05-03-2011, 03:00 AM
- By Samirjthe2nd in forum New To JavaReplies: 1Last Post: 04-28-2011, 11:10 PM
- By farahm in forum New To JavaReplies: 2Last Post: 03-20-2011, 07:07 AM
- By BJ1110 in forum Advanced JavaReplies: 9Last Post: 02-04-2011, 05:02 PM
- By robertbob in forum New To JavaReplies: 2Last Post: 05-03-2010, 06:18 PM