Exemple #1
0
 //-------------------------------------------------------------------------
 public void update(float elapsed_tm)
 {
     if (mIsNeedAutoDestroy)
     {
         mTimeCounter += elapsed_tm;
         if (mTimeCounter >= mFunDelayTime)
         {
             remove(this);
         }
         else if (mNeedFadeout)
         {
             mAlpha -= elapsed_tm / mFadeoutFunDelayTime;
             mCSpriteNumber.setAlpha(mAlpha);
         }
         else
         {
             mMassEntity.update(elapsed_tm);
             mCSpriteNumber.setPosition(mMassEntity.Position, 0);
             if (mMassEntity.IsEndRoute)
             {
                 mNeedFadeout = true;
             }
         }
     }
 }
 //-------------------------------------------------------------------------
 public void update(float elapsed_tm)
 {
     if (mMassEntity == null)
     {
         return;
     }
     mMassEntity.update(elapsed_tm);
     setPosition(mMassEntity.Position);
     setDirection(mMassEntity.Angle);
     if (mMassEntity.IsOutScreen || mMassEntity.IsEndRoute)
     {
         mCanDestroy = true;
     }
 }
Exemple #3
0
    //-------------------------------------------------------------------------
    void _updateFireAnimation(float elapsed_tm)
    {
        if (mIsFireAnimation)
        {
            mMassEntity.update(elapsed_tm);
            mTurretBarrelSprite.setPosition(mMassEntity.Position);
            mTurretBarrelSprite.setDirection(mMassEntity.Angle);

            if (!mMassEntity.IsEndRoute)
            {
                return;
            }

            mIsFireAnimation = false;
            mTurretBlazeSprite.setActive(false);
        }
    }
Exemple #4
0
    //-------------------------------------------------------------------------
    void moveHeaps(float elapsed_tm)
    {
        if (mMassEntity == null)
        {
            return;
        }

        mOldPositon = mMassEntity.Position;
        mMassEntity.update(elapsed_tm);

        mCSpriteHeapGroup.translate(mMassEntity.Position - mOldPositon);

        if (mMassEntity.IsEndRoute)
        {
            mCSpriteHeapGroup.swapHeaps();
            mCounterState = _eCounterState.Adding;
            mMassEntity   = null;
        }
    }