Exemplo n.º 1
0
        //---------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
            if (Done)
            {
                return;
            }

            base.update(elapsed_tm);

            if (getAffectorData().mStartTime <= SecondsSinceCreation)
            {
                int    random_route_vib_id = mRandom.Next(getAffectorData().mMinRouteVibId, getAffectorData().mMaxRouteVibId + 1);
                IRoute route = RouteHelper.buildLineRoute(random_route_vib_id);

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

                setDone();
            }
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 5
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();
            }
        }