public void SpawnEnnemy(Animation animation, GameTime gameTime)
        {
            var ennemy2 = new Ennemy("Ennemy1", 1000);

            ennemy2.SetScene(this);
            ennemy2.SetColor(Color.Red);
            ennemy2.SetSize(24, 24);
            ennemy2.SetSpeedMax(100);
            ennemy2.SetPosition(100, 100);
            ForegroundLayer.AddSprite(ennemy2.Sprite);

            var animation21 = new MoveAnimation(new Vector2(100, 100), new Vector2(100, 600));
            var animation22 = new MoveAnimation(new Vector2(100, 600), new Vector2(600, 600));
            var animation23 = new MoveAnimation(new Vector2(600, 600), new Vector2(600, 100));
            var animation24 = new MoveAnimation(new Vector2(600, 100), new Vector2(900, 100));
            var animation25 = new MoveAnimation(new Vector2(900, 100), new Vector2(900, 600));

            var animSequence2 = new AnimationSequence();

            animSequence2.AddAnimation(animation21);
            animSequence2.AddAnimation(animation22);
            animSequence2.AddAnimation(animation23);
            animSequence2.AddAnimation(animation24);
            animSequence2.AddAnimation(animation25);

            ennemy2.AttachAnimation(animSequence2);

            this.AnimationManager.AddAnimation(animSequence2);

            _ennemies.Add(ennemy2);
        }
Example #2
0
        public void RevealCell(Cell cell, int x, int y, bool animated = true)
        {
            var datum = new RevealAnimationDatum(cell, x, y);

            if (animated)
            {
                _revealSequence.AddAnimation(datum);
            }
            else
            {
                PlayRevealAnimation(datum);
            }
        }