package lilWorld; import processing.core.PApplet; import processing.core.PVector; import java.util.ArrayList; import java.util.List; public class CreatureSystem { //ListallCreatures = new ArrayList(); //List allCreatures = new ArrayList (); Creature c1; Creature temp1; PApplet parent; int creatureNo; int G = 10; int size1; int size2; float crPlus = 0; float forceVal = 12; CreatureSystem(PApplet p, int n, int s1, int s2) { parent= p; creatureNo = n; size1 = s1; size2 = s2; } //public void pushAllCreatures() // { // for (int i = 0; i < allCreatures.size(); i++) // { // c1 = (Creature) allCreatures.get(i); // pick a creeper // //System.out.println(c.getClass().toString()); // // for(int j = 0; j magnitude * direction // temp1.applyForce(dir); // temp1.changeColor(); // c1.changeColor(); // // } // // } // } // // } // // } // } // // public void moveAllCreatures(ArrayList array) // { // for(int i = 0;i < allCreatures.size(); i++) // { // temp1 = (Creature) allCreatures.get(i); // temp1.move(); // } // // } // // // public void showAllCreatures() // { // for(int i = 0;i < allCreatures.size(); i++) // { // //System.out.println("HERE"); // temp1 = allCreatures.get(i); // temp1.show(); // } // // } // // // // public Boolean checkProx(Creature a, Creature c) // { // float aR; // String name =a.getClass().toString(); // if(name.equals("Sprig")) // { // aR = a.getSize()/2; // } // else // { // aR = a.getSize()/2; // get radius temp // //System.out.println("this is radius of a " + aR); // } // float cR = c.getSize()/2; //get radius c // //cr+= crPlus; // //System.out.println("this is radius of c " + cr); // // System.out.println(PApplet.dist(c.loc.x, c.loc.y,a.loc.x, a.loc.y)); // float tempR = cR + aR; // System.out.println("against " + tempR); // if (PApplet.dist(c.loc.x, c.loc.y,a.loc.x, a.loc.y)<= cR + aR) // { // System.out.println("NEAR!!!!!!"); // return true; //they are near each other // // } // else // { // //System.out.println("not near!"); // return false; //they are not near each other // } // // } // // //} // }