示例#1
0
        public override void update(float elapsed_tm)
        {
            if (Done)
            {
                return;
            }

            base.update(elapsed_tm);

            //线型点出鱼代码
            if (getGeneratorData().mStartTime < getPassedTime())
            {
                if (getGeneratorData().mAmount == 0)
                {
                    return;
                }

                EbVector3 start_point  = new EbVector3(getGeneratorData().mStartPointX, getGeneratorData().mStartPointY, 0);
                EbVector3 end_to_start = (new EbVector3(getGeneratorData().mEndPointX, getGeneratorData().mEndPointY, 0) - start_point);

                float     angle          = CLogicUtility.getRightAngle(CLogicUtility.getAngle(-end_to_start));
                EbVector3 delta_position = end_to_start / getGeneratorData().mAmount;
                for (int i = getGeneratorData().mAmount; i > 0; i--)
                {
                    BaseEntity entity = buildEntity(getGeneratorData().mFishVibID);
                    entity.setPosition(start_point + delta_position * i);
                    entity.setDirection(angle);
                }

                setDone();
            }
        }
示例#2
0
        public override void update(float elapsed_tm)
        {
            if (Done)
            {
                return;
            }

            base.update(elapsed_tm);

            //线型点出鱼代码
            if (getGeneratorData().mStartTime < getPassedTime())
            {
                if (getGeneratorData().mAmount == 0)
                {
                    return;
                }

                EbVector3 centre_position = new EbVector3(getGeneratorData().mStartPointX, getGeneratorData().mStartPointY, 0);
                float     delta_angle     = 360f / getGeneratorData().mAmount;
                int       fish_vib_id     = -1;

                for (int i = getGeneratorData().mAmount; i > 0; i--)
                {
                    if (getGeneratorData().mRedFishIndex == i - 1)
                    {
                        fish_vib_id = getGeneratorData().mRedFishVibId;
                        if (fish_vib_id <= 0)
                        {
                            fish_vib_id = getGeneratorData().mFishVibID;
                        }
                    }
                    else
                    {
                        fish_vib_id = getGeneratorData().mFishVibID;
                    }

                    EbVector3 point_position = centre_position + CLogicUtility.getDirection(90 + delta_angle * i) * getGeneratorData().mRadius;

                    BaseEntity entity = buildEntity(
                        fish_vib_id);
                    entity.setPosition(point_position);
                    entity.setDirection(CLogicUtility.getRightAngle(CLogicUtility.getAngle(point_position - centre_position)));

                    entity.setSpeed(getGeneratorData().mAngleSpeed * 2f * (float)Math.PI * getGeneratorData().mRadius / 360f);
                    entity.setAngleSpeed(getGeneratorData().mAngleSpeed);
                }

                setDone();
            }
        }
示例#3
0
        //-------------------------------------------------------------------------
        public CSpriteCounter(CRenderScene scene, EbVector3 origin_position, float up_angle)
        {
            mScene = scene;

            mCounterScruct.MovingSpeed     = 100f;
            mCounterScruct.OriginPosition  = origin_position;
            mCounterScruct.UpAngle         = up_angle;
            mCounterScruct.GapBetweenHeaps = mScene.getRenderConfigure().ChipHSpace;
            mCounterScruct.RightAngle      = CLogicUtility.getRightAngle(up_angle);
            mCounterScruct.RightDistance   = CLogicUtility.getDirection(mCounterScruct.RightAngle) * mCounterScruct.GapBetweenHeaps;
            mCounterState     = _eCounterState.Adding;
            mCSpriteHeapGroup = new CSpriteHeapGroup(4);

            mScoreCounterMap.create(mScene.getRenderConfigure().ScoreGap);
        }