Пример #1
0
 private void LaserShoot()
 {
     lock (Bullets)
     {
         LaserSound.Play();
         LaserFired = true;
         var laser = new Laser
         {
             Shape =
             {
                 Position = Center,
                 Rotation = Sprite.Rotation
             }
         };
         Lasers.Add(laser);
     }
 }
Пример #2
0
        public void AddToInventory(Laser laser)
        {
            var existing = Lasers.FirstOrDefault(l => l.Name.ToLower().Equals(laser.Name.ToLower()));

            if (existing != null)
            {
                existing.RemainingAmmo += laser.StartingAmmo;
                LaserIndex              = Lasers.IndexOf(existing);
            }
            else
            {
                Lasers.Add(new WeaponInfo
                {
                    Texture        = laser.Texture,
                    Name           = laser.Name,
                    RemainingAmmo  = laser.StartingAmmo,
                    ProjectileName = laser.ProjectileName
                });

                // make this the current laser
                LaserIndex = Lasers.Count - 1;
            }
        }
Пример #3
0
 public void Shoot(Laser laser)
 {
     Lasers.Add(laser);
 }
Пример #4
0
 public void AddLaser(string name, string photodiode)
 {
     Lasers.Add(name, photodiode);
 }