示例#1
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;
    }
  }
示例#2
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;
    }
  }