Ejemplo n.º 1
0
        public override void TryShoot()
        {
            if (World.Instance.FrameCount < basicShotAvailableFrame)
            {
                return;
            }

            basicShotAvailableFrame = World.Instance.FrameCount + Delay;

            for (var i = 0; i < MultiGuns; i++)
            {
                var bullet      = RecycleFactory.NewBullet(new DumbController(), this, Owner.UpgradeGroup.CannonPower.Level);
                var insertindex = Methods.Random.Next(FireQueue.Count);
                FireQueue.Insert(insertindex, bullet);
                GunIndexQueue.Insert(insertindex, i);
            }
        }
Ejemplo n.º 2
0
        public void Loop()
        {
            FrameCount++;
            PlayerShip.Loop();

            for (var i = Ships.Count - 1; i >= 0; i--)
            {
                Ships[i].Loop();

                if (Ships[i].LoopResultStates.Remove)
                {
                    Ships.RemoveAt(i);
                }
            }
            for (var i = Bullets.Count - 1; i >= 0; i--)
            {
                Bullets[i].Loop();

                if (Bullets[i].LoopResultStates.Remove)
                {
                    RecycleFactory.Recycle(Bullets[i]);
                    Bullets.RemoveAt(i);
                }
            }
            for (var i = Trails.Count - 1; i >= 0; i--)
            {
                Trails[i].Loop();

                if (Trails[i].LoopResultStates.Remove)
                {
                    RecycleFactory.Recycle(Trails[i]);
                    Trails.RemoveAt(i);
                }
            }

            HUD.Loop();
        }
Ejemplo n.º 3
0
 public void CreateTrail()
 {
     // bullet trail.
     trail = RecycleFactory.NewTrail(this, 0.8f, Constants.DamageColors[colorIndex]);
     World.Instance.AddTrail(trail);
 }