예제 #1
0
        //---------------------------------------------------------------------
        void _initDieRoute()
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(mRenderFish.Position, 0, 0.6f, mRenderFish.jumpDistance());
            mMassEntity.setRoute(route);
        }
예제 #2
0
        //-------------------------------------------------------------------------
        void _initRoute(EbVector3 init_position, float init_direction)
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(init_position, init_direction, 0.4f, 20f);
            mMassEntity.setRoute(route);
        }
예제 #3
0
 //-------------------------------------------------------------------------
 public void setRoute(IRoute route, float speed)
 {
     if (mMassEntity == null)
     {
         mMassEntity = new MassEntity();
     }
     mMassEntity.setRoute(route);
     mMassEntity.setSpeed(speed);
     update(0);
 }
예제 #4
0
        //-------------------------------------------------------------------------
        public void dieByFullBomb(EbVector3 dest_pos)
        {
            if (mIsDie)
            {
                return;
            }

            mNotNeedDestroyParticle = true;

            mISpriteFish.setTrigger(false);
            mISpriteFish.playRotationAnimation();
            mSpriteFreeFromTimeFactor = true;
            mMassEntity.setRoute(RouteHelper.buildLineRoute(mMassEntity.Position, dest_pos));
            float speed = mMassEntity.Position.getDistance(dest_pos) / mSecondsSinceFullScreenBomb;

            mMassEntity.setSpeed(speed);
            setSurvivalTime(mSecondsSinceFullScreenBomb);
            signDie();
        }
예제 #5
0
 //-------------------------------------------------------------------------
 void initMove(int move_step)
 {
     if (move_step <= 0)
     {
         return;
     }
     mMassEntity = new MassEntity();
     mMassEntity.setSpeed(mCounterScruct.MovingSpeed);
     mMassEntity.setRoute(RouteHelper.buildLineRoute(EbVector3.Zero, mCounterScruct.RightDistance * move_step));
     mCounterState = _eCounterState.Moving;
 }
예제 #6
0
        //-------------------------------------------------------------------------
        void _playFireAnimation()
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(mRenderTurret.getTurretPos(), mRenderTurret.getTurretAngle(), 0.1f, -13f);
            mMassEntity.setRoute(route);
            mIsFireAnimation = true;
            mTurretBlazeSprite.setActive(true);
            mTurretBlazeSprite.setPosition(mRenderTurret.getTurretPos());
            mTurretBlazeSprite.setDirection(mRenderTurret.getTurretAngle());
        }
예제 #7
0
        //-------------------------------------------------------------------------
        public void switchBackground(string prefab_name, float already_update_time)
        {
            if (mBgMgr == null)
            {
                _loadBgSprite(prefab_name);
                if (onLoadMapEnd != null)
                {
                    onLoadMapEnd();
                }
            }
            else
            {
                if (mIsSwitching)
                {
                    if (!mHasEarlyClean)
                    {
                        mScene.getLevel().clearAllFish();
                    }
                    switchBackgroundPic();
                    mWaveStillSprite.setActive(false);
                    mIsSwitching = false;
                }
                mAlreadyUpdateTime = already_update_time;
                mBgMgr.mBgClippedSprite.ClipRect = new Rect(1, 0, 1, 1);
                _loadFgSprite(prefab_name);

                mMassEntity = new MassEntity();
                mMassEntity.setSpeed(mSpeed);
                mMassEntity.setRoute(RouteHelper.buildLineRoute(new EbVector3(650, 0, 0), CLogicUtility.getDirection(-90), 2000));
                mWaveStillSprite.setActive(true);
                mWaveStillSprite.setDirection(-90);
                mWaveStillSprite.setPosition(new EbVector3(650, 0, 0));
                mWaveStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Ripple));

                mIsSwitching   = true;
                mHasEarlyClean = false;
            }
        }
예제 #8
0
 //---------------------------------------------------------------------
 void _initDieRoute()
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(mRenderFish.Position, 0, 0.6f, mRenderFish.jumpDistance());
     mMassEntity.setRoute(route);
 }
예제 #9
0
 //-------------------------------------------------------------------------
 void _initRoute(EbVector3 init_position, float init_direction)
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(init_position, init_direction, 0.4f, 20f);
     mMassEntity.setRoute(route);
 }
예제 #10
0
        //-------------------------------------------------------------------------
        public void switchBackground(string prefab_name, float already_update_time)
        {
            if (mBgMgr == null)
            {
                _loadBgSprite(prefab_name);
                if (onLoadMapEnd != null) onLoadMapEnd();
            }
            else
            {
                if (mIsSwitching)
                {
                    if (!mHasEarlyClean)
                    {
                        mScene.getLevel().clearAllFish();
                    }
                    switchBackgroundPic();
                    mWaveStillSprite.setActive(false);
                    mIsSwitching = false;
                }
                mAlreadyUpdateTime = already_update_time;
                mBgMgr.mBgClippedSprite.ClipRect = new Rect(1, 0, 1, 1);
                _loadFgSprite(prefab_name);

                mMassEntity = new MassEntity();
                mMassEntity.setSpeed(mSpeed);
                mMassEntity.setRoute(RouteHelper.buildLineRoute(new EbVector3(650, 0, 0), CLogicUtility.getDirection(-90), 2000));
                mWaveStillSprite.setActive(true);
                mWaveStillSprite.setDirection(-90);
                mWaveStillSprite.setPosition(new EbVector3(650, 0, 0));
                mWaveStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Ripple));

                mIsSwitching = true;
                mHasEarlyClean = false;
            }
        }
예제 #11
0
 //-------------------------------------------------------------------------
 void _playFireAnimation()
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(mRenderTurret.getTurretPos(), mRenderTurret.getTurretAngle(), 0.1f, -13f);
     mMassEntity.setRoute(route);
     mIsFireAnimation = true;
     mTurretBlazeSprite.setActive(true);
     mTurretBlazeSprite.setPosition(mRenderTurret.getTurretPos());
     mTurretBlazeSprite.setDirection(mRenderTurret.getTurretAngle());
 }
예제 #12
0
 //-------------------------------------------------------------------------
 void initMove(int move_step)
 {
     if (move_step <= 0) return;
     mMassEntity = new MassEntity();
     mMassEntity.setSpeed(mCounterScruct.MovingSpeed);
     mMassEntity.setRoute(RouteHelper.buildLineRoute(EbVector3.Zero, mCounterScruct.RightDistance * move_step));
     mCounterState = _eCounterState.Moving;
 }
예제 #13
0
 //-------------------------------------------------------------------------
 public void addRoute(IRoute route)
 {
     mMassEntity.setRoute(route);
 }