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