예제 #1
0
        private static void checkExplosionSplashDamage(Vector2 location)
        {
            int explosionSplashRadius = 40;

            foreach (Enemy enemy in EnemyManager.Enemies)
            {
                if (!enemy.Destroyed)
                {
                    if (enemy.EnemyBase.IsCircleColliding(location, explosionSplashRadius))
                    {
                        enemy.Destroyed = true;

                        GameManager.Score += 10;

                        EffectsManager.AddExplosion(enemy.EnemyBase.WorldCenter, Vector2.Zero);
                    }
                }
            }

            Point a = Game1.ConvertToGrid(new Point((int)location.X, (int)location.Y));

            if (TileMap.mapSquares[a.X, a.Y] == TileMap.WeakWallTileEnd)
            {
            }
        }
예제 #2
0
        private static void checkShotEnemyImpacts(Sprite shot)
        {
            if (shot.Expired)
            {
                return;
            }

            foreach (Enemy enemy in EnemyManager.Enemies)
            {
                if (!enemy.Destroyed)
                {
                    if (shot.IsCircleColliding(
                            enemy.EnemyBase.WorldCenter,
                            enemy.EnemyBase.CollisionRadius))
                    {
                        shot.Expired    = true;
                        enemy.Destroyed = true;

                        GameManager.Score += 10;

                        EffectsManager.AddExplosion(
                            enemy.EnemyBase.WorldCenter,
                            enemy.EnemyBase.Velocity / 30);
                    }
                }
            }
        }