Exemplo n.º 1
0
 private void babyDontCry() {
   mMilkSprite.setVisible(false);
   A19_9B_5_NAKIGOE1.stop();
   mCryLeftSprite.clearEntityModifiers();
   mCryRightSprite.clearEntityModifiers();
   mCryLeftSprite.setVisible(false);
   mCryRightSprite.setVisible(false);
   if (mFingerAnimatedSprite[4].isAnimationRunning()) {
     mFingerAnimatedSprite[4].stopAnimation();
   }
   mFingerAnimatedSprite[4].setCurrentTileIndex(0);
   resetBaby();
 }
 public void checkArrow() {
   if (CUBIC_SLOT[0] == false || CUBIC_SLOT[1] == false) {
     mArrowSprite.setVisible(true);
     mArrowSprite.clearEntityModifiers();
     mArrowSprite.registerEntityModifier(
         new LoopEntityModifier(
             new SequenceEntityModifier(
                 new AlphaModifier(0.5f, 0.2f, 1.0f), new AlphaModifier(0.5f, 1.0f, 0.2f))));
   } else {
     mArrowSprite.setVisible(false);
     mArrowSprite.clearEntityModifiers();
   }
 }
  public void imitateGame() {

    getMainActivity().hideAd();

    goSprite.setVisible(false);
    goSprite.clearEntityModifiers();

    readySprite.setVisible(false);
    readySprite.clearEntityModifiers();

    initTime();
    taskInit();
  }
    public void actionUp(final int action) {
      ACTION = ACTION_TURN_START;
      mScrollLeftSprite.setVisible(false);
      mScrollLeftSprite.clearEntityModifiers();
      mCubicStartAniSprite.animate(
          new long[] {300, 300, 300},
          new int[] {0, 1, 2},
          0,
          new IAnimationListener() {

            @Override
            public void onAnimationStarted(AnimatedSprite arg0, int arg1) {
              mCubicStartAniSprite.setVisible(true);
            }

            @Override
            public void onAnimationLoopFinished(AnimatedSprite arg0, int arg1, int arg2) {}

            @Override
            public void onAnimationFrameChanged(AnimatedSprite arg0, int arg1, int arg2) {}

            @Override
            public void onAnimationFinished(AnimatedSprite animatedSprite) {
              action(action);
            }
          });
    }
    public void clearAll() {
      this.setVisible(false);
      ACTION = ACTION_DEFAULT;
      this.unregisterUpdateHandler(timerHandler);
      mCubicStartAniSprite.clearEntityModifiers();
      mCubicStartAniSprite.clearUpdateHandlers();
      mCubicStartAniSprite.stopAnimation(0);
      mCubicStartAniSprite.setVisible(false);

      mCubicTurnAniSprite.clearEntityModifiers();
      mCubicTurnAniSprite.clearUpdateHandlers();
      mCubicTurnAniSprite.stopAnimation(0);
      mCubicTurnAniSprite.setVisible(false);

      mCubicStopAniSprite.clearEntityModifiers();
      mCubicStopAniSprite.clearUpdateHandlers();
      mCubicStopAniSprite.stopAnimation(0);
      mCubicStopAniSprite.setVisible(false);

      mScrollLeftSprite.clearEntityModifiers();
      mScrollLeftSprite.setVisible(false);

      for (int i = 0; i < mCubicTurnOptionAniSprite.length; i++) {
        mCubicTurnOptionAniSprite[i].setVisible(false);
        mCubicTurnOptionAniSprite[i].clearEntityModifiers();
        mCubicTurnOptionAniSprite[i].clearUpdateHandlers();
        mCubicTurnOptionAniSprite[i].stopAnimation();
      }

      removePhysics(this);
    }
Exemplo n.º 6
0
  private void babyDring() {
    isHand = false;
    isUongSua = true;
    mMilkSprite.setVisible(false);
    mCryLeftSprite.setVisible(false);
    mCryRightSprite.setVisible(false);
    mCryLeftSprite.clearEntityModifiers();
    mCryRightSprite.clearEntityModifiers();
    A19_9B_5_NAKIGOE1.stop();
    A19_10_CHU.play();
    playSoundDelay(0.75f, A19_9D_5_WARAIGOE1);
    mFingerAnimatedSprite[4].animate(
        new long[] {750, 1200},
        new int[] {8, 9},
        0,
        new IAnimationListener() {

          @Override
          public void onAnimationFinished(AnimatedSprite arg0) {
            isHand = true;
            isUongSua = false;
            resetBaby();
            mFingerAnimatedSprite[4].setCurrentTileIndex(0);
          }

          @Override
          public void onAnimationFrameChanged(AnimatedSprite arg0, int arg1, int arg2) {
            // TODO Auto-generated method stub

          }

          @Override
          public void onAnimationLoopFinished(AnimatedSprite arg0, int arg1, int arg2) {
            // TODO Auto-generated method stub

          }

          @Override
          public void onAnimationStarted(AnimatedSprite arg0, int arg1) {
            // TODO Auto-generated method stub

          }
        });
  }
  @Override
  public void onResumeGame() {
    for (int i = 0; i < mCubicChooseSpite.length; i++) {
      mCubicChooseSpite[i].setVisible(true);
    }
    CUBIC_SLOT[0] = false;
    CUBIC_SLOT[1] = false;
    this.unregisterUpdateHandler(updateHandler);
    this.registerUpdateHandler(
        updateHandler =
            new IUpdateHandler() {

              @Override
              public void reset() {}

              @Override
              public void onUpdate(float f) {
                for (int i = 0; i < mCubicEntity.length; i++) {
                  if (mCubicEntity[i].isVisible()
                      && mCubicEntity[i].getCubicAction() >= CubicEntity.ACTION_TURN_LEVEL_1
                      && mCubicEntity[i].getCubicAction() <= CubicEntity.ACTION_TURN_FUNGI
                      && mShishiAniSprite.isVisible() == true
                      && mShishiAniSprite.collidesWith(mCubicEntity[i].getCubicBody())) {
                    Log.i(TAG, i + " va cham voi shishi ");
                    Vol3Osyougatsu.OGG_A3_A_6_GO.play();
                    Vol3Osyougatsu.OGG_A3_A_6_KACHIN.play();
                    mCubicEntity[i].stopTurn();
                  }
                }
              }
            });
    mArrowSprite.setVisible(true);
    mArrowSprite.clearEntityModifiers();
    mArrowSprite.registerEntityModifier(
        new LoopEntityModifier(
            new SequenceEntityModifier(
                new AlphaModifier(0.5f, 0.2f, 1.0f), new AlphaModifier(0.5f, 1.0f, 0.2f))));
    Log.i(TAG, "-- onResumeGame --");
  }
 public void newEvent(float pX, float pY, int pSlot) {
   mCubicChooseSpite[TYPE].setVisible(false);
   SLOT = pSlot;
   CUBIC_SLOT[SLOT] = true;
   checkArrow();
   this.setPosition(0, 100);
   ACTION = ACTION_DEFAULT;
   mCubicStartAniSprite.setVisible(true);
   mScrollLeftSprite.clearEntityModifiers();
   mScrollLeftSprite.registerEntityModifier(
       new LoopEntityModifier(
           new SequenceEntityModifier(
               new AlphaModifier(0.5f, 0.2f, 1.0f), new AlphaModifier(0.5f, 1.0f, 0.2f))));
   mScrollLeftSprite.setVisible(true);
   this.setVisible(true);
   final Body body = (Body) CubicEntity.this.getUserData();
   Vector2 vector2 =
       Vector2Pool.obtain(
           pX / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT,
           pY / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT);
   body.setTransform(vector2, 0);
   Vector2Pool.recycle(vector2);
 }
Exemplo n.º 9
0
 private void changeButtonColor(HudButton button, Color color) {
   Sprite target = this.getTargetedButton(button);
   target.clearEntityModifiers();
   target.registerEntityModifier(new ColorModifier(0.2f, target.getColor(), color));
 }