Пример #1
0
        //---------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
            if (Done)
            {
                return;
            }

            base.update(elapsed_tm);

            if (getAffectorData().mStartTime <= SecondsSinceCreation)
            {
                IRoute route = RouteHelper.buildLineRoute(getAffectorData().mRouteVibId);

                foreach (var fish in getBaseEntity())
                {
                    if (!mEntities.Contains(fish))
                    {
                        fish.addRoute(route);
                        mEntities.Add(fish);
                    }
                }

                setDone();
            }
        }
Пример #2
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;
 }
Пример #3
0
        //---------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
            mOutFishDelay -= elapsed_tm;
            if (mOutFishDelay >= 0)
            {
                return;
            }
            if (Done)
            {
                return;
            }

            var list_serverparam   = getServerParam();
            int index              = -1;
            int normal_fish_vib_id = int.Parse(list_serverparam[++index]);
            int red_fish_vib_id    = int.Parse(list_serverparam[++index]);
            int red_fish_index     = int.Parse(list_serverparam[++index]);
            int fish_count         = int.Parse(list_serverparam[++index]);

            float position_x = float.Parse(list_serverparam[++index]);
            float position_y = float.Parse(list_serverparam[++index]);

            int red_fish_obj_id = int.Parse(list_serverparam[++index]);

            if (index + 2 == (int)getServerParam().Count)
            {
                position_x = float.Parse(list_serverparam[++index]);
                position_y = float.Parse(list_serverparam[++index]);
            }

            EbVector3 position = new EbVector3(position_x, position_y, 0);
            float     angle    = 360.0f / fish_count;

            for (int i = 0; i < fish_count; i++)
            {
                float direction           = angle * i;
                int   current_fish_vib_id = normal_fish_vib_id;
                if (i == red_fish_index)
                {
                    current_fish_vib_id = red_fish_vib_id;
                }

                BaseEntity entity = buildEntity(current_fish_vib_id);
                entity.addRoute(RouteHelper.buildLineRoute(position, CLogicUtility.getDirection(direction), 2000));
            }

            setDone();
        }
Пример #4
0
        //---------------------------------------------------------------------
        BaseEntity newBaseEntity(int fish_vib_id, int route_vib_id, float delay_time)
        {
            BaseEntity    entity = buildEntity(fish_vib_id);
            DynamicSystem system = getDynamicSystem(route_vib_id, delay_time);

            if (system == null)
            {
                entity.addRoute(RouteHelper.buildLineRoute(route_vib_id, delay_time));
            }
            else
            {
                entity.addDynamicSystem(system);
            }

            return(entity);
        }
Пример #5
0
        //-------------------------------------------------------------------------
        void _particleFixedTarget(StillParticle still_particle, TbDataFish.ParticleDataStruct particle_data, uint et_player_rpcid)
        {
            CRenderTurret turret         = mScene.getTurret(et_player_rpcid);
            EbVector3     start_position = EbVector3.Zero;

            if (particle_data.StartPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Fish)
            {
                start_position = mCRenderFish.Position;
            }
            else if (particle_data.StartPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Fixed)
            {
                start_position = new EbVector3(particle_data.StartPoint.x, particle_data.StartPoint.y, 0);
            }

            still_particle.setRoute(RouteHelper.buildLineRoute(
                                        start_position, new EbVector3(particle_data.TargetPoint.x, particle_data.TargetPoint.y, 0)), 200);
        }
Пример #6
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();
        }
Пример #7
0
        //---------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
            if (Done)
            {
                return;
            }

            base.update(elapsed_tm);

            //线型点出鱼代码
            if (getGeneratorData().mStartTime < getPassedTime())
            {
                EbVector3 position = new EbVector3(getGeneratorData().mStartPointX, getGeneratorData().mStartPointY, 0);

                BaseEntity entity = buildEntity(getGeneratorData().mFishVibID);
                entity.addRoute(RouteHelper.buildLineRoute(position, CLogicUtility.getDirection(getGeneratorData().mStartAngle), 1153.7f));
                entity.setSpeed(getGeneratorData().mSpeed);

                setDone();
            }
        }
Пример #8
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;
            }
        }