Exemplo n.º 1
0
        protected override void OnTick(float interval)
        {
            if (!SPM.IsTooCloseToPlayer(nextSpawnLocation, 150))
            {
                ChasingEnemyEntity.Spawn(Engine, ProcessManager, nextSpawnLocation, SPM.AngleFacingNearestPlayerShip(nextSpawnLocation));
                spawnNumber += 1;
            }

            if (spawnNumber > 2 && (nextSpawnLocation == originalSpawnLocation))
            {
                Kill();
            }

            if (spawnerDirection.X != 0)
            {
                nextSpawnLocation.X += spawnerDirection.X * spacingInterval;
                if (nextSpawnLocation.X > maxWidth / 2 || nextSpawnLocation.X < -maxWidth / 2)
                {
                    nextSpawnLocation = new Vector2(spawnerDirection.X * maxWidth / 2 - (spawnerDirection.X * horizontalSpacing),
                                                    spawnerDirection.X * maxHeight / 2 - (spawnerDirection.X * (verticalSpacing + spacingInterval)));
                    spawnerDirection = new Vector2(0, -spawnerDirection.X);
                }
            }
            else if (spawnerDirection.Y != 0)
            {
                nextSpawnLocation.Y += spawnerDirection.Y * spacingInterval;
                if (nextSpawnLocation.Y > maxHeight / 2 || nextSpawnLocation.Y < -maxHeight / 2)
                {
                    nextSpawnLocation = new Vector2(spawnerDirection.Y * -maxWidth / 2 + (spawnerDirection.Y * (horizontalSpacing + spacingInterval)),
                                                    spawnerDirection.Y * maxHeight / 2 - (spawnerDirection.Y * verticalSpacing));

                    spawnerDirection = new Vector2(spawnerDirection.Y, 0);
                }
            }
        }
 protected override void OnTrigger()
 {
     for (int i = 0; i < Count; i++)
     {
         Vector2 spawnPosition = SPM.GenerateValidCenter(radius);
         float   angle         = SPM.AngleFacingNearestPlayerShip(spawnPosition);
         ChasingEnemyEntity.Spawn(Engine, ProcessManager, spawnPosition, angle);
     }
 }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
0
        protected override void OnTrigger()
        {
            //Console.WriteLine("Triggered SpawnChasingTrianlge");
            Center = SPM.GenerateValidCenter(radius);

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X, Center.Y + 180), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X, Center.Y + 180)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X, Center.Y - 180), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X, Center.Y - 180)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 180, Center.Y), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X + 180, Center.Y)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 180, Center.Y), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X - 180, Center.Y)));

            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 128, Center.Y + 128), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X + 128, Center.Y + 128)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X + 128, Center.Y - 128), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X + 128, Center.Y - 128)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 128, Center.Y + 128), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X - 128, Center.Y + 128)));
            ChasingEnemyEntity.Spawn(Engine, ProcessManager, new Vector2(Center.X - 128, Center.Y - 128), SPM.AngleFacingNearestPlayerShip(new Vector2(Center.X - 128, Center.Y - 128)));
        }
Exemplo n.º 5
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 (!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();
            }
        }