Ejemplo n.º 1
0
  @Override
  protected void onConnected(BubbleMesh mesh) {
    super.onConnected(mesh);

    // Main.SM.PlaySound(new bomb_touch_snd());
    ArrayList<Bubble> deletedBubbles = BFS.getSameColorBubbles(getMeshPosition(), false);

    if (deletedBubbles.size() >= 3) {
      deletedBubbles = BFS.getSameColorBubbles(getMeshPosition(), true);

      for (Bubble bbl : deletedBubbles) mesh.DisconnectBubble(bbl);

      deletedBubbles.addAll(BFS.getUnrootedBubbles());
      for (Bubble bbl : deletedBubbles) mesh.DisconnectBubble(bbl);

      try {
        GameEvent event = new GameEvent(GameEvent.Type.COMBO, deletedBubbles);
        event.setTarget(mesh);
        mesh.notify(event, false);
      } catch (IncorrentGameEventDataException e) {
        e.printStackTrace();
      }

      // start deleter
      ((GameScreen) BubbleZombieGame.INSTANCE.getScreen())
          .AddGameObject(new BubbleDeleter(getPosition(), deletedBubbles, _body.getWorld()));
    }
  }
Ejemplo n.º 2
0
 @Override
 public void setColor(com.bubblezombie.game.Enums.BubbleColor newColor) {
   super.setColor(newColor);
   setBulletView();
 }