Пример #1
0
  void enemieHandeler() {
    int ran = (int) ((70 - difficulty) * delta);
    if (ran <= 0) return;
    if (rand.nextInt(ran) == 1) {
      int x = rand.nextInt(2);
      int y = rand.nextInt(2);
      int size = rand.nextInt(1000) + 50;
      if (x == 0 && y == 0)
        if (rand.nextBoolean()) x = rand.nextInt(4) + 1;
        else y = rand.nextInt(4) + 1;

      if (rand.nextBoolean()) x = -x;
      if (rand.nextBoolean()) y = -y;
      size = size * (rand.nextInt(difficulty) + 1);

      x = (int) (x * 400 + player.body.getCenterX());
      y = (int) (y * 400 + player.body.getCenterY());

      int type = 0;

      if (rand.nextInt(60 / difficulty) <= 1) type = rand.nextInt(3) + 1;

      spawnEnemie(x, y, size, type);
    }
  }
Пример #2
0
 public static Address randomAddress() {
   Address a = create(Address.class);
   a.setAddressee(randomize(ADDRESSEE));
   if (rand.nextBoolean()) {
     a.setAddressLine1(randomize(ADDRESS));
     a.setAddressLine2("");
   } else {
     a.setAddressLine1("");
     a.setAddressLine2(randomize(ADDRESS));
   }
   a.setCity(randomize(CITY));
   a.setPostalCode(generateKey(5));
   a.setState(randomize(STATE));
   return (a);
 }