private void LaserShoot() { lock (Bullets) { LaserSound.Play(); LaserFired = true; var laser = new Laser { Shape = { Position = Center, Rotation = Sprite.Rotation } }; Lasers.Add(laser); } }
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; } }
public void Shoot(Laser laser) { Lasers.Add(laser); }
public void AddLaser(string name, string photodiode) { Lasers.Add(name, photodiode); }