示例#1
0
        public void UpdateSplashDamage(List <Enemy> enemies, GameTime gameTime)
        {
            for (int i = 0; i < bulletList.Count; i++)
            {
                SplashBullet b = bulletList[i] as SplashBullet;
                b.SetRotation(rotation);
                b.Update(gameTime);

                if (target != null)
                {
                    if (target.IsHit(b))
                    {
                        List <Enemy> tempList = b.GetEnemiesInSplash(enemies);
                        foreach (Enemy enemy in tempList)
                        {
                            enemy.Intersects(b);
                        }

                        b.Kill();
                    }
                }


                if (!IsInRange(b.Center))
                {
                    b.Kill();
                }

                if (b.IsDead() || target == null)
                {
                    bulletList.Remove(b);
                }
            }
        }
示例#2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Updates the splash damage. </summary>
        ///
        /// <remarks>   Frost, 16.11.2010. </remarks>
        ///
        /// <param name="enemies">  The enemies. </param>
        /// <param name="gameTime"> Time of the game. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public void UpdateSplashDamage(List <Enemy> enemies, GameTime gameTime)
        {
            for (int i = 0; i < bulletList.Count; i++)
            {
                SplashBullet b = bulletList[i] as SplashBullet;
                b.SetRotation(rotation);
                b.Update(gameTime);

                if (target != null && !target.isSlow)
                {
                    if (target.IsHit(b))
                    {
                        List <Enemy> tempList = b.GetEnemiesInSplash(enemies);
                        foreach (Enemy enemy in tempList)
                        {
                            enemy.Intersects(b);
                            // slowenemy
                            slowEnemy(enemy, 0.8f);
                        }

                        b.Kill();
                        soundBank.PlayCue("30935__aust_paul__possiblelazer");
                    }
                }


                if (!IsInRange(b.Center))
                {
                    b.Kill();
                }

                if (b.IsDead() || target == null)
                {
                    bulletList.Remove(b);
                }
            }
        }