예제 #1
0
        public override void Update()
        {
            if (disabled)
            {
                return;
            }

            if (shootSchedule.IsOn())
            {
                float phase = shootSchedule.Phase();
                GridManager.Bloat(position + Vector2.Normalize(velocity) * (shootDistance * phase), 80.0f * phase, 0.07f, display);
                if (!wasShooting)
                {
                    animation.Play(1);
                }
                wasShooting = true;
            }
            else
            {
                wasShooting = false;
            }

            if (accelerationSchedule.IsOn())
            {
                acceleration = Randomizer.RandomVelocity(0.02f);
            }

            base.Update();
        }
예제 #2
0
        public override void Update()
        {
            if (disabled)
            {
                return;
            }

            if (bulgeSchedule.IsOn())
            {
                GridManager.Bloat(position, 100.0f, 0.1f, display);
                if (!wasBloating)
                {
                    animation.Play(1);
                }
                wasBloating = true;
            }
            else
            {
                wasBloating = false;
            }

            if (accelerationSchedule.IsOn())
            {
                acceleration = Randomizer.RandomVelocity(0.01f);
            }

            base.Update();
        }
예제 #3
0
        public override void Update()
        {
            if (disabled)
            {
                return;
            }

            if (accelerationSchedule.IsOn())
            {
                acceleration = Randomizer.RandomVelocity(0.05f);
            }

            base.Update();
        }
예제 #4
0
        public override void Update()
        {
            if (disabled)
            {
                return;
            }

            drag = capacity / normalCapacity;

            CollectResources();
            UpdateProjectiles();

            collectorAnim.Update(position);
            portalAnim.Update(position);
            poofAnim.Update(position);
            explodeAnim.Update(position);

            if (collected >= capacity)
            {
                Burst(true);
            }

            if (heartbeatSchedule.IsOn())
            {
                SendHeartbeat();
            }

            if (scale < targetScale)
            {
                scale += scaleRate;
            }

            if (!isDying && collectorAnim.sheet == (int)States.Static)
            {
                if (health <= 40)
                {
                    damage = 2;
                }
                else if (health <= 80)
                {
                    damage = 1;
                }
                else
                {
                    damage = 0;
                }
                collectorAnim.SetFrame(damage);
                base.Update();
            }
        }
예제 #5
0
        public void Update(Vector2 position, float rotation = 0f)
        {
            this.position = position;
            this.rotation = rotation;

            if (frameSchedule.IsOn() && playing)
            {
                animation[sequence].frame++;
                currentFrame = animation[sequence].frame;

                if (animation[sequence].frame >= animation[sequence].totalFrames)
                {
                    if (animation[sequence].loop)
                    {
                        Rewind();
                    }
                    else
                    {
                        Finish();
                    }
                    if (animDone != null)
                    {
                        animDone();
                    }
                }
                else if (animation[sequence].frame >= cols)
                {
                    int overshoot = animation[sequence].frame - cols + 1;
                    rowOffset = (int)Math.Ceiling((double)overshoot / (double)cols);
                }
                else
                {
                    rowOffset = 0;
                }
            }
        }