Groups a set of sprites in a sequence that can be animated
Exemple #1
0
        protected override List<AnimationSequence> EnsureSequences(Scene scene)
        {
            List<AnimationSequence> sequences = new List<AnimationSequence>();
            AnimationSequence sequence = new AnimationSequence();
            ImageElement image = scene.LoadImage("Images/Race/obstacles/r1.png", false);
            sequence.AddSprite(image, 47, 78);
            sequences.Add(sequence);

            sequence = new AnimationSequence();
            image = scene.LoadImage("Images/Race/obstacles/r2.png", false);
            sequence.AddSprite(image, 47, 78);
            sequences.Add(sequence);

            sequence = new AnimationSequence();
            image = scene.LoadImage("Images/Race/obstacles/r3.png", false);
            sequence.AddSprite(image, 39, 77);
            sequences.Add(sequence);

            sequence = new AnimationSequence();
            image = scene.LoadImage("Images/Race/obstacles/r4.png", false);
            sequence.AddSprite(image, 50, 79);
            sequences.Add(sequence);

            sequence = new AnimationSequence();
            image = scene.LoadImage("Images/Race/obstacles/r5.png", false);
            sequence.AddSprite(image, 46, 74);
            sequences.Add(sequence);

            sequence = new AnimationSequence();
            image = scene.LoadImage("Images/Race/obstacles/r6.png", false);
            sequence.AddSprite(image, 47, 84);
            sequences.Add(sequence);

            return sequences;
        }
        public BigSaucer(IMotion motion)
            : base(motion)
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/saucer/0001.png", false),
                    level.LoadImage("images/shooter/saucer/0001.2.png", false),
                    level.LoadImage("images/shooter/saucer/0001.png", false),
                    level.LoadImage("images/shooter/saucer/0001.3.png", false)
                }, 73, 32);
            sequence.Delay = 300;
            sequence.Loop = true;
            AnimationSequences[DefaultAnimation] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/saucer/0003.png", false),
                    level.LoadImage("images/shooter/saucer/0004.png", false),
                    level.LoadImage("images/shooter/saucer/0005.png", false),
                    level.LoadImage("images/shooter/saucer/0006.png", false),
                    level.LoadImage("images/shooter/saucer/0007.png", false),
                    level.LoadImage("images/shooter/saucer/0008.png", false),
                    level.LoadImage("images/shooter/saucer/0009.png", false),
                    level.LoadImage("images/shooter/saucer/0010.png", false)
                }, 150, 62);
            sequence.Delay = 50;
            sequence.Loop = false;
            AnimationSequences[ExplosionAnimation] = sequence;

            StartAnimation(DefaultAnimation);

            Life = 16;
        }
Exemple #3
0
        public Boss(IMotion motion, BossGun topGun, BossGun middleGun, BossGun bottomGun)
            : base(motion)
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/boss/boss.png", false)
                }, 0, 133);
            sequence.Delay = 200;
            sequence.Loop = true;
            AnimationSequences[DefaultAnimation] = sequence;

            _topGun = topGun;
            _middleGun = middleGun;
            _bottomGun = bottomGun;

            sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/boss/boss.png", false)
                }, 0, 133);
            sequence.Delay = 500;
            sequence.Loop = true;
            AnimationSequences[ExplosionAnimation] = sequence;

            StartAnimation(DefaultAnimation);

            Life = 300;
        }
Exemple #4
0
 public Bullet(Vector2D location, int strength, IMotion motion)
     : base(location, motion)
 {
     AnimationSequence sequence = new AnimationSequence();
     sequence.AddSprite(ShooterLevel.Current.LoadImage((strength == 1)? "images/shooter/meteor/sb.png" : "images/shooter/meteor/b.png", false), 0, 0);
     AnimationSequences["Default"] = sequence;
     StartAnimation("Default");
     _strength = strength;
 }
 public static GameObject Create(ImageElement defaultImage, float handleX, float handleY)
 {
     GameObject gameObject = new GameObject();
     AnimationSequence sequence = new AnimationSequence();
     sequence.AddSprite(defaultImage, handleX, handleY);
     gameObject.AnimationSequences["Default"] = sequence;
     gameObject.StartAnimation("Default");
     return gameObject;
 }
Exemple #6
0
        protected override List<AnimationSequence> EnsureSequences(Scene scene)
        {
            List<AnimationSequence> sequences = new List<AnimationSequence>();
            AnimationSequence sequence = new AnimationSequence();
            ImageElement image = scene.LoadImage("Images/Race/obstacles/pole.png", false);
            sequence.AddSprite(image, 10, 80);
            sequences.Add(sequence);

            return sequences;
        }
 public BasicPlasmaBall(Vector2D location, IMotion motion)
     : base(location, motion)
 {
     ShooterLevel level = ShooterLevel.Current;
     AnimationSequence sequence = new AnimationSequence();
     sequence.AddSprites(new ImageElement[]{
             level.LoadImage("images/shooter/plasma/1.png", false),
             level.LoadImage("images/shooter/plasma/2.png", false),
             level.LoadImage("images/shooter/plasma/3.png", false),
             level.LoadImage("images/shooter/plasma/2.png", false)
         }, 6, 6);
     sequence.Loop = true;
     sequence.Delay = 200;
     AnimationSequences["Default"] = sequence;
     StartAnimation("Default");
 }
Exemple #8
0
        public Missile(Vector2D location)
            : base(location, new SeekMotion(null, 12, new Vector2D(12, 0), 0.25f))
        {
            WeaponsSystem.TotalMissiles++;

            LoadAnimation("00", "8");
            LoadAnimation("01", "9");
            LoadAnimation("02", "10");
            LoadAnimation("03", "11");
            LoadAnimation("04", "12");
            LoadAnimation("05", "13");
            LoadAnimation("06", "14");
            LoadAnimation("07", "15");
            LoadAnimation("08", "0");
            LoadAnimation("09", "1");
            LoadAnimation("10", "2");
            LoadAnimation("11", "3");
            LoadAnimation("12", "4");
            LoadAnimation("13", "5");
            LoadAnimation("14", "6");
            LoadAnimation("15", "7");

            StartAnimation("0");

            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/explosion/0002.png", false),
                    level.LoadImage("images/shooter/explosion/0003.png", false),
                    level.LoadImage("images/shooter/explosion/0004.png", false),
                    level.LoadImage("images/shooter/explosion/0005.png", false),
                    level.LoadImage("images/shooter/explosion/0006.png", false),
                    level.LoadImage("images/shooter/explosion/0007.png", false),
                    level.LoadImage("images/shooter/explosion/0008.png", false),
                    level.LoadImage("images/shooter/explosion/0009.png", false)
                }, 25, 25);
            sequence.Delay = 50;
            sequence.Loop = false;
            AnimationSequences["Explosion"] = sequence;

            Dino dino = AcquireTarget();
            if (dino != null) dino.Locked = true;
            ((SeekMotion)Motion).Target = AcquireTarget();
        }
Exemple #9
0
        public Pteranodon(IMotion motion)
            : base(motion)
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/ptera/0001.png", false),
                    level.LoadImage("images/shooter/ptera/0002.5.png", false),
                    level.LoadImage("images/shooter/ptera/0002.png", false),
                    level.LoadImage("images/shooter/ptera/0002.5.png", false),
                    level.LoadImage("images/shooter/ptera/0001.png", false),
                    level.LoadImage("images/shooter/ptera/0003.5.png", false),
                    level.LoadImage("images/shooter/ptera/0003.png", false),
                    level.LoadImage("images/shooter/ptera/0003.5.png", false)
                }, 0, 0);
            sequence.Delay = 200;
            sequence.Loop = true;
            AnimationSequences[DefaultAnimation] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/ptera/0005.png", false),
                    level.LoadImage("images/shooter/ptera/0006.png", false),
                    level.LoadImage("images/shooter/ptera/0007.png", false),
                    level.LoadImage("images/shooter/ptera/0008.png", false),
                    level.LoadImage("images/shooter/ptera/0009.png", false),
                    level.LoadImage("images/shooter/ptera/0010.png", false),
                    level.LoadImage("images/shooter/ptera/0011.png", false),
                    level.LoadImage("images/shooter/ptera/0012.png", false),
                    level.LoadImage("images/shooter/ptera/0013.png", false),
                    level.LoadImage("images/shooter/ptera/0014.png", false),
                    level.LoadImage("images/shooter/ptera/0015.png", false)
                }, 0, 0);
            sequence.Delay = 50;
            sequence.Loop = false;
            AnimationSequences[ExplosionAnimation] = sequence;

            StartAnimation(DefaultAnimation);

            Life = 4;
        }
Exemple #10
0
        public BossGun(IMotion motion)
            : base(motion)
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprite(level.LoadImage("images/shooter/boss/gun1.png", false), 79, 45);
            sequence.Delay = 0;
            AnimationSequences[DefaultAnimation] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprite(level.LoadImage("images/shooter/boss/gun2.png", false), 79, 1);
            sequence.Delay = 0;
            AnimationSequences["Gun2"] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprite(level.LoadImage("images/shooter/boss/gun3.png", false), 100, 21);
            sequence.Delay = 0;
            AnimationSequences["Gun3"] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                level.LoadImage("images/shooter/boss/0001.png", false),
                level.LoadImage("images/shooter/boss/0002.png", false),
                level.LoadImage("images/shooter/boss/0003.png", false),
                level.LoadImage("images/shooter/boss/0004.png", false),
                level.LoadImage("images/shooter/boss/0005.png", false),
                level.LoadImage("images/shooter/boss/0006.png", false),
                level.LoadImage("images/shooter/boss/0007.png", false),
                level.LoadImage("images/shooter/boss/0008.png", false),
                level.LoadImage("images/shooter/boss/0009.png", false),
            }, 50, 50);
            sequence.Delay = 50;
            sequence.Loop = false;
            AnimationSequences[ExplosionAnimation] = sequence;

            StartAnimation(DefaultAnimation);

            Life = 150;
        }
Exemple #11
0
        public Explosion()
            : base()
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                level.LoadImage("images/shooter/boss/0001.png", false),
                level.LoadImage("images/shooter/boss/0002.png", false),
                level.LoadImage("images/shooter/boss/0003.png", false),
                level.LoadImage("images/shooter/boss/0004.png", false),
                level.LoadImage("images/shooter/boss/0005.png", false),
                level.LoadImage("images/shooter/boss/0006.png", false),
                level.LoadImage("images/shooter/boss/0007.png", false),
                level.LoadImage("images/shooter/boss/0008.png", false),
                level.LoadImage("images/shooter/boss/0009.png", false),
            }, 50, 50);
            sequence.Delay = 50;
            sequence.Loop = true;
            AnimationSequences["Default"] = sequence;

            StartAnimation("Default");
        }
Exemple #12
0
        public Gun(IMotion motion)
            : base(motion)
        {
            ShooterLevel level = ShooterLevel.Current;
            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/gun/0000.png", false),
                    level.LoadImage("images/shooter/gun/0001.png", false),
                    level.LoadImage("images/shooter/gun/0002.png", false),
                    level.LoadImage("images/shooter/gun/0003.png", false),
                    level.LoadImage("images/shooter/gun/0004.png", false),
                    level.LoadImage("images/shooter/gun/0005.png", false),
                    level.LoadImage("images/shooter/gun/0006.png", false),
                    level.LoadImage("images/shooter/gun/0007.png", false),
                    level.LoadImage("images/shooter/gun/0008.png", false)
                }, 52, 73);
            sequence.Delay = 0;
            AnimationSequences[DefaultAnimation] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprites(new ImageElement[]{
                    level.LoadImage("images/shooter/gun/e0003.png", false),
                    level.LoadImage("images/shooter/gun/e0004.png", false),
                    level.LoadImage("images/shooter/gun/e0005.png", false),
                    level.LoadImage("images/shooter/gun/e0006.png", false),
                    level.LoadImage("images/shooter/gun/e0007.png", false),
                    level.LoadImage("images/shooter/gun/e0008.png", false),
                    level.LoadImage("images/shooter/gun/e0009.png", false),
                    level.LoadImage("images/shooter/gun/e0010.png", false)
                }, 60, 73);
            sequence.Delay = 50;
            sequence.Loop = false;
            AnimationSequences[ExplosionAnimation] = sequence;

            StartAnimation(DefaultAnimation);

            Life = 8;
        }
        public override void Init(Scene level)
        {
            _level = (ShooterLevel)level;
            Ship = new GameObject();

            AnimationSequence sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/shooter/meteor/2.png", true), 0, 0);
            Ship.AnimationSequences["Default"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/shooter/meteor/3.png", true), 0, 0);
            Ship.AnimationSequences["Up"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/shooter/meteor/1.png", true), 0, 0);
            Ship.AnimationSequences["Down"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 40;
            sequence.Loop = false;
            sequence.AddSprites(new ImageElement[] {
                    _level.LoadImage("Images/shooter/meteor/e1.png", false),
                    _level.LoadImage("Images/shooter/meteor/e5.png", false),
                    _level.LoadImage("Images/shooter/meteor/e9.png", false),
                    _level.LoadImage("Images/shooter/meteor/e13.png", false),
                    _level.LoadImage("Images/shooter/meteor/e17.png", false)
                }, 0, 0);
            Ship.AnimationSequences["Crash"] = sequence;
            Ship.AnimationCompleted += new AnimationCompletedEventHandler(Ship_AnimationCompleted);

            _speed = 0.15f;

            Ship.Location = new Vector3D(20, 390, ShooterLevel.MeteorZ);
            Ship.StartAnimation("Default");
        }
Exemple #14
0
 private void LoadAnimation(string number, string name)
 {
     ShooterLevel level = ShooterLevel.Current;
     AnimationSequence sequence = new AnimationSequence();
     sequence.AddSprites(new ImageElement[]{
             level.LoadImage("images/shooter/missile/" + number + "00.png", false),
             level.LoadImage("images/shooter/missile/" + number + "01.png", false),
             level.LoadImage("images/shooter/missile/" + number + "02.png", false)
         }, 30, 30);
     AnimationSequences[name] = sequence;
 }
Exemple #15
0
        private void EnsureAnimationSequences()
        {
            if (_animationSequences != null) return;

            _animationSequences = new Dictionary();

            AnimationSequence sequence = new AnimationSequence();
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/1.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/2.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/3.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/4.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/5.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/6.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc1/7.png", false), 252 / 2, 116);
            _animationSequences["Npc1"] = sequence;

            sequence = new AnimationSequence();
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/1.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/2.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/3.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/4.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/5.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/6.png", false), 252 / 2, 116);
            sequence.AddSprite(_level.LoadImage("Images/Race/npc2/7.png", false), 252 / 2, 116);
            _animationSequences["Npc2"] = sequence;
        }
Exemple #16
0
        public override void Init(Scene level)
        {
            _level = (RaceLevel)level;

            CarObject = new GameObject();

            AnimationSequence sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c1.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c1_2.png", false), 165, 134);
            CarObject.AnimationSequences["Forward"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c1.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c1_2.png", false), 165, 134);
            CarObject.AnimationSequences["b-Forward"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c3.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c3_2.png", false), 165, 134);
            CarObject.AnimationSequences["Left"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c3.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c3_2.png", false), 165, 134);
            CarObject.AnimationSequences["b-Left"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c13.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c13_2.png", false), 165, 134);
            CarObject.AnimationSequences["Right"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c13.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/b-c13_2.png", false), 165, 134);
            CarObject.AnimationSequences["b-Right"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 100;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c1.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c5.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c6.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c7.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c8.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c9.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c10.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c11.png", false), 165, 134);
            sequence.Loop = false;
            CarObject.AnimationSequences["Crash"] = sequence;

            sequence = new AnimationSequence();
            sequence.Delay = 200;
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c11.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c10.png", false), 165, 134);
            sequence.AddSprite(_level.LoadImage("Images/Race/car/c9.png", false), 165, 134);
            sequence.Loop = false;
            CarObject.AnimationSequences["Skid"] = sequence;

            CarObject.StartAnimation("Forward");
            CarObject.AnimationCompleted += new AnimationCompletedEventHandler(AnimationCompleted);
        }