Exemplo n.º 1
0
  @Override
  public void allRolloversInGroupActivated(Field field, RolloverGroupElement rolloverGroup) {
    // rollover groups increment field multiplier when all rollovers are activated, also reset to
    // inactive
    rolloverGroup.setAllRolloversActivated(false);
    field.getGameState().incrementScoreMultiplier();
    field.showGameMessage(field.getGameState().getScoreMultiplier() + "x Multiplier", 1500);

    // extra ball for ramp shot if extra ball rollovers all lit
    if ("RampRollovers".equals(rolloverGroup.getElementID())) {
      RolloverGroupElement extraBallRollovers =
          (RolloverGroupElement) field.getFieldElementByID("ExtraBallRollovers");
      if (extraBallRollovers.allRolloversActive()) {
        field.showGameMessage("Extra Ball!", 2000);
        field.getGameState().addExtraBall();
        extraBallRollovers.setAllRolloversActivated(false);
      }
    }
  }
Exemplo n.º 2
0
 @Override
 public void allDropTargetsInGroupHit(Field field, DropTargetGroupElement targetGroup) {
   // activate ball saver for left and right groups
   String id = targetGroup.getElementID();
   if ("DropTargetLeftSave".equals(id)) {
     ((WallElement) field.getFieldElementByID("BallSaver-left")).setRetracted(false);
     field.showGameMessage("Left Save Enabled", 1500);
   } else if ("DropTargetRightSave".equals(id)) {
     ((WallElement) field.getFieldElementByID("BallSaver-right")).setRetracted(false);
     field.showGameMessage("Right Save Enabled", 1500);
   }
   // for all groups, increment extra ball rollover
   RolloverGroupElement extraBallRollovers =
       (RolloverGroupElement) field.getFieldElementByID("ExtraBallRollovers");
   if (!extraBallRollovers.allRolloversActive()) {
     extraBallRollovers.activateFirstUnactivatedRollover();
     if (extraBallRollovers.allRolloversActive()) {
       field.showGameMessage("Shoot Ramp for Extra Ball", 1500);
     }
   }
 }
Exemplo n.º 3
0
 // support for enabling launch barrier after ball passes by it and hits sensor, and disabling for
 // new ball or new game
 void setLaunchBarrierEnabled(Field field, boolean enabled) {
   WallElement barrier = (WallElement) field.getFieldElementByID("LaunchBarrier");
   barrier.setRetracted(!enabled);
 }