Example #1
0
  private void spawn(int x, int y, boolean LeftButton) {
    if (spawnCooldown < 300) {
      return;
    }

    if (LeftButton) {
      entities.addAll(PhysSimHelper.spawnRandom(x, y, 1));
    } else {
      RigidBody b = PhysSimHelper.spawnDiamond(x, y, 1);
      b.setVelocity(Vector2D.LEFT.mult(50));
      b.setId(++testId);
      testDebug = true;
      entities.add(b);
    }

    spawnCooldown = 0;
  }