protected override void OnTick(float interval)
        {
            if (!spawnedUniqueEnemies)
            {
                /*LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2 (-maxWidth / 2, maxHeight / 2)));
                *  LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2 (-maxWidth / 2, maxHeight / 2)));
                *  LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2 (-maxWidth / 2, maxHeight / 2)));
                *  LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2 (-maxWidth / 2, maxHeight / 2)));*/
                ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
                ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
                ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
                ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
                spawnedUniqueEnemies = true;
                spawnCount          += 4;
            }

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 150, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, maxHeight / 2 - 150), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 150, maxHeight / 2 - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, maxHeight / 2 - 150), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 150, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(-maxWidth / 2 + 50, -maxHeight / 2 + 150), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 150, -maxHeight / 2 + 50), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(maxWidth / 2 - 50, -maxHeight / 2 + 150), SPM.AngleFacingNearestPlayerShip(new Vector2(-maxWidth / 2, maxHeight / 2)));
            spawnCount += 8;

            if (spawnCount >= spawnLimit)
            {
                Kill();
            }
        }
 protected override void OnTrigger()
 {
     for (int i = 0; i < Count; i++)
     {
         Vector2 spawnPosition = SPM.GenerateValidCenter(radius);
         float   angle         = SPM.AngleFacingNearestPlayerShip(spawnPosition);
         ShootingEnemyEntity.Spawn(Engine, ProcessManager, spawnPosition, angle);
     }
 }
Beispiel #3
0
        protected override void OnTrigger()
        {
            //Console.WriteLine("Triggered SpawnShootingTriangle");
            Center = SPM.GenerateValidCenter(radius);

            ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X, Center.Y + 50), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X, Center.Y + 50)));
            ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 50, Center.Y - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X - 50, Center.Y - 50)));
            ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 50, Center.Y - 50), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X + 50, Center.Y - 50)));
        }
        protected override void OnTick(float interval)
        {
            if (_enemyEntities.Count < CVars.Get <int>("spawner_max_enemy_count"))
            {
                Vector2 spawnPosition = new Vector2(0, 0);
                do
                {
                    spawnPosition.X = random.NextSingle(-CVars.Get <float>("screen_width") / 2 * 0.9f, CVars.Get <float>("screen_width") / 2 * 0.9f);
                    spawnPosition.Y = random.NextSingle(-CVars.Get <float>("screen_height") / 2 * 0.9f, CVars.Get <float>("screen_height") / 2 * 0.9f);
                } while (IsTooCloseToPlayer(spawnPosition));

                float facingNearestPlayer = AngleFacingNearestPlayerShip(spawnPosition);
                ShootingEnemyEntity.Spawn(Engine, ProcessManager, spawnPosition, facingNearestPlayer);
            }

            Interval = MathHelper.Max(Interval * CVars.Get <float>("spawner_shooting_enemy_period_multiplier"), CVars.Get <float>("spawner_shooting_enemy_period_min"));
        }
        protected override void OnTick(float interval)
        {
            if (_enemyEntities.Count < Constants.GamePlay.SPAWNER_MAX_ENEMY_COUNT)
            {
                Vector2 spawnPosition = new Vector2(0, 0);
                do
                {
                    spawnPosition.X = random.NextSingle(-Constants.Global.WINDOW_WIDTH / 2 * 0.9f, Constants.Global.WINDOW_WIDTH / 2 * 0.9f);
                    spawnPosition.Y = random.NextSingle(-Constants.Global.WINDOW_HEIGHT / 2 * 0.9f, Constants.Global.WINDOW_HEIGHT / 2 * 0.9f);
                } while (IsTooCloseToPlayer(spawnPosition));

                ShootingEnemyEntity.Create(Engine,
                                           Content.Load <Texture2D>(Constants.Resources.TEXTURE_SHOOTER_ENEMY),
                                           spawnPosition, ProcessManager, Content);
            }

            Interval = MathHelper.Max(Interval, Constants.GamePlay.SPAWNER_KAMIKAZE_PERIOD_MIN);
        }
Beispiel #6
0
        protected override void OnTrigger()
        {
            // If Gravity hole is re-implemented, make it so that the two gravity holes are either
            // 1) randomly placed, or 2) Mirrored from each-other

            /*Center = SPM.GenerateValidCenter(radius);
             * GravityHoleEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 50, Center.Y));
             * GravityHoleEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 50, Center.Y));*/

            Center = SPM.GenerateValidCenter(radius);
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 50, Center.Y + 50), SPM.AngleFacingNearestPlayerShip(Center));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 50, Center.Y - 50), SPM.AngleFacingNearestPlayerShip(Center));

            Center = SPM.GenerateValidCenter(radius);
            ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 50, Center.Y + 50), SPM.AngleFacingNearestPlayerShip(Center));
            ShootingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 50, Center.Y - 50), SPM.AngleFacingNearestPlayerShip(Center));

            Center = SPM.GenerateValidCenter(radius);
            LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 50, Center.Y - 50), SPM.AngleFacingNearestPlayerShip(Center));
            LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 50, Center.Y + 50), SPM.AngleFacingNearestPlayerShip(Center));
        }