예제 #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();
      }
    }
  }
예제 #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);
 }
예제 #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();
 }
예제 #4
0
 public static void addAudioEventListener(AudioEventListener listener) {
   listeners.add(listener);
 }
예제 #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]);
 }
예제 #6
0
 static void removeShape(Shape shape) {
   allShapes.remove(shape);
   removeFromLayers(shape);
 }
예제 #7
0
 static void addShape(Shape shape) {
   allShapes.add(shape);
 }
예제 #8
0
 static void removeSolid(Shape shape) {
   solidShapes.remove(shape);
 }
예제 #9
0
 static void addSolid(Shape shape) {
   solidShapes.add(shape);
 }
예제 #10
0
 static Shape[] getSolids() {
   return solidShapes.toArray(new Shape[0]);
 }