title: libgdx creating multiple objects in different places
body: <p>I want to spawn my item (Sword1) in random places. When i spawn it, first of all it only creates 1 of it, then it moves randomly everywhere. Should I create and array for the object? How? </p>
  
  <pre><code>    public class Sword1 {
  
          public static TextureRegion sprite;
  
          public static int x;
          public static int y;
          public static int size;
  
          public static boolean created;
          public Sword1(){
              created=true;
              Random r = new Random();
              x = (r.nextInt(5)+1)*GameRender.tilesize;
              y = (r.nextInt(5)+1)*GameRender.tilesize;
              size = GameRender.tilesize;
              sprite = AssetLoader.s1;
              createMe();
          }
  
          public static void createMe() { 
              GameRender.batch.draw(sprite, x, y, size, size);    
          }
  
     }
  </code></pre>
  
  <p>I render it in batch:</p>
  
  <pre><code>while(number&lt;4){
      number++;
      Items.createSwords();
  }   
  </code></pre>
  
  <p>I also tried to use Items class that would hold all the Items when there would be more</p>
  
  <pre><code>public class Items {
  
  
      public Items(){}
  
      public static void createSwords() {
          Object sword = (Sword1) new Sword1();
      }
  }
  </code></pre>