protected override void OnTrigger()
 {
     for (int i = 0; i < 3; i++)
     {
         Vector2 spawnPosition = SPM.GenerateValidCenter(radius);
         float   angle         = SPM.AngleFacingNearestPlayerShip(spawnPosition);
         LaserEnemyEntity.Spawn(Engine, ProcessManager, spawnPosition, angle);
     }
 }
예제 #2
0
        protected override void OnTrigger()
        {
            //Console.WriteLine("Triggered SpawnChasingTrianlge");
            Center = SPM.GenerateValidCenter(radius);

            LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X, Center.Y + 25), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X, Center.Y + 25)));
            LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 29, Center.Y - 25), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X - 29, Center.Y - 25)));
            LaserEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 29, Center.Y - 25), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X + 29, Center.Y - 25)));
        }
        protected override void OnTick(float interval)
        {
            if (_enemyEntities.Count < CVars.Get <int>("spawner_max_enemy_count") &&
                _laserEntities.Count < CVars.Get <int>("spawner_laser_enemy_max_entities"))
            {
                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);
                LaserEnemyEntity.Spawn(Engine, ProcessManager, spawnPosition, facingNearestPlayer);
            }

            Interval = MathHelper.Max(Interval * CVars.Get <float>("spawner_laser_enemy_period_multiplier"), CVars.Get <float>("spawner_laser_enemy_period_min"));
        }
예제 #4
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));
        }