Beispiel #1
0
  public static void makeBugs(ActorWorld world, int n) {

    for (int i = 0; i < n; i++) {

      Bug coloredBug = new Bug();

      world.add(coloredBug);

      int x = coloredBug.getLocation().getCol();
      int y = coloredBug.getLocation().getRow();

      coloredBug.setColor(new Color(25 * y, 0, 25 * x));
    }
  }
Beispiel #2
0
  public static void main(String[] args) {

    Color purple = new Color(148, 0, 211);
    ActorWorld world = new ActorWorld();
    Bug redBug = new Bug();
    world.add(redBug);
    System.out.println(redBug.getLocation());

    makeBugs(world, 10);
    // colorBug(redBug);
    // moveBug(redBug, 5);

    // randomBug(redBug, 10000);

    world.add(new Rock());
    world.show();
  }
Beispiel #3
0
  public static void colorBug(Bug bug) {

    bug.getLocation();
    bug.setColor(new Color(148, 0, 211));
  }