Beispiel #1
0
 public override void Activate()
 {
     Audio.Play("enemy.spawn3", display);
     shootSchedule        = new Schedualizer(1.0f, 5f, 10f);
     accelerationSchedule = new Schedualizer(0.0f, 3f, 6f);
     base.Activate();
 }
Beispiel #2
0
        public Collector(int idNumber) : base()
        {
            id = idNumber;

            position = new Vector2(
                Randomizer.RandomInt(spawnBuffer, (int)ScreenManager.window.X - spawnBuffer),
                Randomizer.RandomInt(spawnBuffer, (int)ScreenManager.window.Y - spawnBuffer)
                );

            display           = Randomizer.RandomDisplay();
            normalCapacity    = capacity;
            dampening         = 0.9f;
            heartbeatSchedule = new Schedualizer(0f, 5f, 5f);
            scale             = 0.3f;
            targetScale       = scale;
            teamColour        = TeamColour.Get();

            SetupAnimations();
            SendHeartbeat();

            audioTimeout.Elapsed += new ElapsedEventHandler(audioTimeout_Elapsed);

            Audio.Play("collector.spawn", display);

            users       = new List <User>();
            projectiles = new List <Projectile>();
        }
Beispiel #3
0
 public override void Activate()
 {
     bulgeSchedule        = new Schedualizer(0.5f, 5f, 10f);
     accelerationSchedule = new Schedualizer(0.0f, 1f, 3f);
     Audio.Play("enemy.spawn1", display);
     base.Activate();
 }
Beispiel #4
0
 public Resource(Vector3 location, string modelName, float speed)
 {
     model         = ContentManager.Model(modelName);
     this.speed    = speed;
     this.location = location;
     addDelay      = new Schedualizer(0, 1, 30);
     rotation      = Vector3.Zero;
 }
Beispiel #5
0
        public Enemy() : base()
        {
            wrapY    = true;
            height   = 0;
            velocity = Randomizer.RandomVelocity();

            position  = new Vector2(Randomizer.RandomFloat(0, ScreenManager.window.X), -wrapBuffer);
            display   = Randomizer.RandomDisplay();
            dampening = 0.985f;
            addDelay  = new Schedualizer(0, 1, 40);

            Animation[] stateAnimations =
            {
                new Animation(0, 40, false)
            };
            explosion = new AnimSprite("enemy_explosion", new Point(100, 75), stateAnimations);
        }
Beispiel #6
0
        public AnimSprite(string spriteName, Point frameSize, Animation[] animation, Texture2D sprite = null)
        {
            if (sprite == null)
            {
                this.sprite = ContentManager.Sprite(spriteName);
            }
            else
            {
                this.sprite = sprite;
            }

            delay         = 1 / 24f;
            spriteBatch   = ScreenManager.spriteBatch;
            frameSchedule = new Schedualizer(0.0f, delay, delay);
            frameOffset   = new Vector2(frameSize.X, frameSize.Y) * 0.5f;
            cols          = this.sprite.Width / frameSize.X;

            this.animation = animation;
            this.frameSize = frameSize;
        }
Beispiel #7
0
 public override void Activate()
 {
     accelerationSchedule = new Schedualizer(0.0f, 0f, 2f);
     Audio.Play("enemy.spawn2", display);
     base.Activate();
 }