Exemplo n.º 1
0
        protected void ExecuteEvent(int currentTime)
        {
            for (int i = 0; i < currentEvent.Count; i++)
            {
                BarrageEvent be = currentEvent[i];
                switch (be.eAttribute)
                {
                case Attribute.SPEED:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(speed);
                    }
                    speed = be.Update(speed, currentTime);
                    break;

                case Attribute.SPEEDDIRECT:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(speedDirection);
                    }
                    speedDirection = be.Update(speedDirection, currentTime);
                    break;

                default: break;
                }
                if (currentTime >= be.spendTime + be.startFrame)
                {
                    currentEvent.RemoveAt(i);
                    i--;
                }
            }//end for
        }
Exemplo n.º 2
0
        protected void ExecuteEvent(int currentTime)
        {
            for (int i = 0; i < currentEvent.Count; i++)
            {
                BarrageEvent be = currentEvent[i];
                switch (be.eAttribute)
                {
                case Attribute.ACC:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(laserData.acceleration);
                    }
                    laserData.acceleration = be.Update(laserData.acceleration, currentTime);
                    break;

                case Attribute.SPEED:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(laserData.speed);
                    }
                    laserData.speed = be.Update(laserData.speed, currentTime);
                    break;

                case Attribute.SPEEDDIRECT:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(laserData.speedDirec);
                    }
                    laserData.speedDirec = be.Update(laserData.speedDirec, currentTime);
                    break;

                case Attribute.WIDTH:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(laserData.width);
                    }
                    laserData.width = (int)be.Update((float)laserData.width, currentTime);
                    break;

                case Attribute.SELFSNIPE:
                    if (be.result == "开")
                    {
                        this.isSelfSnipe = true;
                    }
                    else
                    {
                        this.isSelfSnipe = false;
                    }
                    break;

                default: break;
                }
                if (currentTime >= be.spendTime + be.startFrame)
                {
                    currentEvent.RemoveAt(i);
                    i--;
                }
            }//end for
        }
Exemplo n.º 3
0
        protected void ExecuteEvent(int currentTime)
        {
            for (int i = 0; i < currentEvent.Count; i++)
            {
                BarrageEvent be = currentEvent[i];
                switch (be.eAttribute)
                {
                case Attribute.ACC:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(bulletData.acceleration);
                    }
                    bulletData.acceleration = be.Update(bulletData.acceleration, currentTime);
                    if (be.isRandom)
                    {
                        randomEventAcc = (float)ran.NextDouble() * (be.randomEnd - be.randomStart) + be.randomStart;
                    }
                    break;

                case Attribute.SPEED:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(bulletData.speed);
                    }
                    bulletData.speed = be.Update(bulletData.speed, currentTime);
                    if (be.isRandom)
                    {
                        randomEventSpeed = (float)ran.NextDouble() * (be.randomEnd - be.randomStart) + be.randomStart;
                    }
                    break;

                case Attribute.SPEEDDIRECT:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(bulletData.speedDirec);
                    }
                    bulletData.speedDirec = be.Update(bulletData.speedDirec, currentTime);
                    if (be.isRandom)
                    {
                        randomEventSpeedDirec = (float)ran.NextDouble() * (be.randomEnd - be.randomStart) + be.randomStart;
                    }
                    break;

                case Attribute.FREQUENCY:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.frequency);
                    }
                    this.frequency = (int)be.Update(this.frequency, currentTime);
                    break;

                case Attribute.RANDOMRADIUS:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.randomRadius);
                    }
                    this.randomRadius = (int)be.Update(this.randomRadius, currentTime);

                    break;

                case Attribute.POSITION:
                    this.BindSprite(target);
                    this.relativePosition = Vector2.Zero;
                    break;

                default: break;
                }
                if (currentTime >= be.spendTime + be.startFrame)
                {
                    currentEvent.RemoveAt(i);
                    i--;
                }
            }
        }
Exemplo n.º 4
0
        void ExecuteEvent(int currentTime)
        {
            for (int i = 0; i < currentEvent.Count; i++)
            {
                BarrageEvent be = currentEvent[i];
                switch (be.eAttribute)
                {
                case Attribute.ID:
                    setID(Convert.ToInt32(be.result));
                    break;

                case Attribute.DIRECTTYPE:
                    this.directType = StringToDirectType(be.result);
                    break;

                case Attribute.HEADANGLE:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.bulletHeadAngle);
                    }
                    this.bulletHeadAngle = be.Update(bulletHeadAngle, currentTime);
                    break;

                case Attribute.ACC:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.acceleration);
                    }
                    this.acceleration = be.Update(acceleration, currentTime);
                    break;

                case Attribute.ACCDIRECT:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.accelerationDegree);
                    }
                    this.accelerationDegree = be.Update(accelerationDegree, currentTime);
                    break;

                case Attribute.SPEED:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(this.speed);
                    }
                    this.speed = be.Update(speed, currentTime);
                    break;

                case Attribute.SPEEDDIRECT:
                    if (be.startFrame == currentTime)
                    {
                        be.setOriginValue(getSpeedDirection());
                    }
                    this.speedDirection = be.Update(getSpeedDirection(), currentTime);
                    setSpeedDireciont(this.speedDirection);
                    break;

                default: break;
                }
                if (currentTime >= be.spendTime + be.startFrame)
                {
                    currentEvent.RemoveAt(i);
                    --i;
                }
            }
        }