Example #1
0
 @Override
 public int compare(GameObject o1, GameObject o2) {
   if (o1.getY() < o2.getY()) {
     return -1;
   } else if (o1.getY() > o2.getY()) {
     return 1;
   } else {
     return 0;
   }
 }
Example #2
0
  public void drawPickables() {

    Collections.sort(objects, new ItemSorter());

    for (GameObject o : objects) {
      if (o instanceof Pickable) {
        o.delete();
        o.draw();
      }
    }
  }
Example #3
0
  public void drawObjects() {

    for (GameObject o : objects) {
      o.draw();
    }
  }
Example #4
0
  public void addObject(GameObject object) {
    object.createObject(pos);
    objects.add(object);

    drawPickables();
  }