public override void TodoOnDeath()
        {
            //Free a PoulpiSnow
            MovePattern mp = new MovePattern();

            switch (this.Flip)
            {
            case SpriteEffects.FlipHorizontally:
                mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2);
                mp.AddPoint((int)TGPAContext.Instance.ScreenWidth + 1, (int)TGPAContext.Instance.ScreenHeight / 2);
                break;

            case SpriteEffects.None:
                mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2);
                mp.AddPoint(-500, (int)TGPAContext.Instance.ScreenHeight / 2);
                break;
            }

            Snow s = new Snow(this.location, RandomMachine.GetRandomVector2(-100f, 20f, 50f, -300f), 800f, RandomMachine.GetRandomInt(0, 4));

            TGPAContext.Instance.ParticleManager.AddParticle(s, false);

            PoulpiSnow ps = new PoulpiSnow(this.location, this.scrollValue, null, mp, this.Flip, this.flagsOnDeath);

            TGPAContext.Instance.AddEnemy(ps);

            //base.TodoOnDeath();
        }
        public override void TodoOnDeath()
        {
            //Free a PoulpiSnow
            MovePattern mp = new MovePattern();

            switch (this.Flip)
            {
                case SpriteEffects.FlipHorizontally:
                    mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2);
                    mp.AddPoint((int)TGPAContext.Instance.ScreenWidth + 1, (int)TGPAContext.Instance.ScreenHeight / 2);
                    break;

                case SpriteEffects.None:
                    mp.AddPoint((int)this.location.X, (int)TGPAContext.Instance.ScreenHeight / 2);
                    mp.AddPoint(-500, (int)TGPAContext.Instance.ScreenHeight / 2);
                    break;
            }

            Snow s = new Snow(this.location, RandomMachine.GetRandomVector2(-100f, 20f, 50f, -300f), 800f, RandomMachine.GetRandomInt(0, 4));
            TGPAContext.Instance.ParticleManager.AddParticle(s, false);

            PoulpiSnow ps = new PoulpiSnow(this.location, this.scrollValue, null, mp, this.Flip, this.flagsOnDeath);
            TGPAContext.Instance.AddEnemy(ps);

            //base.TodoOnDeath();
        }
示例#3
0
        public override void Update(GameTime gameTime)
        {
            if (!targetFound)
            {
                Pattern = null;

                //Chasing the player : build a move pattern on him
                MovePattern mp = new MovePattern();

                int rand = RandomMachine.GetRandomInt(0, 1);

                Player p = TGPAContext.Instance.Player1;
                if ((rand == 0) && (TGPAContext.Instance.Player2 != null))
                {
                    p = TGPAContext.Instance.Player2;
                }

                mp.AddPoint(p.DstRect.Center);

                if (location.X > (int)p.Location.X)
                {
                    mp.AddPoint(new Point(-50, (int)p.Location.Y));
                }
                else
                {
                    mp.AddPoint(new Point(TGPAContext.Instance.ScreenWidth + 100, (int)p.Location.Y));
                }
                Pattern = mp;

                targetFound = true;
            }

            base.Update(gameTime);
        }
示例#4
0
        /// <summary>
        /// Convert nodes in a move pattern
        /// </summary>
        /// <param name="nodes"></param>
        /// <returns></returns>
        public static MovePattern ConvertToMovePattern(Node[] nodes)
        {
            MovePattern mp = new MovePattern();

            foreach (Node n in nodes)
            {
                mp.AddPoint(n.Point);
            }

            return(mp);
        }
        public ElFeroCactae(Vector2 scroll, String[] flags)
            : base(scroll)
        {
            //Source sprite
            sRect = new Rectangle(0, 0, 512, 512);
            Scale = new Vector2(1.3f, 1.3f);

            location = new Vector2(TGPAContext.Instance.TitleSafeArea.Right - this.dRect.Width, TGPAContext.Instance.ScreenHeight + 1);

            etat = CactusStateBoss.Attack;
            frametime = 400;

            ttl = InfiniteTimeToLive;

            //Stats
            wpn = new ElFeroCactaeWPN1();
            wpn2 = new ElFeroCactaeWPN2();
            wpn3 = new ElFeroCactaeWPN3();
            wpn4 = new ElFeroCactaeWPN4();
            attackDuration = 0.0f;

            hp = basicHP;
            maxLifebarValue = hp;
            speed = new Vector2(0f, 70.0f);
            Pattern = new MovePattern();
            Pattern.AddPoint((int)location.X + dRect.Width / 2, 0);

            frametime = 0f;
            points = 125000;
            go = false;
            deltaX = -1;
            attacks = AttackBoss2.Circluar;

            this.hitbox = new EmptyHitbox(this);

            this.flagsOnDeath = flags;

            panel = new BackgroundActiveElement.ElFeroPanel(new Vector2(150, TGPAContext.Instance.ScreenHeight + 1));
            TGPAContext.Instance.AddEnemy(panel);

            this.DrawLifebar = true;
            this.DrawWarning = true;
        }
        public ElFeroCactae(Vector2 scroll, String[] flags)
            : base(scroll)
        {
            //Source sprite
            sRect = new Rectangle(0, 0, 512, 512);
            Scale = new Vector2(1.3f, 1.3f);

            location = new Vector2(TGPAContext.Instance.TitleSafeArea.Right - this.dRect.Width, TGPAContext.Instance.ScreenHeight + 1);

            etat      = CactusStateBoss.Attack;
            frametime = 400;

            ttl = InfiniteTimeToLive;

            //Stats
            wpn            = new ElFeroCactaeWPN1();
            wpn2           = new ElFeroCactaeWPN2();
            wpn3           = new ElFeroCactaeWPN3();
            wpn4           = new ElFeroCactaeWPN4();
            attackDuration = 0.0f;

            hp = basicHP;
            maxLifebarValue = hp;
            speed           = new Vector2(0f, 70.0f);
            Pattern         = new MovePattern();
            Pattern.AddPoint((int)location.X + dRect.Width / 2, 0);

            frametime = 0f;
            points    = 125000;
            go        = false;
            deltaX    = -1;
            attacks   = AttackBoss2.Circluar;

            this.hitbox = new EmptyHitbox(this);

            this.flagsOnDeath = flags;

            panel = new BackgroundActiveElement.ElFeroPanel(new Vector2(150, TGPAContext.Instance.ScreenHeight + 1));
            TGPAContext.Instance.AddEnemy(panel);

            this.DrawLifebar = true;
            this.DrawWarning = true;
        }
示例#7
0
        public override void Update(GameTime gameTime)
        {
            if (!targetFound)
            {
                Pattern = null;

                //Chasing the player : build a move pattern on him
                MovePattern mp = new MovePattern();

                int rand = RandomMachine.GetRandomInt(0, 1);

                Player p = TGPAContext.Instance.Player1;
                if ((rand == 0) && (TGPAContext.Instance.Player2 != null))
                    p = TGPAContext.Instance.Player2;

                mp.AddPoint(p.DstRect.Center);

                if (location.X > (int)p.Location.X)
                {
                    mp.AddPoint(new Point(-50, (int)p.Location.Y));
                }
                else
                {
                    mp.AddPoint(new Point(TGPAContext.Instance.ScreenWidth + 100, (int)p.Location.Y));
                }
                Pattern = mp;

                targetFound = true;
            }

            base.Update(gameTime);
        }