private void verificaFinalDoJogo() {
   if (quantBotoesClicados >= 23) {
     insereJogador();
     ToastManager.show(
         CCDirector.sharedDirector().getActivity(), "Congratulations! :)", ToastManager.SUCESS);
     executarTempo(3000);
     delegate.iniciarFinaldoJogo();
     SoundEngine.sharedEngine().pauseSound();
     SoundEngine.sharedEngine()
         .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.finalend);
   }
 }
Ejemplo n.º 2
0
 public void playDangerAnimation(float dt) {
   countForDangerAnimation++;
   if (countForDangerAnimation == 1)
     SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.effect_danger);
   if (countForDangerAnimation <= 8) danger.setVisible(!danger.getVisible());
   bg_danger.setVisible(!bg_danger.getVisible());
 }
Ejemplo n.º 3
0
  public void runAttackAnimation_opponent(int kindOfAttack) {
    SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.effect_punch);

    numOfCurrentActions_opponent++;

    CCFiniteTimeAction damagedAction = makeDamagedAction();
    CCSequence opponent_attack_sequence = makeMyDamagedSequence(damagedAction);

    opponentCharacter_normal.stopAction(normalAnimate_opponent);
    opponentCharacter_normal.setVisible(false);
    switch (kindOfAttack) {
      case 1:
        SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.effect_bark);

        opponentCharacter_normal.setVisible(false);

        this.addChild(attack_bark_opponent, 1, ACTION_ATTACK_OPPONENT);

        coming_bark.setPosition(495 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(coming_bark, 500, ACTION_FLYING_OPPONENT);
        coming_bark.runAction(opponent_attack_sequence);
        break;
      case 2:
        opponentCharacter_normal.setVisible(false);
        this.addChild(attack_bone_opponent, 1, ACTION_ATTACK_OPPONENT);

        coming_bone.setPosition(495 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(coming_bone, 500, ACTION_FLYING_OPPONENT);
        coming_bone.runAction(opponent_attack_sequence);
        break;
      case 3:
        opponentCharacter_normal.setVisible(false);
        this.addChild(attack_punch_opponent, 1, ACTION_ATTACK_OPPONENT);

        coming_punch.setPosition(495 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(coming_punch, 500, ACTION_FLYING_OPPONENT);
        coming_punch.runAction(opponent_attack_sequence);
        break;
    }
  }
Ejemplo n.º 4
0
 @Override
 public boolean ccTouchesBegan(MotionEvent event) {
   CGPoint touchPoint =
       CCDirector.sharedDirector().convertToGL(CGPoint.ccp(event.getX(), event.getY()));
   if (btn_skill_bark_normal.getBoundingBox().contains(touchPoint.x, touchPoint.y)
       && gage >= Manager.required_gage_for_skill_bark) {
     SoundEngine.sharedEngine()
         .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.effect_button);
     gage -= Manager.required_gage_for_skill_bark;
     hp_opponent -= Manager.damaged_hp_per_attack_bark;
     updateSkillBtns();
     updateGageBar();
     runAttackAnimation_mine(1);
     NetworkManager.getInstance().sendAttack(SkillType.BARK);
   } else if (btn_skill_bone_normal.getBoundingBox().contains(touchPoint.x, touchPoint.y)
       && gage >= Manager.required_gage_for_skill_bone) {
     SoundEngine.sharedEngine()
         .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.effect_button);
     gage -= Manager.required_gage_for_skill_bone;
     hp_opponent -= Manager.damaged_hp_per_attack_bone;
     updateSkillBtns();
     updateGageBar();
     runAttackAnimation_mine(2);
     NetworkManager.getInstance().sendAttack(SkillType.BONE);
     /// * �������� ��� ���� ���
   } else if (btn_skill_punch_normal.getBoundingBox().contains(touchPoint.x, touchPoint.y)
       && gage >= Manager.required_gage_for_skill_punch) {
     SoundEngine.sharedEngine()
         .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.effect_button);
     gage -= Manager.required_gage_for_skill_punch;
     hp_opponent -= Manager.damaged_hp_per_attack_punch;
     updateSkillBtns();
     updateGageBar();
     runAttackAnimation_mine(3);
     NetworkManager.getInstance().sendAttack(SkillType.PUNCH);
     /// * �������� ��� ���� ���
   }
   return super.ccTouchesBegan(event);
 }
Ejemplo n.º 5
0
  public void clickedSkip(Object sender) {
    SoundEngine.sharedEngine()
        .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.effect_button);

    if (currentPage == 1) {
      currentPageNum = 6;
      currentPage = 2;
      updatePage(sender);
    } else {
      CCScene scene = ReadyToFightLayer.makeScene();
      CCDirector.sharedDirector().replaceScene(scene);
    }
  }
Ejemplo n.º 6
0
  public void runAttackAnimation_mine(int kindOfAttack) {
    SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.effect_punch);

    numOfCurrentActions_mine++;

    CCFiniteTimeAction attackAction = makeAttackAction();
    CCSequence my_attack_sequence = makeMyAttackSequence(attackAction);

    myCharacter_normal.stopAction(normalAnimate_mine);
    myCharacter_normal.setVisible(false);
    switch (kindOfAttack) {
      case 1:
        SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.effect_bark);

        myCharacter_normal.setVisible(false);
        this.addChild(attack_bark_mine, 1, ACTION_ATTACK_MINE);
        going_bark.setPosition(225 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(going_bark, 500, ACTION_FLYING_MINE);
        going_bark.runAction(my_attack_sequence);
        break;
      case 2:
        myCharacter_normal.setVisible(false);
        this.addChild(attack_bone_mine, 1, ACTION_ATTACK_MINE);

        going_bone.setPosition(225 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(going_bone, 500, ACTION_FLYING_MINE);
        going_bone.runAction(my_attack_sequence);
        break;
      case 3:
        myCharacter_normal.setVisible(false);
        this.addChild(attack_punch_mine, 1, ACTION_ATTACK_MINE);

        going_punch.setPosition(225 * Manager.ratio_width, 1030 * Manager.ratio_height);
        this.addChild(going_punch, 500, ACTION_FLYING_MINE);
        going_punch.runAction(my_attack_sequence);
        break;
    }
  }
Ejemplo n.º 7
0
  public void updatePage(Object sender) {
    SoundEngine.sharedEngine()
        .playEffect(CCDirector.sharedDirector().getActivity(), R.raw.effect_button);

    if (currentPageNum == 8) {
      CCScene scene = ReadyToFightLayer.makeScene();
      CCDirector.sharedDirector().replaceScene(scene);
    }
    currentPageNum++;
    for (int i = 0; i < 9; i++) {
      if (i == currentPageNum) episodeList[i].setVisible(true);
      else episodeList[i].setVisible(false);
    }
  }
Ejemplo n.º 8
0
 public void tellFight(Object sender) {
   SoundEngine.sharedEngine().playEffect(GameActivity.ctxt, R.raw.fight2);
 }