Пример #1
0
  public void makeDemagedAnimation() {
    damagedAnimation_mine = CCAnimation.animation("animation5", 0.15f);
    myCharacter_hurted =
        CCSprite.sprite(
            String.format("character/char%d_hurted1.png", CurrentUserInformation.userChar));
    myCharacter_hurted.setPosition(139 * Manager.ratio_width, 1019 * Manager.ratio_height);
    for (int i = 1; i <= 5; i++) {
      CCSprite frame =
          CCSprite.sprite(
              String.format("character/char%d_hurted%d.png", CurrentUserInformation.userChar, i));
      frame.setScaleX(-1 * Manager.ratio_width);
      frame.setScaleY(Manager.ratio_height);
      damagedAnimation_mine.addFrame(frame.getTexture());
    }
    damagedAnimate_mine = CCAnimate.action(damagedAnimation_mine, false);

    damagedAnimation_opponent = CCAnimation.animation("animation6", 0.15f);
    opponentCharacter_hurted =
        CCSprite.sprite(
            String.format("character/char%d_hurted1.png", CurrentUserInformation.opponentchar));
    opponentCharacter_hurted.setPosition(581 * Manager.ratio_width, 1019 * Manager.ratio_height);
    for (int i = 1; i <= 5; i++) {
      CCSprite frame =
          CCSprite.sprite(
              String.format(
                  "character/char%d_hurted%d.png", CurrentUserInformation.opponentchar, i));
      frame.setScaleX(Manager.ratio_width);
      frame.setScaleY(Manager.ratio_height);
      damagedAnimation_opponent.addFrame(frame.getTexture());
    }
    damagedAnimate_opponent = CCAnimate.action(damagedAnimation_opponent, false);
  }
Пример #2
0
  public void makeNormalAnimation() {
    normalAnimation_mine = CCAnimation.animation("animation1", 0.15f);
    for (int i = 2; i <= 5; i++) {
      CCSprite frame =
          CCSprite.sprite(
              String.format("character/char%d_normal%d.png", CurrentUserInformation.userChar, i));
      frame.setScaleX(-1 * Manager.ratio_width);
      frame.setScaleY(Manager.ratio_height);
      frame.setPosition(212 * Manager.ratio_width, 1019 * Manager.ratio_height);
      normalAnimation_mine.addFrame(frame.getTexture());
    }
    normalAnimate_mine = CCAnimate.action(normalAnimation_mine, false);

    normalAnimation_opponent = CCAnimation.animation("animation2", 0.15f);
    opponentCharacter_normal =
        CCSprite.sprite(
            String.format("character/char%d_normal1.png", CurrentUserInformation.opponentchar));
    for (int i = 5; i >= 2; i--) {
      CCSprite frame =
          CCSprite.sprite(
              String.format(
                  "character/char%d_normal%d.png", CurrentUserInformation.opponentchar, i));
      frame.setScaleX(Manager.ratio_width);
      frame.setScaleY(Manager.ratio_height);
      frame.setPosition(508 * Manager.ratio_width, 1019 * Manager.ratio_height);
      normalAnimation_opponent.addFrame(frame.getTexture());
    }
    normalAnimate_opponent = CCAnimate.action(normalAnimation_opponent, true);
  }