Example #1
0
  void autoUpdate() {
    if (hasTitle()) {
      return;
    }

    for (Shape s : allShapes) {
      s.autoUpdate();
    }

    Iterator<Shape> iter = allShapes.iterator();
    while (iter.hasNext()) {
      Shape s = iter.next();
      s.update();
      if (s.isDestroyed()) {
        if (s.isSolid()) {
          removeSolid(s);
        }
        removeFromLayers(s);
        iter.remove();
      }
    }
  }
Example #2
0
 /**
  * Removes the given audio event listener from being notified of future audio events, if it was
  * present. If not present, has no effect.
  */
 public static void removeAudioEventListener(AudioEventListener listener) {
   listeners.remove(listener);
 }
Example #3
0
 /**
  * Removes all audio event listeners from being notified of future audio events, if any were
  * present. If none were present, has no effect.
  */
 public static void clearAudioEventListeners() {
   listeners.clear();
 }
Example #4
0
 public static void addAudioEventListener(AudioEventListener listener) {
   listeners.add(listener);
 }
Example #5
0
 /**
  * Returns an array of all shapes currently in the game.
  *
  * @return an array of all shapes currently in the game.
  */
 public static Shape[] getAllShapes() {
   return allShapes.toArray(new Shape[0]);
 }
Example #6
0
 static void removeShape(Shape shape) {
   allShapes.remove(shape);
   removeFromLayers(shape);
 }
Example #7
0
 static void addShape(Shape shape) {
   allShapes.add(shape);
 }
Example #8
0
 static void removeSolid(Shape shape) {
   solidShapes.remove(shape);
 }
Example #9
0
 static void addSolid(Shape shape) {
   solidShapes.add(shape);
 }
Example #10
0
 static Shape[] getSolids() {
   return solidShapes.toArray(new Shape[0]);
 }