Example #1
0
        public static Bosses CreateBosses(Vector2 position)
        {
            var bosses = new Bosses(GameRoot.Boss, position);

            bosses.AddBehaviour(bosses.FollowPlayer());
            return(bosses);
        }
Example #2
0
        public static void Update()
        {
            if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
            {
                if (rand.Next(1, 500) == 1)
                {
                    EntityManager.Add(Speed.CreateSpeed(GetSpawnPosition()));
                }
                if (rand.Next(1, 250) == 1)
                {
                    EntityManager.Add(Ammo.CreateAmmo(GetSpawnPosition()));
                }
                if (rand.Next((int)inverseSpawnChance) == 0)
                {
                    EntityManager.Add(Enemy.CreateSeeker(GetSpawnPosition()));
                }
                if (rand.Next(1, 2) == 1 && GameRoot.state3 == true && Count < 1)
                {
                    Count = Count + 1;
                    EntityManager.Add(Bosses.CreateBosses(GetSpawnPosition()));
                }
            }

            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 20)
            {
                inverseSpawnChance -= 0.005f;
            }
            if (ammoChance > 20)
            {
                ammoChance -= 0.5f;
            }
        }
Example #3
0
        public void HandleCollision(Bosses other)
        {
            var d = Position - other.Position;

            Velocity += 10 * d / (d.LengthSquared() + 1);
        }