示例#1
0
  private void reproduction(
      int x,
      int y,
      ArrayList<Life> life,
      int minx,
      int maxx,
      int miny,
      int maxy) // Make another dino that is the same and set age to baby
      {
    // Make a dino
    Dino d = makeCopy(this);
    d.age = Age.BABY;
    d.setCoord(x, y);
    d.turns = 0; // Set the turns the creature has taken to
    diseaseCnt = 30; // Reset diseaseCnt for new dinos
    if (Math.random() < 0.8)
      d.disease = false; // 80% chance to not get the disease if original dino has disease

    // Add to life
    life.add(d);
  }