Ejemplo n.º 1
0
        public override void update(Player human, EnemyShot[] shotList)
        {
            bool complete = false;

            base.update(human, shotList);

            if (action == 0)
            {
                base.moveTo(300, 300);
            }
            else if (action == 1)
            {
                //Do other stuff
            }
            else if (action == 2)
            {
                //Do differant stuff
            }

            Console.WriteLine("Boss Health: " + Convert.ToString(health));

            if (complete)
            {
                action++;
            }
        }
Ejemplo n.º 2
0
        public override void update(Player human, EnemyShot[] shotList)
        {
            foreach (Shot shot in human.shotList)
            {
                if (hitBox.Intersects(shot.hitBox))
                {
                    // subtract health from hit
                    health = health - shot.damage;

                    // if no health, set to dead
                    if (health <= 0)
                    {
                        alive = false;
                    }

                    // regester that the shot has connected
                    shot.hit = true;
                }
            }

            // Aiming Code
            //moveID = 1;

            //if (rotAngle >= 360 || rotAngle < 0)
            //{
            //    rotAngle = 0;
            //}

            if (moveID == 0)
            {
                if(moveTo(tarx, tary))
                 {
                    //moveID++;
                    shoot(ref shotList);
                 }
            }else if(moveID == 1)
            {
                if (aim(human))
                {
                    //moveID++;
                }

                moveID++;

            }
            else if (moveID == 2)
            {
                if (moveTo(tarx, -110))
                {
                    moveID++;
                }
            }
            else
            {
                alive = false;
            }
            //handle rotation
            this.rotAngle = rotAngle + (float)rotSpeed;

            //update shots
        }
Ejemplo n.º 3
0
 public void shoot(ref EnemyShot[] shotlist)
 {
     //rotAngle = 2;
     EnemyShot shot = new EnemyShot(shotSprite, 4, (int)rotAngle, constants.ENEMY_SHOT_MAXSPEED  - 1,
         xPos, yPos, constants.ENEMY_SHOT_HEIGHT, constants.ENEMY_SHOT_HEIGHT);
     for (int i = 0; i < shotlist.Length; i++)
     {
         if (shotlist[i] == null)
         {
             shotlist[i] = shot;
             break;
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Updates the enemy's position, damage, and alive statues
        /// </summary>
        /// <param name="human"></param>
        public virtual void update(Player human, EnemyShot[] shotList)
        {
            foreach (Shot shot in human.shotList)
            {
                if (hitBox.Intersects(shot.hitBox))
                {
                    // subtract health from hit
                    health = health - shot.damage;

                    // if no health, set to dead
                    if (health <= 0)
                    {
                        alive = false;
                    }

                    // regester that the shot has connected
                    shot.hit = true;
                }
            }
        }